/* ==========================================================================
   Sport Club & Society Admin Panel Design System - Premium Vanilla CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f8fafc; /* Slate-50: Clean light background */
    --bg-secondary: #ffffff; /* White: sidebar/topbar background */
    --bg-card: #ffffff; /* White: card background */
    --border-color: #e2e8f0; /* Slate-200: soft borders */
    --text-primary: #0f172a; /* Slate-900: primary text */
    --text-secondary: #475569; /* Slate-600: secondary text */
    --text-muted: #94a3b8; /* Slate-400: muted text */
    
    /* Premium Gradients & Accents */
    --accent-primary: #4f46e5; /* Indigo-600 */
    --accent-secondary: #7c3aed; /* Violet-600 */
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    --glow-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    
    /* Feedback Colors */
    --success: #0f766e; /* Teal-700 */
    --success-bg: #f0fdf4; /* Green-50 */
    --danger: #b91c1c; /* Red-700 */
    --danger-bg: #fef2f2; /* Red-50 */
    --info: #0369a1; /* Sky-700 */
    --info-bg: #f0f9ff; /* Sky-50 */
    --warning: #b45309; /* Amber-700 */
    --warning-bg: #fffbeb; /* Amber-50 */
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Scrollbars --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* --- Layout Wrapper --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--glow-shadow);
}

.brand-text {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.menu-item a:hover {
    color: var(--text-primary);
    background-color: rgba(79, 70, 229, 0.05);
}

.menu-item.active a {
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.08);
    border-left: 3px solid var(--accent-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-info {
    overflow: hidden;
}

.profile-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.topbar {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.content-body {
    padding: 40px;
    flex-grow: 1;
    animation: fadeUp 0.4s ease-out;
}

/* --- Dashboard Grid & Panels --- */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 8px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--accent-primary);
    transition: var(--transition-smooth);
}

.stat-card:hover .stat-icon {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--glow-shadow);
}

/* --- Panel Layout --- */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(8px);
    margin-bottom: 24px;
}

.panel-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
}

/* --- Tables --- */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 14px 18px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.custom-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.92rem;
}

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

.custom-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.012);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Alerts --- */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success);
}

.alert-danger {
    background-color: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-action-group {
    display: flex;
    gap: 8px;
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --- Login Page --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 40%),
                var(--bg-primary);
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.1);
    animation: fadeUp 0.5s ease-out;
}

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

.login-logo {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 16px;
    box-shadow: var(--glow-shadow);
}

.login-title {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 6px;
}

.login-footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 30px;
}

/* --- Bootstrap Pagination Override --- */
.pagination {
    display: flex;
    list-style: none;
    gap: 6px;
    padding-left: 0;
    margin: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.page-item:hover .page-link {
    color: var(--text-primary) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

.page-item.active .page-link {
    background: var(--accent-gradient) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: var(--glow-shadow);
}

.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Pagination container helper */
.pagination-container-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-text-muted {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* --- Keyframe Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Multi-Step Wizard Styling --- */
.wizard-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    gap: 60px;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    height: 2px;
    background-color: var(--border-color);
    width: 140px;
    z-index: 1;
    top: 20px;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    position: relative;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.wizard-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.wizard-step-item.active .wizard-step-circle {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: rgba(79, 70, 229, 0.08);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.2);
}

.wizard-step-item.completed .wizard-step-circle {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--glow-shadow);
}

.wizard-step-item.active {
    color: var(--text-primary);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeUp 0.3s ease-out;
}

/* --- Letter Download Card Styling --- */
.letter-download-card {
    background: rgba(79, 70, 229, 0.03);
    border: 1.5px dashed rgba(79, 70, 229, 0.25);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    transition: var(--transition-smooth);
}

.letter-download-card:hover {
    background: rgba(79, 70, 229, 0.06);
    border-color: var(--accent-primary);
}

.letter-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
    text-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.letter-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.letter-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 20px auto;
    line-height: 1.6;
}

/* --- Terms Scrollbox --- */
.terms-box {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* --- Mini Table inside Form --- */
.sports-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    margin-bottom: 24px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.sports-table th {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 10px 14px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.sports-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

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