/* ========================================
   Oval Saône Admin Dashboard - Modern Glass UI
   Color scheme based on club logo
   ======================================== */

:root {
    /* Primary colors from logo */
    --primary-color: #0e3160;
    --secondary-color: #07bfef;
    --accent-color: #f7b732;
    --gold-color: #f3a712;
    --navy-color: #0a2548;
    --sky-color: #e0f2fe;

    /* Status colors - modernisés */
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info-color: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Typography */
    --font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Modern Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 40px -10px rgba(7, 191, 239, 0.3);
    --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.08), 0 4px 16px -4px rgba(0, 0, 0, 0.06);

    /* Border radius */
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(12px);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdfa 100%);
    background-attachment: fixed;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Subtle animated gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(7, 191, 239, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(14, 49, 96, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(247, 183, 50, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

[x-cloak] {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
}

.show-mobile-only {
    display: none;
}
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 1.5rem;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

.loading-overlay p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--navy-color) 0%, var(--primary-color) 60%, #164e8a 100%);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px -4px rgba(14, 49, 96, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 0% 0%, rgba(7, 191, 239, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(247, 183, 50, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.header-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.25);
}

.header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.8125rem;
    opacity: 0.75;
    margin: 0;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent-color), var(--gold-color));
    color: var(--navy-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px -2px rgba(247, 183, 50, 0.4);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0891b2 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 8px -2px rgba(7, 191, 239, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px -4px rgba(7, 191, 239, 0.5);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    box-shadow: 0 4px 16px -4px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-color);
}

.btn-primary:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Filters Section */
.filters-section {
    margin-bottom: 1.5rem;
}

.filter-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.3s ease;
}

.filter-card:hover {
    box-shadow: var(--shadow-lg);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1.25rem;
}

.filter-title svg {
    color: var(--secondary-color);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-800);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    font-weight: 500;
}

.filter-group select:hover {
    border-color: var(--gray-300);
    background-color: var(--gray-50);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(7, 191, 239, 0.12);
}

.filter-group select:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
}

.empty-state-content {
    text-align: center;
    padding: 3rem;
    max-width: 420px;
}

.empty-state-content svg {
    color: var(--gray-300);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state-content h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.empty-state-content p {
    color: var(--gray-500);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* Stats Section */
.stats-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.section-title svg {
    color: var(--secondary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 1.75rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--gray-100);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-total { --stat-color: var(--primary-color); }
.stat-present { --stat-color: var(--success-color); }
.stat-absent { --stat-color: var(--danger-color); }
.stat-pending { --stat-color: var(--warning-color); }

.stat-total .stat-icon { background: rgba(14, 49, 96, 0.1); }
.stat-present .stat-icon { background: var(--success-light); }
.stat-absent .stat-icon { background: var(--danger-light); }
.stat-pending .stat-icon { background: var(--warning-light); }

.stat-total .stat-value { color: var(--primary-color); }
.stat-present .stat-value { color: var(--success-color); }
.stat-absent .stat-value { color: var(--danger-color); }
.stat-pending .stat-value { color: var(--warning-color); }

.stat-total::before { background: var(--primary-color); }
.stat-present::before { background: var(--success-color); }
.stat-absent::before { background: var(--danger-color); }
.stat-pending::before { background: var(--warning-color); }
.stat-pending .stat-value { color: var(--warning-color); }

/* Carpool Stats */
.carpool-stats {
    background: linear-gradient(135deg, rgba(7, 191, 239, 0.06) 0%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid rgba(7, 191, 239, 0.15);
    position: relative;
    overflow: hidden;
}

.carpool-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.carpool-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.carpool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.carpool-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
}

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

.carpool-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.carpool-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.carpool-need .carpool-value { color: var(--warning-color); }
.carpool-offer .carpool-value { color: var(--success-color); }
.carpool-ok .carpool-value { color: var(--success-color); }
.carpool-warning .carpool-value { color: var(--danger-color); }
.carpool-warning { 
    border: 2px solid var(--danger-color);
    background: var(--danger-light);
}

/* Table Section */
.table-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    background: rgba(248, 250, 252, 0.5);
}

.table-header .section-title {
    margin: 0;
}

.table-count {
    font-size: 0.8125rem;
    color: var(--gray-500);
    background: var(--white);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    font-weight: 500;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-container {
    overflow-x: auto;
}

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

.data-table th {
    background: rgba(248, 250, 252, 0.8);
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9375rem;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(7, 191, 239, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.cell-name {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-weight: 500;
}

.name-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px -2px rgba(14, 49, 96, 0.3);
}

.cell-email {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.cell-date {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.cell-seats {
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    gap: 0.375rem;
}

.status-present {
    background: var(--success-light);
    color: var(--success-color);
}

.status-absent {
    background: var(--danger-light);
    color: var(--danger-color);
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

/* Carpool Badges */
.carpool-badge {
    font-size: 0.8125rem;
}

.carpool-badge.need {
    color: var(--warning-color);
    font-weight: 600;
}

.carpool-badge.none {
    color: var(--gray-400);
}

.seats-badge {
    background: var(--success-light);
    color: var(--success-color);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-row {
    text-align: center;
    color: var(--gray-400);
    padding: 3.5rem 1rem !important;
    font-style: italic;
    font-size: 0.9375rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile-only {
        display: inline !important;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .main-content {
        padding: 1rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .carpool-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table th,
    .data-table td {
        padding: 0.875rem 0.75rem;
        font-size: 0.8125rem;
    }

    .cell-email {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.375rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .carpool-grid {
        grid-template-columns: 1fr;
    }

    .user-name {
        display: none;
    }

    .user-info {
        padding: 0.375rem 0.5rem;
    }

    .header h1 {
        font-size: 1.125rem;
    }

    .header-subtitle {
        font-size: 0.75rem;
    }
}

/* Animations utilitaires */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-section, .table-section, .filter-card {
    animation: fadeIn 0.4s ease-out;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Focus visible pour accessibilité */
:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    body::before {
        display: none;
    }
    
    .header {
        position: relative;
        box-shadow: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .btn-outline {
        display: none;
    }
    
    .filter-card,
    .stat-card,
    .table-section {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
