/*
 * Стили для таблиц - Sertvsk Waste Management Theme
 * Версия: 1.0
 * Дата: 20.10.2025
 */

/* ========================================
   ОСНОВНЫЕ СТИЛИ ТАБЛИЦ
   ======================================== */

/* Стили для стандартных таблиц WordPress (Gutenberg) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table.bg-bg-100 {
    background: #fff !important;
}

table.min-w-full {
    min-width: 100% !important;
}

table.border-separate {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

table.text-sm {
    font-size: 14px !important;
}

table.leading-\[1\.88888\] {
    line-height: 1.88888 !important;
}

table.whitespace-normal {
    white-space: normal !important;
}

/* Заголовки таблиц */
table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
}

/* Ячейки таблиц */
table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

/* Строки таблиц */
table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Последняя строка без границы */
table tbody tr:last-child td {
    border-bottom: none;
}

/* Адаптивность для стандартных таблиц */
@media (max-width: 768px) {
    table {
        font-size: 13px;
        margin: 15px 0;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 12px;
        margin: 10px 0;
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
}

/* Контейнер таблицы */
.table-container {
    width: 100%;
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Обертка таблицы */
.table-wrapper {
    min-width: 100%;
    overflow-x: auto;
}

/* Основная таблица */
.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
}

/* Заголовок таблицы */
.table-container thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

/* Заголовки колонок */
.table-container th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
}

/* Разделитель между заголовками */
.table-container th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

/* Ячейки данных */
.table-container td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

/* Строки таблицы */
.table-container tbody tr {
    transition: background-color 0.2s ease;
}

/* Hover эффект для строк */
.table-container tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Последняя строка без границы */
.table-container tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   РАЗМЕРЫ КОЛОНОК
   ======================================== */

/* Маленькие колонки */
.table-container th[data-col-size="sm"],
.table-container td[data-col-size="sm"] {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

/* Средние колонки */
.table-container th[data-col-size="md"],
.table-container td[data-col-size="md"] {
    width: 150px;
    min-width: 150px;
}

/* Большие колонки */
.table-container th[data-col-size="lg"],
.table-container td[data-col-size="lg"] {
    width: 250px;
    min-width: 250px;
}

/* Жирный текст в ячейках */
.table-container td strong {
    color: #2c3e50;
    font-weight: 600;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

/* Планшеты */
@media (max-width: 768px) {
    .table-container {
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .table-container table {
        font-size: 13px;
    }
    
    .table-container th,
    .table-container td {
        padding: 10px 8px;
    }
    
    .table-container th[data-col-size="sm"],
    .table-container td[data-col-size="sm"] {
        width: 60px;
        min-width: 60px;
    }
    
    .table-container th[data-col-size="md"],
    .table-container td[data-col-size="md"] {
        width: 120px;
        min-width: 120px;
    }
    
    .table-container th[data-col-size="lg"],
    .table-container td[data-col-size="lg"] {
        width: 200px;
        min-width: 200px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .table-container {
        margin: 10px 0;
        border-radius: 4px;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    }
    
    .table-container table {
        font-size: 12px;
    }
    
    .table-container th,
    .table-container td {
        padding: 8px 6px;
    }
    
    .table-container th[data-col-size="sm"],
    .table-container td[data-col-size="sm"] {
        width: 50px;
        min-width: 50px;
    }
    
    .table-container th[data-col-size="md"],
    .table-container td[data-col-size="md"] {
        width: 100px;
        min-width: 100px;
    }
    
    .table-container th[data-col-size="lg"],
    .table-container td[data-col-size="lg"] {
        width: 150px;
        min-width: 150px;
    }
}

/* ========================================
   СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ
   ======================================== */

/* Анимация появления */
.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Анимация строк */
.table-container tbody tr {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.table-container tbody tr:nth-child(1) { animation-delay: 0.1s; }
.table-container tbody tr:nth-child(2) { animation-delay: 0.2s; }
.table-container tbody tr:nth-child(3) { animation-delay: 0.3s; }
.table-container tbody tr:nth-child(4) { animation-delay: 0.4s; }
.table-container tbody tr:nth-child(5) { animation-delay: 0.5s; }
.table-container tbody tr:nth-child(6) { animation-delay: 0.6s; }
.table-container tbody tr:nth-child(7) { animation-delay: 0.7s; }
.table-container tbody tr:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ВАРИАНТЫ ТАБЛИЦ
   ======================================== */

/* Компактная таблица */
.table-container.table-compact table {
    font-size: 13px;
}

.table-container.table-compact th,
.table-container.table-compact td {
    padding: 8px 10px;
}

/* Большая таблица */
.table-container.table-large table {
    font-size: 16px;
}

.table-container.table-large th,
.table-container.table-large td {
    padding: 18px 15px;
}

/* Таблица с полосами */
.table-container.table-striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table-container.table-striped tbody tr:nth-child(even):hover {
    background-color: #e9ecef;
}

/* Таблица с границами */
.table-container.table-bordered table {
    border: 1px solid #dee2e6;
}

.table-container.table-bordered th,
.table-container.table-bordered td {
    border: 1px solid #dee2e6;
}

/* ========================================
   ЦВЕТОВЫЕ СХЕМЫ
   ======================================== */

/* Зеленая схема (для экологических данных) */
.table-container.table-green thead {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

/* Синяя схема (для технических данных) */
.table-container.table-blue thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Оранжевая схема (для предупреждений) */
.table-container.table-orange thead {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

/* Красная схема (для критических данных) */
.table-container.table-red thead {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ
   ======================================== */

/* Заголовок таблицы */
.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Подпись таблицы */
.table-caption {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}

/* Кнопки действий в таблице */
.table-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.table-actions .btn-primary {
    background: #3498db;
    color: white;
}

.table-actions .btn-primary:hover {
    background: #2980b9;
}

.table-actions .btn-danger {
    background: #e74c3c;
    color: white;
}

.table-actions .btn-danger:hover {
    background: #c0392b;
}

/* ========================================
   УТИЛИТЫ
   ======================================== */

/* Скрытие на мобильных */
@media (max-width: 768px) {
    .table-hide-mobile {
        display: none;
    }
}

/* Центрирование текста */
.text-center {
    text-align: center;
}

/* Выравнивание по правому краю */
.text-right {
    text-align: right;
}

/* Выравнивание по левому краю */
.text-left {
    text-align: left;
}

/* Жирный текст */
.font-weight-bold {
    font-weight: 600;
}

/* Курсив */
.font-italic {
    font-style: italic;
}

/* Маленький текст */
.text-small {
    font-size: 12px;
}

/* Большой текст */
.text-large {
    font-size: 16px;
}
