:root {
    --bg: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --primary: #001f3f;
    --accent: #1e90ff;
    --card: #ffffff;
    --nav-bg: #ffffff;
    --footer-bg: #001f3f;
    --footer-text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
    --border: #e5e5e5;
    --row-hover: #f9f9fb;
    --tag-bg: rgba(0, 113, 227, 0.1);
    --timer-text: #e63946;
}

html.dark {
    --bg: #0b0f15;
    --text: #e6eef8;
    --muted: #a1a1a6;
    --primary: #9fc5ff;
    --accent: #4aa3ff;
    --card: #0f1720;
    --nav-bg: #071027;
    --footer-bg: #071627;
    --footer-text: #dbefff;
    --shadow: rgba(0, 0, 0, 0.5);
    --border: #2c2c2e;
    --row-hover: #1a2332;
    --tag-bg: rgba(41, 151, 255, 0.15);
    --timer-text: #4aa3ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== NAVBAR ===== */
.tt-navbar {
    background: var(--nav-bg);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tt-navbar .logo {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tt-navbar .logo img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.tt-nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.tt-nav-links a:hover,
.tt-nav-links a.active {
    color: var(--accent);
    background: var(--tag-bg);
}

.tt-nav-links i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.theme-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Mobile nav */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .tt-nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 10px 20px 20px;
        box-shadow: 0 4px 12px var(--shadow);
        gap: 4px;
    }

    .tt-nav-links.open {
        display: flex;
    }

    .tt-nav-links a {
        width: 100%;
        padding: 12px 16px;
    }
}

/* ===== MAIN CONTENT ===== */
.tt-main {
    flex: 1;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 0;
}

/* ===== INDEX PAGE: Cards ===== */
.tt-page-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: clamp(24px, 5vw, 38px);
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
}

.tt-page-desc {
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.tt-section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
    margin: 40px 0 20px;
    padding-left: 4px;
    border-left: 4px solid var(--accent);
    padding-left: 14px;
}

.tt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.tt-card {
    background: var(--card);
    padding: 28px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.tt-card i {
    font-size: 28px;
    color: var(--accent);
}

.tt-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(30, 144, 255, 0.15);
    border-color: var(--accent);
}

/* ===== TIMETABLE PAGE: Container ===== */
.tt-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    background: var(--card);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 12px 40px var(--shadow);
    animation: ttSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
}

@keyframes ttSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tt-header {
    text-align: center;
    margin-bottom: 30px;
}

.tt-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.tt-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 14px;
    border-radius: 50px;
    background: var(--tag-bg);
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-desc {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin-top: 12px;
    line-height: 1.5;
}

.tt-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 20px;
    transition: opacity 0.2s;
}

.tt-back:hover {
    opacity: 0.7;
}

/* ===== COUNTDOWN ===== */
.countdown-hero {
    background: var(--bg);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.countdown-label {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.timer-grid {
    display: flex;
    justify-content: space-around;
    margin-top: 14px;
}

.time-item {
    text-align: center;
}

.time-item span {
    display: block;
    font-size: clamp(28px, 8vw, 42px);
    font-weight: 800;
    color: var(--timer-text);
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.time-item small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

th {
    text-align: left;
    padding: 12px 15px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: background 0.2s;
}

tr:hover {
    background: var(--row-hover);
}

.date-cell {
    font-weight: 700;
    white-space: nowrap;
}

.code-pill {
    background: var(--tag-bg);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    font-size: 12px;
}

.row-countdown {
    font-weight: 600;
    color: var(--timer-text);
}

/* ===== FOOTER ===== */
.tt-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
}

.tt-footer .footer-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 20px;
    margin-bottom: 10px;
}

.tt-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tt-footer .footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tt-footer .footer-links a:hover {
    opacity: 1;
}

.tt-footer .footer-copy {
    font-size: 13px;
    opacity: 0.6;
    margin-top: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .tt-main {
        width: 95%;
        padding: 20px 0;
    }

    .tt-container {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .tt-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tt-card {
        padding: 20px 14px;
    }

    th:nth-child(2),
    td:nth-child(2) {
        display: none;
    }

    .timer-grid {
        gap: 8px;
    }
}