/**
 * Frontend CSS for TL2 Timetable Manager
 * Design Token Synchronized with Flatsome (1370px container)
 */

:root {
    --tl2-tt-primary: #044485;
    --tl2-tt-primary-dark: #003b73;
    --tl2-tt-secondary: #004183;
    --tl2-tt-accent: #ff7400;
    --tl2-tt-accent-hover: #e06300;
    --tl2-tt-success: #2c8e47;
    --tl2-tt-bg-light: #f8fbfe;
    --tl2-tt-border: #e2e8f0;
    --tl2-tt-text: #2d3748;
    --tl2-tt-text-muted: #718096;
    --tl2-tt-radius: 12px;
    --tl2-tt-shadow: 0 10px 25px rgba(4, 68, 133, 0.08);
}

.tl2-tt-wrapper {
    width: 100%;
    margin: 0 auto;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--tl2-tt-text);
}

.tl2-tt-top-hero-block {
    width: 100%;
    margin-bottom: 0;
}

.tl2-tt-top-hero-block .section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.tl2-tt-ux-hero-block {
    width: 100%;
    margin-bottom: 25px;
}

.tl2-tt-container {
    max-width: 1370px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==========================================================================
   1. HERO BANNER
   ========================================================================== */
.tl2-tt-hero {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    background: linear-gradient(135deg, #dff2ff 0%, #edf7ff 50%, #f4faff 100%);
    border-radius: var(--tl2-tt-radius);
    margin-bottom: 30px;
    box-shadow: var(--tl2-tt-shadow);
}

.tl2-tt-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.88) 45%, rgba(255,255,255,0.3) 80%);
    z-index: 1;
    pointer-events: none;
}

.tl2-tt-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: linear-gradient(0deg, rgba(248, 251, 254, 0.8), rgba(248, 251, 254, 0));
    z-index: 1;
    pointer-events: none;
}

.tl2-tt-hero-container {
    position: relative;
    z-index: 2;
    max-width: 1370px;
    margin: 0 auto;
    padding: 45px 30px;
}

.tl2-tt-hero-content {
    max-width: 760px;
}

.tl2-tt-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tl2-tt-primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.tl2-tt-hero-title {
    margin: 0;
    color: var(--tl2-tt-primary);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.tl2-tt-divider {
    width: 220px;
    height: 2px;
    margin: 18px 0;
    background: linear-gradient(90deg, var(--tl2-tt-accent), var(--tl2-tt-accent) 42%, transparent 42%, transparent 58%, var(--tl2-tt-accent) 58%);
    position: relative;
}

.tl2-tt-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--tl2-tt-accent);
    border: 3px solid #fff;
}

.tl2-tt-hero-desc {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.6;
    color: #334e68;
}

.tl2-tt-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tl2-tt-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(4, 68, 133, 0.15);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tl2-tt-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* ==========================================================================
   2. 2-COLUMN LAYOUT & SIDEBAR FILTER CARD
   ========================================================================== */
.tl2-tt-layout-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: start;
}

.tl2-tt-sidebar-col {
    position: sticky;
    top: 90px;
    z-index: 10;
}

.tl2-tt-main-col {
    min-width: 0;
}

.tl2-tt-filter-card {
    background: #ffffff;
    border: 1px solid var(--tl2-tt-border);
    border-radius: var(--tl2-tt-radius);
    padding: 22px 20px;
    box-shadow: var(--tl2-tt-shadow);
    margin-bottom: 0;
    border-top: 4px solid var(--tl2-tt-primary);
}

.tl2-tt-filter-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--tl2-tt-border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.tl2-tt-filter-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--tl2-tt-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.tl2-tt-filter-subtitle {
    font-size: 12.5px;
    color: var(--tl2-tt-text-muted);
}

.tl2-tt-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.tl2-tt-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tl2-tt-filter-item label {
    font-size: 13px;
    font-weight: 700;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tl2-tt-filter-item input,
.tl2-tt-filter-item select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--tl2-tt-border);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    color: var(--tl2-tt-text);
    transition: all 0.2s ease;
    box-shadow: none !important;
    box-sizing: border-box;
}

.tl2-tt-filter-item input:focus,
.tl2-tt-filter-item select:focus {
    border-color: var(--tl2-tt-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(4, 68, 133, 0.12) !important;
}

.tl2-tt-search-item {
    grid-column: 1 / -1;
}

.tl2-tt-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
}

.tl2-tt-filter-actions .button {
    border-radius: 8px;
    font-weight: 700;
    padding: 0 16px;
    height: 42px;
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0;
}

/* ==========================================================================
   3. RESULTS BAR & CARD GRID
   ========================================================================== */
.tl2-tt-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--tl2-tt-text-muted);
}

.tl2-tt-results-count strong {
    color: var(--tl2-tt-primary);
}

.tl2-tt-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    transition: opacity 0.2s ease;
}

.tl2-tt-card {
    background: #ffffff;
    border: 1px solid var(--tl2-tt-border);
    border-radius: var(--tl2-tt-radius);
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tl2-tt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(4, 68, 133, 0.12);
    border-color: #cbd5e1;
}

.tl2-tt-card.is-active-tt {
    border-top: 4px solid var(--tl2-tt-primary);
}

.tl2-tt-card.is-archived-tt {
    border-top: 4px solid #94a3b8;
    background: #fafafa;
}

.tl2-tt-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tl2-tt-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tl2-badge-lop {
    background: #044485;
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
}

.tl2-badge-tuan {
    background: #fff3e6;
    color: #d97706;
    border: 1px solid #fed7aa;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.tl2-badge-ph {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.tl2-status-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.tl2-status-pill.pill-active {
    background: #dcfce7;
    color: #15803d;
}

.tl2-status-pill.pill-archived {
    background: #f1f5f9;
    color: #64748b;
}

.tl2-tt-card-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.tl2-tt-card-title a {
    color: var(--tl2-tt-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tl2-tt-card-title a:hover {
    color: var(--tl2-tt-accent);
}

.tl2-tt-card-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--tl2-tt-border);
}

.tl2-meta-item {
    font-size: 12px;
    color: var(--tl2-tt-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tl2-meta-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--tl2-tt-primary);
}

.tl2-meta-item.tl2-meta-date {
    grid-column: span 2;
    color: var(--tl2-tt-success);
    font-weight: 600;
}

.tl2-tt-card-note {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
    margin: 0 0 16px;
    flex-grow: 1;
}

.tl2-tt-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.tl2-tt-card-actions .button {
    margin: 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    height: 34px;
    line-height: 34px;
    padding: 0 12px;
}

.tl2-tt-card-actions .button.primary {
    background-color: var(--tl2-tt-primary);
}

.tl2-tt-card-actions .button.success {
    background-color: var(--tl2-tt-success);
}

/* ==========================================================================
   4. PAGINATION & NO RESULTS
   ========================================================================== */
.tl2-tt-pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.tl2-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tl2-pagination a,
.tl2-pagination span.current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--tl2-tt-border);
    background: #ffffff;
    color: var(--tl2-tt-primary);
}

.tl2-pagination span.current,
.tl2-pagination a:hover {
    background: var(--tl2-tt-primary);
    color: #ffffff;
    border-color: var(--tl2-tt-primary);
}

.tl2-no-results {
    text-align: center;
    padding: 50px 20px;
    background: #ffffff;
    border-radius: var(--tl2-tt-radius);
    border: 1px dashed var(--tl2-tt-border);
}

.tl2-no-results h4 {
    font-size: 18px;
    color: var(--tl2-tt-primary);
    margin: 0 0 8px;
}

.tl2-no-results p {
    color: var(--tl2-tt-text-muted);
    margin: 0;
}

/* ==========================================================================
   5. SINGLE VIEW
   ========================================================================== */
.tl2-tt-single-page {
    padding-top: 15px;
    padding-bottom: 40px;
}

.tl2-breadcrumb {
    font-size: 14px;
    color: var(--tl2-tt-text-muted);
    margin-bottom: 20px;
}

.tl2-breadcrumb a {
    color: var(--tl2-tt-primary);
    text-decoration: none;
    font-weight: 600;
}

.tl2-tt-single-header {
    background: #ffffff;
    border: 1px solid var(--tl2-tt-border);
    border-radius: var(--tl2-tt-radius);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--tl2-tt-shadow);
}

.tl2-tt-single-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tl2-tt-single-title {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    color: var(--tl2-tt-primary);
    line-height: 1.25;
}

.tl2-tt-single-meta-row {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--tl2-tt-text-muted);
}

.tl2-tt-single-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tl2-tt-details-table-card,
.tl2-tt-viewer-card,
.tl2-sidebar-card {
    background: #ffffff;
    border: 1px solid var(--tl2-tt-border);
    border-radius: var(--tl2-tt-radius);
    padding: 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    margin-bottom: 25px;
}

.tl2-card-section-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--tl2-tt-primary);
    text-transform: uppercase;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tl2-details-table {
    width: 100%;
    border-collapse: collapse;
}

.tl2-details-table th,
.tl2-details-table td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.tl2-details-table th {
    width: 18%;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.tl2-details-table td {
    color: #1e293b;
}

.tl2-tt-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--tl2-tt-border);
    margin-bottom: 20px;
}

.tl2-viewer-tools {
    display: flex;
    gap: 8px;
}

.tl2-office-file-box,
.tl2-no-file-alert {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.tl2-office-file-box h4 {
    color: var(--tl2-tt-primary);
    margin: 12px 0 8px;
}

.tl2-office-file-box p {
    color: var(--tl2-tt-text-muted);
    max-width: 480px;
    margin: 0 auto 20px;
}

.tl2-sidebar-card h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--tl2-tt-primary);
    text-transform: uppercase;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
}

.tl2-action-buttons-list .button {
    margin-bottom: 10px;
    border-radius: 8px;
    font-weight: 700;
}

.tl2-related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tl2-related-item {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--tl2-tt-border);
}

.tl2-related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tl2-related-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tl2-tt-primary);
    text-decoration: none;
    line-height: 1.35;
    display: block;
    margin-bottom: 4px;
}

.tl2-related-title:hover {
    color: var(--tl2-tt-accent);
}

.tl2-related-meta {
    font-size: 12px;
    color: var(--tl2-tt-text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.tl2-badge-lop.is-mini,
.tl2-badge-tuan.is-mini {
    padding: 1px 6px;
    font-size: 10px;
}

.tl2-hotline-box {
    background: #f0f7ff;
    border-color: #bae6fd;
}

.tl2-hotline-item {
    font-size: 14px;
    margin-bottom: 6px;
}

.tl2-hotline-item a {
    color: var(--tl2-tt-accent);
    font-weight: 800;
    text-decoration: none;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 991px) {
    .tl2-tt-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tl2-tt-sidebar-col {
        position: static;
    }

    .tl2-tt-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .tl2-tt-filter-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .tl2-tt-filter-actions .button {
        width: auto !important;
    }
}

@media (max-width: 1024px) {
    .tl2-tt-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 849px) {
    .tl2-tt-hero {
        min-height: auto;
    }
    .tl2-tt-hero-container {
        padding: 30px 20px;
    }
    .tl2-details-table th,
    .tl2-details-table td {
        display: block;
        width: 100%;
    }
    .tl2-details-table th {
        background: transparent;
        padding-bottom: 2px;
        color: var(--tl2-tt-primary);
    }
    .tl2-details-table td {
        padding-top: 0;
        padding-bottom: 12px;
    }
}

@media (max-width: 549px) {
    .tl2-tt-filter-grid {
        grid-template-columns: 1fr;
    }
    .tl2-tt-search-item {
        grid-column: span 1;
    }
    .tl2-tt-cards-grid {
        grid-template-columns: 1fr;
    }
    .tl2-tt-card-meta {
        grid-template-columns: 1fr;
    }
    .tl2-meta-item.tl2-meta-date {
        grid-column: span 1;
    }
    .tl2-tt-filter-actions {
        flex-direction: column;
    }
    .tl2-tt-filter-actions .button {
        width: 100%;
    }
    .tl2-tt-single-meta-row {
        flex-direction: column;
        gap: 6px;
    }
}
