﻿/* Контейнер таблицы */
.astro-table-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1600px;
    height: 90vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.astro-data-table th {
    padding: 12px 4px;
    word-break: break-word;
    max-width: 100px !important; /* Ограничивает ширину для переноса */
}

/* Секция фильтров */
.astro-filters-section {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    max-height: 40%;
    overflow-y: auto;
}

.astro-table-filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.astro-table-filter-item {
    flex: 1;
    min-width: 0;
}

    .astro-table-filter-item label {
        display: block;
        margin-bottom: 5px;
        font-family: 'Ysabeau Infant SemiBold';
        font-size: 12px;
        color: #3F2E21;
    }

.astro-table-filter-select {
    width: 100%;
    padding: 1px;
    border: 1px solid #A38C7C;
    border-radius: 8px;
    background: white;
    font-family: 'Ysabeau Infant Regular';
    font-size: 12px;
    color: #3F2E21;
    max-height: 30px;
}

.astro-table-multi-select-group {
    display: flex;
    gap: 8px;
}

    .astro-table-multi-select-group .filter-select {
        flex: 1;
    }

/* Кнопки действий */
.astro-table-actions {
    padding: 15px 20px;
    background: #EFECE6;
    border-bottom: 1px solid #DBC9B7;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.astro-calculate-btn {
    padding: 12px 30px;
    background: #A38C7C;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Ysabeau Infant SemiBold';
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

    .astro-calculate-btn:hover {
        background: #8D7563;
    }


/* Адаптация для мобильных */
@media (max-width: 768px) {
    .astro-table-filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .astro-table-multi-select-group {
        flex-direction: column;
    }

    .astro-table-actions {
        flex-direction: column;
    }
}

.astro-table-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}


.astro-table-dropdown {
    position: relative;
    display: inline-block;
}

.astro-table-dropdown-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.astro-table-dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
}

.astro-table-dropdown:hover .astro-table-dropdown-content {
    display: block;
}

.astro-table-dropdown-header {
    padding: 8px;
    background: #f8f9fa;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.astro-table-dropdown-item {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

    .astro-table-dropdown-item:last-child {
        border-bottom: none;
    }

.astro-table-common-date-row {
    background-color: #f0fff0;
    font-weight: bold;
}

.astro-table-clear-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .astro-table-clear-btn:hover {
        background: #cc0000;
    }

.astro-table-checkbox-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.astro-table-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

    .astro-table-checkbox-label input[type="checkbox"] {
        accent-color: #A38C7C; /* Цвет галки и фона */
        cursor: pointer;
    }

/* Общий контейнер для табличной структуры */
.astro-table-form-grid {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr; /* 5 колонок: label-данные-label-данные-кнопка */
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

.astro-table-form-grid-three-columns {
    display: grid;
    grid-template-columns: auto 1fr auto; /* 3 колонки */
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

.astro-table-form-grid-six-columns {
    display: grid;
    /* Сбалансированные пропорции, сумма ≈ 4.5fr (но это нормально с min-width: 0) */
    grid-template-columns: 0.8fr 1.2fr 0.3fr 1.5fr 0.3fr 1.5fr;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    /* Критически важно для адаптивности */
    grid-auto-columns: minmax(0, 1fr);
}

    /* ОБЯЗАТЕЛЬНО для всех grid-элементов */
    .astro-table-form-grid-six-columns > * {
        min-width: 0; /* Позволяет сжиматься при нехватке места */
        overflow: hidden; /* Скрывает переполнение текста */
    }

/* Специфично для ваших элементов */
.astro-table-period-select {
    /* Уберите отрицательный margin, он ломает layout */
    margin-left: 0;
    width: 100%;
}


.control-group.period-group {
    display: flex;
}

.astro-table-date-label {
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    font-size: 14px;
    color: #3F2E21;
    text-align: center;
    min-width: 20px;
}


.astro-table-date-picker {
    width: 100%;
    min-width: 130px;
}

/* Стили для меток (labels) */
.astro-table-label {
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    font-size: 14px;
    color: #3F2E21;
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: 0.5rem;
    text-align: left;
}

.astro-table-input {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #A38C7C;
    border-radius: 10px;
    padding: 5px 10px;
    height: 35px;
    font-family: 'Ysabeau Infant Medium';
    color: #3F2E21;
    box-sizing: border-box;
}

/* Кнопки */
.astro-table-btn {
    background: #E9E4DD !important;
    border-radius: 10px;
    border: none;
    color: #3F2E21 !important;
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    text-transform: uppercase;
    padding: 0px 8px !important;
    cursor: pointer;
    height: 15px !important;
    white-space: nowrap;
    width: 35px; /* Фиксированная ширина для всех кнопок */
    text-align: center;
}

.rz-button.astro-table-btn {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
}

.astro-table-btn-icon {
    width: 20px; /* 🔹 Размер иконки */
    height: 20px;
}

.astro-table-btn-close {
    /*background: #E9E4DD !important;
    border-radius: 10px;
    border: none;*/
    color: #3F2E21 !important;
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    font-size: 17px;
    text-transform: uppercase;
    padding: 0px 2px !important;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
}

/* Кнопка добавления (галочка) */
.astro-table-add-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

/* Область результата */
.astro-table-result-area {
    font-family: 'Wstartt', sans-serif;
    font-size: 16px;
    flex: 1;
    min-height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    min-width: 200px;
}

.astro-table-form-grid-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.astro-table-period-group-compact {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 110px;
}

.astro-table-compact-label {
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    font-size: 11px;
    color: #3F2E21;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.astro-table-compact-select {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #A38C7C;
    border-radius: 10px;
    padding: 5px 10px;
    height: 35px;
    font-family: 'Ysabeau Infant Medium';
    color: #3F2E21;
    box-sizing: border-box;
}

.astro-table-date-group-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.astro-table-date-prefix {
    font-family: 'Ysabeau Infant Medium';
    font-weight: 500;
    font-size: 13px;
    color: #3F2E21;
    min-width: 15px;
    text-align: center;
    margin-right: 15px;
}

.astro-table-compact-datepicker {
    flex: 1;
    min-width: 140px !important; /* Минимальная ширина */
    max-width: 295px !important; /* Максимальная ширина */
}

.astro-table-period-inline-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .astro-table-period-inline-group .astro-table-label {
        font-size: 13px;
        padding-right: 0;
        margin: 0;
        white-space: nowrap;
    }

    .astro-table-period-inline-group .astro-table-period-select {
        margin-left: 0;
        min-width: 120px;
    }


/* Основной контейнер фильтра */
.astro-table-filter-compact {
    width: 100%;
    margin-bottom: 0px;
}

.astro-table-filter-header label {
    display: inline-block;
    margin-bottom: 8px;
    font-family: 'Ysabeau Infant SemiBold';
    font-size: 12px;
    color: #3F2E21;
}

/* Группа планета-знак */
.astro-table-planet-sign-group {
    display: flex;
    align-items: stretch;
    gap: 15px;
    width: 100%;
}

/* Левая часть - селекты */
.astro-table-selection-area {
    flex: 0 0 auto;
    min-width: 300px;
}


/* Правая часть - результат */
.astro-table-result-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.astro-table-result-display {
    font-family: 'Wstartt', sans-serif;
    font-size: 14px;
    flex: 1;
    min-height: 32px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 10px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.astro-table-additional-conditions-row {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

    .astro-table-additional-conditions-row .astro-table-checkbox-row {
        display: flex;
        gap: 20px;
        flex: 1;
        flex-wrap: wrap;
    }

    .astro-table-additional-conditions-row .astro-table-checkbox-label {
        display: flex;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }

/* Контейнер для дат */
.astro-table-dates-container {
    position: relative;
}

/* Кнопка с количеством записей */
.astro-table-dates-button {
    background: #A38C7C;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Ysabeau Infant Medium';
    transition: background 0.2s;
    min-width: 60px;
    text-align: center;
}

    .astro-table-dates-button:hover {
        background: #8D7563;
    }

.astro-table-planet-symbol {
    font-family: 'Wstartt', sans-serif;
    font-size: 16px;
    opacity: 0.6;
}

    .astro-table-planet-symbol.strikethrough {
        font-family: 'Wstartt', sans-serif;
        font-size: 16px;
        text-decoration: line-through;
        text-decoration-color: #B76565; /* красная линия */
        text-decoration-thickness: 2px;
        opacity: 0.6;
    }


/* Адаптивность */
@media (max-width: 768px) {
    .astro-table-form-grid-compact {
        flex-direction: column; /* Вертикальное расположение */
        align-items: stretch; /* Растягиваем на всю ширину */
        gap: 0.25rem;
        /*padding: 0 10px;  Отступы по бокам */
        box-sizing: border-box;
        width: calc(100% - 50px) !important;
    }
}
