/* ========================================================
   SIBAHA SWIMMING CLUB CURUP - Premium Aquatic Design System
   ======================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Share+Tech+Mono&display=swap');

:root {
    /* Premium Aquatic Color Palette */
    --primary: #0052cc;          /* Professional Cobalt Blue */
    --primary-dark: #0a2540;     /* Deep Navy Midnight */
    --primary-light: #0080ff;    /* Vibrant Aqua Sky */
    --accent: #00c6ff;           /* Neon Swimmer Cyan */
    --accent-light: #e6f7ff;
    --success: #059669;          /* Emerald Green */
    --danger: #e11d48;           /* Coral Rose Red */
    --warning: #d97706;          /* Golden Amber */
    --dark: #0b132b;
    --text: #0a2540;             /* Unified Midnight Navy text */
    --text-muted: #627d98;
    
    /* Backgrounds & Premium Glassmorphism */
    --background: #f4f8fc;       /* Soft Ice Blue */
    --surface: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --sidebar-bg: linear-gradient(195deg, #071e3d 0%, #0b132b 100%);
    --border: rgba(0, 82, 204, 0.08);
    
    /* Tokens */
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 30px rgba(10, 37, 64, 0.04);
    --shadow-hover: 0 16px 40px rgba(10, 37, 64, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 270px;
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-dark: #004f9f;
    --primary-light: #7dd3fc;
    --accent: #22d3ee;
    --background: #080d1a;       /* Deep slate navy */
    --surface: rgba(17, 27, 48, 0.8);
    --surface-solid: #111b30;
    --text: #f0f4f8;
    --text-muted: #829ab1;
    --border: rgba(56, 189, 248, 0.12);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 45px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    background-image: radial-gradient(circle at 5% 30%, rgba(0, 82, 204, 0.04), transparent 30%),
                      radial-gradient(circle at 95% 70%, rgba(0, 198, 255, 0.04), transparent 30%);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-dark);
    font-weight: 700;
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4 {
    color: var(--text);
}

/* App Container & Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0; top: 0;
    transition: var(--transition);
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
}
.sidebar-header h2 i {
    color: var(--accent);
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}
.nav-links::-webkit-scrollbar { width: 4px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.35);
    margin: 18px 16px 8px 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.nav-links li {
    margin: 4px 16px;
    position: relative;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    gap: 12px;
    font-size: 0.95rem;
}

.nav-links a i {
    font-size: 1.25rem;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.5);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 22px;
}
.nav-links a:hover i {
    color: var(--accent);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 82, 204, 0.35);
}
.nav-links a.active i {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: var(--transition);
}

/* Topbar */
.topbar {
    height: 75px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 4px 20px rgba(10, 37, 64, 0.02);
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text);
    cursor: pointer;
    display: none;
    padding: 5px;
    border-radius: 8px;
    transition: var(--transition);
}
.menu-btn:hover {
    background: rgba(0, 82, 204, 0.05);
}

/* Content Area */
.content-area {
    padding: 30px;
    flex: 1;
}

.page { display: none; animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.page.active { display: block; }

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media print {
    body { background: #fff; margin: 0; padding: 0; }
    .sidebar, .topbar, .floating-help, .tabs, .form-group, button { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: none !important; padding: 0 !important; }
    .page { display: none !important; }
    .page.active { display: block !important; }
    table { width: 100% !important; border-collapse: collapse !important; }
    th, td { border: 1px solid #000 !important; padding: 8px !important; color: #000 !important; }
    th { background-color: #f0f0f0 !important; -webkit-print-color-adjust: exact; }
    h3 { margin-top: 0 !important; color: #000 !important; }
}

/* Premium Cards */
.card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
}
[data-theme="dark"] .card-header h3 {
    color: var(--text);
}

/* Beautiful Dashboard Metrics Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.metric-card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 82, 204, 0.15);
}
.metric-card i {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--primary);
}
.metric-card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}
.metric-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: 'Outfit', sans-serif;
}
[data-theme="dark"] .metric-card .value {
    color: var(--text);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.2px;
}

input, select, textarea {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-solid);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.12);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn:hover {
    background: rgba(0, 82, 204, 0.05);
    color: var(--primary);
}
.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.25);
}
.tab-pane { display: none; animation: slideUpFade 0.3s ease; }
.tab-pane.active { display: block; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 82, 204, 0.35);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #10b981);
    color: white;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.2);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f43f5e);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.2);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(225, 29, 72, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 82, 204, 0.04);
}

.btn-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.15rem;
}
.btn-icon.edit { background: rgba(217, 119, 6, 0.08); color: var(--warning); }
.btn-icon.edit:hover { background: var(--warning); color: white; transform: scale(1.05); }
.btn-icon.delete { background: rgba(225, 29, 72, 0.08); color: var(--danger); }
.btn-icon.delete:hover { background: var(--danger); color: white; transform: scale(1.05); }

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-solid);
    box-shadow: var(--shadow);
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1.5px solid var(--border);
}
th {
    background: rgba(0, 82, 204, 0.03);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Outfit', sans-serif;
}
[data-theme="dark"] th {
    color: var(--text-muted);
    background: rgba(56, 189, 248, 0.03);
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(0, 82, 204, 0.015); }
[data-theme="dark"] tbody tr:hover { background: rgba(255, 255, 255, 0.015); }

.thumbnail {
    width: 48px; height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

/* Badges for status details */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.badge-danger { background: rgba(225, 29, 72, 0.1); color: var(--danger); }
.badge-warning { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.badge-primary { background: rgba(0, 82, 204, 0.1); color: var(--primary); }

/* Stopwatches (Stopwatch / Lanes / Training Section) */
.lanes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}
.lane-card {
    background: var(--surface-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.lane-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.lane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 8px;
}
.lane-header h4 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}
.time-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.8rem;
    font-weight: 800;
    text-align: center;
    color: var(--primary-dark);
    letter-spacing: 1px;
    background: rgba(0, 82, 204, 0.04);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin: 8px 0;
}
[data-theme="dark"] .time-display {
    color: var(--primary-light);
    background: rgba(56, 189, 248, 0.04);
}

/* Floating Help */
.floating-help {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}
.help-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transition: var(--transition);
}
.help-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    color: white;
}
.help-btn.wa { background: linear-gradient(135deg, #25D366, #128C7E); }
.help-btn.tg { background: linear-gradient(135deg, #0088cc, #005580); }

/* Custom Utilities */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.mb-4 { margin-bottom: 25px; }

/* Responsive adjustments */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-btn { display: block; }
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.4); z-index: 99;
        display: none; opacity: 0; transition: var(--transition);
    }
    .sidebar-overlay.show { display: block; opacity: 1; }
    .card { padding: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 20px; }
    .content-area { padding: 20px; }
}
