/* =====================================================
   Football Academy Management System
   نظام إدارة أكاديمية كرة القدم
   ===================================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --navbar-height: 64px;
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Cairo', -apple-system, sans-serif;
    background: var(--bg-body);
    color: #1e293b;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

/* ─── App Layout ─── */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: margin var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    padding: 24px;
    flex: 1;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    background: var(--bg-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo i {
    font-size: 28px;
    color: #fbbf24;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-list {
    list-style: none;
    padding: 0 12px;
    margin: 0;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-sidebar);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-link i { font-size: 18px; width: 22px; text-align: center; }

.nav-item.active > .nav-link,
.nav-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.nav-arrow {
    margin-right: auto;
    font-size: 11px;
    transition: transform var(--transition);
}

.nav-link.has-children:not(.collapsed) .nav-arrow {
    transform: rotate(-90deg);
}

.nav-children {
    list-style: none;
    padding: 4px 0 4px 34px;
    margin: 0;
}

.nav-children a {
    display: block;
    padding: 7px 16px;
    color: var(--text-sidebar);
    font-size: 13px;
    border-radius: 6px;
    transition: all var(--transition);
    text-decoration: none;
}

.nav-children a:hover,
.nav-children a.active {
    color: var(--text-sidebar-active);
    background: var(--bg-sidebar-hover);
}

.nav-children a.active { font-weight: 600; }

.nav-divider {
    padding: 16px 16px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-info .user-name { color: #fff; font-weight: 600; font-size: 13px; }
.user-info .user-role { color: #64748b; font-size: 11px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* ─── Top Navbar ─── */
.top-navbar {
    height: var(--navbar-height);
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box .form-control {
    padding-right: 38px;
    border-radius: 20px;
    border-color: #e2e8f0;
    background: #f8fafc;
    width: 280px;
    font-size: 13px;
}

.search-box .form-control:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.navbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    transition: all var(--transition);
}

.btn-icon:hover { background: #f1f5f9; color: #1e293b; }

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 20px;
    transition: all var(--transition);
    color: #1e293b;
    font-weight: 500;
}

.user-dropdown:hover { background: #f1f5f9; }

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ─── Page Title ─── */
.page-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: #64748b; }
.breadcrumb-item.active { color: #94a3b8; }

/* ─── Cards ─── */
.card { border-radius: var(--radius); }
.card-header { padding: 16px 20px; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; }

/* ─── Stat Cards ─── */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
}

.stat-card--primary::before { background: var(--primary-light); }
.stat-card--success::before { background: var(--success); }
.stat-card--info::before { background: var(--info); }
.stat-card--warning::before { background: var(--warning); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card--primary .stat-icon { background: #eff6ff; color: var(--primary-light); }
.stat-card--success .stat-icon { background: #ecfdf5; color: var(--success); }
.stat-card--info .stat-icon { background: #ecfeff; color: var(--info); }
.stat-card--warning .stat-icon { background: #fffbeb; color: var(--warning); }

.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; color: #0f172a; }
.stat-label { font-size: 12px; color: #64748b; font-weight: 500; margin-top: 2px; }
.stat-footer { position: absolute; bottom: 8px; left: 20px; right: 20px; font-size: 11px; }

/* ─── Info List ─── */
.info-list { }
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.info-item:last-child { border-bottom: none; }
.info-label { color: #64748b; font-size: 13px; }
.info-value { font-weight: 600; font-size: 13px; }

/* ─── Tables ─── */
.table { font-size: 13px; }
.table thead th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    padding: 12px 16px;
}
.table td { padding: 12px 16px; vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f8fafc; }

/* ─── Badges ─── */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
}

/* ─── Forms ─── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #e2e8f0;
    font-size: 13px;
    padding: 8px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-label { font-size: 13px; margin-bottom: 6px; color: #374151; }

/* ─── Buttons ─── */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; padding: 8px 16px; }
.btn-primary { background: var(--primary-light); border-color: var(--primary-light); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-group-sm > .btn { padding: 4px 10px; font-size: 12px; }

/* ─── Avatar ─── */
.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
}

/* ─── Auth Pages ─── */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    min-height: 100vh;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card-inner {
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.auth-logo i { font-size: 36px; color: #0f172a; }

.auth-footer small { color: rgba(255,255,255,0.4); }

/* ─── Alerts ─── */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
}

/* ─── Pagination ─── */
.page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    color: #64748b;
}
.page-item.active .page-link {
    background: var(--primary-light);
    color: #fff;
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.show + .sidebar-overlay { display: block; }

    .main-content {
        margin-right: 0 !important;
    }

    .content-wrapper { padding: 16px; }

    .stat-card { padding: 14px; }
    .stat-value { font-size: 18px; }
    .stat-icon { width: 40px; height: 40px; font-size: 18px; }
}

@media (max-width: 575.98px) {
    .page-title { font-size: 16px; }
    .table { font-size: 12px; }
    .table td, .table th { padding: 8px 10px; }
}

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeIn 0.3s ease; }

/* ─── Print ─── */
@media print {
    .sidebar, .top-navbar, .btn, .breadcrumb { display: none !important; }
    .main-content { margin: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
