:root {
    /* Color Palette - Premium Dark Aquatic Theme */
    --primary: #00e5ff;
    --primary-dark: #00b3cc;
    --secondary: #3d5afe;
    --bg-dark: #0a0f16;
    --bg-surface: #111a26;
    --bg-surface-light: #1a2636;
    --text-main: #f0f4f8;
    --text-muted: #a0aec0;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Effects */
    --transition: all 0.3s ease;
    --glass-bg: rgba(17, 26, 38, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --table-hover: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] {
    /* Color Palette - Crisp Vibrant Light Aquatic Theme */
    --primary: #0088cc;
    --primary-dark: #006699;
    --secondary: #2a40c4;
    --bg-dark: #f0f4f9;
    --bg-surface: #ffffff;
    --bg-surface-light: #e8eef6;
    --text-main: #141c28;
    --text-muted: #5a6a80;
    --gold: #d4a017;
    --silver: #718096;
    --bronze: #b87333;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 50, 100, 0.1);
    --card-shadow: 0 10px 30px rgba(0, 30, 80, 0.08);
    --table-hover: rgba(0, 100, 200, 0.03);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle-btn {
    background: #e8eef6;
    border-color: rgba(0, 100, 200, 0.15);
    color: #f59e0b;
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0, 50, 100, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-primary {
    color: #ffffff !important;
}

[data-theme="light"] .hero-portal {
    background: linear-gradient(180deg, #e4ecf7 0%, #f0f4f9 100%);
    border-bottom: 1px solid rgba(0, 50, 100, 0.08);
}

[data-theme="light"] .news-card,
[data-theme="light"] .card,
[data-theme="light"] .acara-card,
[data-theme="light"] .leaderboard-container,
[data-theme="light"] .live-card {
    background: #ffffff;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--glass-border);
}

[data-theme="light"] .acara-header {
    background: linear-gradient(90deg, #f0f6fc 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(0, 60, 120, 0.08);
}

[data-theme="light"] .seri-block {
    background: #f8fafc;
    border: 1px solid rgba(0, 60, 120, 0.08);
}

[data-theme="light"] .news-category {
    color: #ffffff;
}

[data-theme="light"] .event-pill {
    background: #e6eef8;
    border-color: rgba(0, 60, 120, 0.12);
    color: var(--text-main);
}

[data-theme="light"] .event-pill:hover,
[data-theme="light"] .event-pill.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
}

.top5-tab-btn {
    border-color: var(--glass-border);
    color: var(--text-main);
    background: transparent;
    transition: var(--transition);
}

.top5-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.top5-tab-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .top5-tab-btn {
    border-color: rgba(0, 50, 100, 0.15);
    color: var(--text-main);
    background: #ffffff;
}

[data-theme="light"] .top5-tab-btn:hover,
[data-theme="light"] .top5-tab-btn.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
}

[data-theme="light"] .lintasan-table th,
[data-theme="light"] .leaderboard-table th {
    background: #f4f8fc;
    color: var(--text-muted);
}

[data-theme="light"] .lintasan-table td,
[data-theme="light"] .leaderboard-table td {
    border-bottom: 1px solid rgba(0, 50, 100, 0.06);
}

[data-theme="light"] .lintasan-table tr:hover,
[data-theme="light"] .leaderboard-table tr:hover {
    background: var(--table-hover);
}

[data-theme="light"] .footer {
    background: #e2ebf5;
    border-top: 1px solid rgba(0, 50, 100, 0.08);
}

[data-theme="light"] .modal-card,
[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border-color: rgba(0, 50, 100, 0.15) !important;
    color: var(--text-main) !important;
    box-shadow: 0 15px 50px rgba(0, 30, 80, 0.15) !important;
}

[data-theme="light"] .modal-footer {
    background: #f8fafc;
}

[data-theme="light"] .drag-drop-area {
    background: rgba(0, 136, 204, 0.04);
    border-color: rgba(0, 136, 204, 0.3);
}

/* Light Mode Overrides for text, headers, and backgrounds */
[data-theme="light"] .live-header h3,
[data-theme="light"] .result-item h3,
[data-theme="light"] .athlete-name,
[data-theme="light"] .acara-header h4,
[data-theme="light"] .seri-title,
[data-theme="light"] .nama-atlet,
[data-theme="light"] #bacaJudul,
[data-theme="light"] #portalGaleriCaption,
[data-theme="light"] .news-content h3,
[data-theme="light"] strong[style*="#fff"],
[data-theme="light"] strong[style*="#ffffff"],
[data-theme="light"] strong[style*="white"],
[data-theme="light"] strong[style*="rgb(255"],
[data-theme="light"] span[style*="#fff"],
[data-theme="light"] span[style*="#ffffff"],
[data-theme="light"] span[style*="white"],
[data-theme="light"] span[style*="rgb(255"],
[data-theme="light"] h1[style*="#fff"],
[data-theme="light"] h1[style*="#ffffff"],
[data-theme="light"] h1[style*="white"],
[data-theme="light"] h2[style*="#fff"],
[data-theme="light"] h2[style*="#ffffff"],
[data-theme="light"] h2[style*="white"],
[data-theme="light"] h3[style*="#fff"],
[data-theme="light"] h3[style*="#ffffff"],
[data-theme="light"] h3[style*="white"],
[data-theme="light"] h4[style*="#fff"],
[data-theme="light"] h4[style*="#ffffff"],
[data-theme="light"] h4[style*="white"],
[data-theme="light"] h5[style*="#fff"],
[data-theme="light"] h5[style*="#ffffff"],
[data-theme="light"] h5[style*="white"],
[data-theme="light"] div[style*="#fff"],
[data-theme="light"] div[style*="#ffffff"],
[data-theme="light"] div[style*="white"],
[data-theme="light"] p[style*="#fff"],
[data-theme="light"] p[style*="#ffffff"],
[data-theme="light"] p[style*="white"],
[data-theme="light"] td[style*="#fff"],
[data-theme="light"] td[style*="#ffffff"],
[data-theme="light"] td[style*="white"],
[data-theme="light"] th[style*="#fff"],
[data-theme="light"] th[style*="#ffffff"],
[data-theme="light"] th[style*="white"],
[data-theme="light"] label[style*="#fff"],
[data-theme="light"] label[style*="#ffffff"],
[data-theme="light"] label[style*="white"],
[data-theme="light"] code[style*="#fff"],
[data-theme="light"] code[style*="#ffffff"],
[data-theme="light"] a[style*="#fff"],
[data-theme="light"] a[style*="#ffffff"] {
    color: var(--text-main) !important;
}

[data-theme="light"] small[style*="rgba(255"],
[data-theme="light"] p[style*="rgba(255"],
[data-theme="light"] span[style*="rgba(255"],
[data-theme="light"] td[style*="rgba(255"],
[data-theme="light"] th[style*="rgba(255"],
[data-theme="light"] div[style*="rgba(255"],
[data-theme="light"] label[style*="rgba(255"],
[data-theme="light"] i[style*="rgba(255"] {
    color: var(--text-muted) !important;
}

[data-theme="light"] .result-item {
    background: #ffffff !important;
    border: 1px solid rgba(0, 50, 100, 0.08) !important;
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .result-item:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 10px 25px rgba(0, 136, 204, 0.12) !important;
}

[data-theme="light"] .live-status {
    background: rgba(0, 136, 204, 0.08) !important;
    border: 1px solid rgba(0, 136, 204, 0.2) !important;
}

[data-theme="light"] #bacaIsi {
    color: var(--text-main) !important;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 50, 100, 0.12) !important;
    box-shadow: 0 20px 50px rgba(0, 30, 80, 0.12) !important;
}

[data-theme="light"] .login-card h2,
[data-theme="light"] .login-card label,
[data-theme="light"] .login-card .remember-me span {
    color: var(--text-main) !important;
}

[data-theme="light"] .login-card .input-wrapper input {
    background: #f4f8fc !important;
    border-color: rgba(0, 50, 100, 0.15) !important;
    color: var(--text-main) !important;
}

[data-theme="light"] .login-card .input-wrapper input:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
}

[data-theme="light"] .login-card .input-wrapper i {
    color: var(--text-muted) !important;
}

[data-theme="light"] .login-bg::after {
    background: linear-gradient(135deg, rgba(240, 244, 249, 0.95) 0%, rgba(240, 244, 249, 0.8) 100%) !important;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.bg-surface {
    background-color: var(--bg-surface);
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1.5rem; }

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(10, 15, 22, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
}

.logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-actions span {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: #000 !important;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
}


/* Hero Portal */
.hero-portal {
    position: relative;
    padding: 150px 0 100px;
    background: linear-gradient(180deg, var(--bg-surface-light) 0%, var(--bg-dark) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Berita Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 229, 255, 0.3);
}

.news-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.news-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.news-content {
    padding: 25px;
}

.news-date {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.news-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Responsive Table Container */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Leaderboard */
.leaderboard-container {
    background: var(--bg-surface-light);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

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

.leaderboard-table th, 
.leaderboard-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.leaderboard-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.2);
}

.leaderboard-table tbody tr {
    transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1px solid var(--glass-border);
}

.rank-badge.gold { background: rgba(255, 215, 0, 0.2); color: var(--gold); border-color: var(--gold); }
.rank-badge.silver { background: rgba(192, 192, 192, 0.2); color: var(--silver); border-color: var(--silver); }
.rank-badge.bronze { background: rgba(205, 127, 50, 0.2); color: var(--bronze); border-color: var(--bronze); }

.athlete-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.time-record {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
}

/* Hasil Kejuaraan */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--primary);
}

.result-info h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.result-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 250px;
    gap: 20px;
}

.gallery-item {
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-overlay {
    position: absolute;
    bottom: 0; 
    left: 0; 
    right: 0;
    padding: 36px 18px 18px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s ease;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gallery-caption-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    font-family: var(--font-heading);
}

.gallery-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.gallery-meta-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gallery-komp-name {
    font-weight: 600;
}

/* Default & Dark Image: White high-contrast text with dark shadow on dark gradient scrim */
.gallery-overlay,
.gallery-item.img-dark .gallery-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%);
}

.gallery-overlay .gallery-caption-title,
.gallery-item.img-dark .gallery-overlay .gallery-caption-title {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6);
}

.gallery-overlay .gallery-meta-info,
.gallery-item.img-dark .gallery-overlay .gallery-meta-info {
    color: rgba(255, 255, 255, 0.88) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.gallery-overlay .gallery-meta-info i,
.gallery-item.img-dark .gallery-overlay .gallery-meta-info i {
    color: var(--primary);
}

/* Light / Bright Image: Dark high-contrast text on light frosted backdrop */
.gallery-item.img-light .gallery-overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.75) 65%, transparent 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gallery-item.img-light .gallery-overlay .gallery-caption-title {
    color: #0b1320 !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
}

.gallery-item.img-light .gallery-overlay .gallery-meta-info {
    color: rgba(15, 25, 40, 0.9) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.gallery-item.img-light .gallery-overlay .gallery-meta-info i {
    color: var(--secondary);
}

/* Footer */
.footer {
    padding: 60px 0 40px;
    background: var(--bg-surface);
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-logo {
    justify-content: center;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer-org-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.22);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 14px auto 0;
    transition: var(--transition);
}

[data-theme="light"] .footer-org-badge {
    background: rgba(0, 136, 204, 0.08);
    border-color: rgba(0, 136, 204, 0.25);
    color: var(--primary-dark);
}

.footer-links a {
    color: var(--text-main);
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Live Result Styles */
.live-nav-link {
    display: flex !important;
    align-items: center;
    gap: 6px;
    color: var(--danger) !important;
    font-weight: 700 !important;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    animation: pulseRed 1.5s infinite;
}

.live-badge {
    background: var(--danger);
    color: white;
    font-size: 1rem;
    padding: 4px 12px;
    border-radius: 20px;
    vertical-align: middle;
    margin-right: 10px;
    display: inline-block;
    animation: pulseRed 1.5s infinite;
}

.live-board {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--glass-border);
}

.live-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
}

.status-text {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulsing-dot {
    width: 10px;
    height: 10px;
    background-color: var(--danger);
    border-radius: 50%;
    animation: pulseRed 1.5s infinite;
}

.live-table .swimmer-row.finished {
    background: rgba(0, 230, 118, 0.05);
}

.live-table .running-time {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.live-table .final-time {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--success);
    font-weight: 700;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 23, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Login Page Styles --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('assets/hero_bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.login-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(10, 15, 22, 0.95) 0%, rgba(10, 15, 22, 0.7) 100%);
    z-index: -1;
}

.login-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.login-header .logo {
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2rem;
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label:not(.remember-me) {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.ph-user,
.input-wrapper i.ph-lock-key {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 14px 16px 14px 45px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
}

.toggle-password:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    justify-content: center;
    font-size: 1.1rem;
    padding: 16px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.login-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.text-success { color: var(--success); }

/* Animation utilities */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Buku Acara Styles --- */
.pt-150 { padding-top: 150px; }
.mb-0 { margin-bottom: 0 !important; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin: 30px 0;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.filter-group .form-control {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
}

.search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-input input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 16px 12px 35px;
    border-radius: 8px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.kompetisi-info {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.kompetisi-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.kompetisi-info p {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.acara-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
}

.acara-header {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acara-header h4 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.badge-primary {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.seri-list {
    padding: 20px;
}

.seri-block {
    margin-bottom: 30px;
}

.seri-block:last-child {
    margin-bottom: 0;
}

.seri-title {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--secondary);
}

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

.lintasan-table th, .lintasan-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: left;
}

.lintasan-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-checkin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 12px;
}

.status-checkin.sudah {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
}

.status-checkin.belum {
    background: rgba(255, 23, 68, 0.1);
    color: var(--danger);
}

/* =========================================================
   COMPREHENSIVE MOBILE RESPONSIVE SYSTEM (<= 768px & <= 480px)
   ========================================================= */

@media screen and (max-width: 768px) {
    /* 1. Global & Containers */
    .container {
        padding: 0 16px;
    }
    .section {
        padding: 50px 0;
    }
    .section-header {
        margin-bottom: 25px;
    }
    .section-header h2 {
        font-size: 1.7rem;
        line-height: 1.3;
    }
    .section-header p {
        font-size: 0.92rem;
        margin-top: 6px;
    }

    /* 2. Navbar & Mobile Menu Dropdown */
    .navbar {
        padding: 12px 0;
    }
    .nav-content {
        position: relative;
    }
    .logo {
        font-size: 1.25rem;
    }
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .nav-actions .btn {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid var(--glass-border);
        color: var(--text-main);
        font-size: 1.4rem;
        cursor: pointer;
        transition: var(--transition);
    }
    .mobile-menu-btn:hover {
        background: rgba(0, 229, 255, 0.15);
        color: var(--primary);
    }
    [data-theme="light"] .mobile-menu-btn {
        background: #e8eef6;
        border-color: rgba(0, 100, 200, 0.15);
    }
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border: 1px solid var(--glass-border);
        border-radius: 14px;
        padding: 14px 16px;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }
    .nav-links.active {
        display: flex;
        animation: mobileNavSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .nav-links a {
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 0.95rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: var(--transition);
    }
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(0, 229, 255, 0.12);
        color: var(--primary);
    }

    /* 3. Hero Section */
    .hero-portal {
        padding: 110px 0 50px;
    }
    .hero-title {
        font-size: 1.95rem;
        line-height: 1.25;
        margin-bottom: 12px;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
        padding: 0 8px;
    }

    /* 4. Live Race Widget */
    .live-card {
        border-radius: 14px;
    }
    .live-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .live-timer-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        border-top: 1px dashed var(--glass-border);
    }
    .live-timer {
        font-size: 1.7rem;
    }

    /* 5. News Grid (Berita) */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .news-img {
        height: 180px;
    }
    .news-content {
        padding: 18px 16px;
    }
    .news-content h3 {
        font-size: 1.15rem;
        line-height: 1.35;
        margin-bottom: 10px;
    }
    .news-content p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    /* 6. Results List (Hasil Kejuaraan) */
    .results-list {
        gap: 12px;
    }
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px 16px;
    }
    .result-item .btn {
        width: 100%;
        justify-content: center;
    }

    /* 7. Top 5 Tabs & Leaderboard (Compact Full-Width No-Scroll) */
    .top5-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 12px;
    }
    .top5-tabs::-webkit-scrollbar {
        display: none;
    }
    .top5-tab-btn {
        padding: 5px 12px;
        font-size: 0.78rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .leaderboard-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    .top5-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    .top5-table-wrap[style*="display: none"] {
        display: none !important;
    }

    /* Column Utilities for Compact Mobile Table View */
    .col-hide-mobile {
        display: none !important;
    }
    .mobile-show-block {
        display: block !important;
    }
    .mobile-show-inline {
        display: inline !important;
    }
    .mobile-hide-inline {
        display: none !important;
    }

    /* All Tables Compact Fit Without Scroll */
    .lintasan-table,
    .leaderboard-table,
    .hasil-table {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: auto !important;
    }
    .lintasan-table th, .lintasan-table td,
    .leaderboard-table th, .leaderboard-table td,
    .hasil-table th, .hasil-table td {
        padding: 7px 5px !important;
        font-size: 0.78rem !important;
    }
    .lintasan-table th:first-child, .lintasan-table td:first-child,
    .leaderboard-table th:first-child, .leaderboard-table td:first-child,
    .hasil-table th:first-child, .hasil-table td:first-child {
        padding-left: 6px !important;
        padding-right: 2px !important;
        width: 36px !important;
        min-width: 36px !important;
        text-align: center !important;
    }
    .rank-badge,
    .rank-medal-box {
        width: 24px !important;
        height: 24px !important;
        line-height: 24px !important;
        font-size: 0.75rem !important;
        margin: 0 auto !important;
    }
    .nama-atlet,
    .athlete-name {
        font-size: 0.84rem !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        word-break: break-word !important;
    }
    .time-record,
    .waktu-resmi,
    .time-cell {
        font-size: 0.86rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
    }
    .status-checkin {
        font-size: 0.7rem !important;
        padding: 2px 6px !important;
        gap: 3px !important;
    }

    /* 8. Gallery Grid (Hover Overlay preserved on mobile) */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: 10px;
    }
    .gallery-item.large {
        grid-column: span 2;
        grid-row: span 2;
    }
    .gallery-overlay {
        transform: translateY(100%);
        padding: 24px 12px 12px;
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .gallery-item:hover .gallery-overlay,
    .gallery-item:active .gallery-overlay,
    .gallery-item:focus .gallery-overlay {
        transform: translateY(0);
    }
    .gallery-caption-title {
        font-size: 0.82rem;
        color: #ffffff !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    }
    .gallery-caption-meta {
        font-size: 0.7rem;
        color: rgba(255,255,255,0.85) !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    }

    /* 9. Buku Acara Specific */
    .pt-150 {
        padding-top: 100px;
    }
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin-bottom: 6px;
    }
    .filter-bar {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 15px 0 20px;
    }
    .filter-group {
        min-width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
    .filter-actions {
        width: 100%;
    }
    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .event-nav-pills {
        padding: 6px 0 10px;
        margin-bottom: 15px;
        gap: 6px;
    }
    .event-pill {
        padding: 5px 12px;
        font-size: 0.78rem;
    }
    .acara-card {
        margin-bottom: 20px;
        border-radius: 12px;
    }
    .acara-header {
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .acara-header h4 {
        font-size: 1.02rem;
    }
    .seri-list {
        padding: 10px 8px;
    }
    .seri-block {
        padding: 10px 8px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    .seri-title {
        font-size: 0.9rem;
    }

    /* 10. Modals */
    .modal-card,
    .modal-content {
        width: 94% !important;
        max-width: 94% !important;
        margin: 20px auto;
        padding: 16px;
    }

    /* 11. Footer */
    .footer {
        padding: 40px 0 25px;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        align-items: center;
    }
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }
    .footer p {
        font-size: 0.82rem;
        text-align: center;
        line-height: 1.5;
    }
}

@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 1.65rem;
    }
    .section-header h2 {
        font-size: 1.45rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 180px;
    }
    .gallery-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@keyframes mobileNavSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
