/* Club Management System - Main Stylesheet */

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --success: #11998e;
    --danger: #e74c6f;
    --warning: #f5af19;
    --info: #667eea;
    --dark: #1a1a2e;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #e74c6f 0%, #c62828 100%);
    --gradient-warning: linear-gradient(135deg, #f5af19 0%, #f09819 100%);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 5px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* { font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; box-sizing: border-box; }
body { background: #f0f2f5; margin: 0; padding: 0; min-height: 100vh; }

/* Sidebar */
.sidebar { position: fixed; top: 0; right: 0; width: var(--sidebar-width); height: 100vh; background: var(--dark); z-index: 1000; transition: all 0.3s; overflow-y: auto; overflow-x: hidden; box-shadow: -5px 0 25px rgba(0,0,0,0.2); }
.sidebar.collapsed { transform: translateX(100%); }
.sidebar-header { padding: 25px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { width: 60px; height: 60px; background: var(--gradient-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.5rem; color: white; }
.sidebar-title { color: white; font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.sidebar-subtitle { color: rgba(255,255,255,0.5); font-size: 0.8rem; }
.sidebar-nav { list-style: none; padding: 15px 0; margin: 0; }
.sidebar-nav .nav-item { margin: 2px 12px; }
.sidebar-nav .nav-link { display: flex; align-items: center; padding: 12px 15px; color: rgba(255,255,255,0.7); text-decoration: none; border-radius: var(--radius-sm); transition: all 0.3s; font-size: 0.9rem; gap: 12px; }
.sidebar-nav .nav-link:hover { color: white; background: rgba(255,255,255,0.1); transform: translateX(-5px); }
.sidebar-nav .nav-link.active { color: white; background: var(--gradient-primary); box-shadow: 0 3px 10px rgba(102,126,234,0.3); }
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 1rem; }

/* Main Content */
.main-content { margin-right: var(--sidebar-width); min-height: 100vh; transition: margin 0.3s; }
.main-content.expanded { margin-right: 0; }

/* Top Navbar */
.top-navbar { background: white; height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
.sidebar-toggle { font-size: 1.2rem; color: var(--dark); }
.user-dropdown { color: var(--dark); font-size: 0.9rem; }
.user-dropdown i { font-size: 1.3rem; margin-left: 5px; }
.page-title { font-weight: 600; color: var(--dark); font-size: 1.1rem; }
.page-content { padding: 20px; }

/* Cards */
.card { border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: all 0.3s; }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { background: white; border-bottom: 1px solid #f0f0f0; padding: 15px 20px; border-radius: var(--radius-md) var(--radius-md) 0 0 !important; font-weight: 600; }
.card-body { padding: 20px; }

/* ============ STAT CARDS ============ */
.stat-card {
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    padding: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.stat-primary { background: var(--gradient-primary); }
.stat-card.stat-success { background: var(--gradient-success); }
.stat-card.stat-danger { background: var(--gradient-danger); }
.stat-card.stat-warning { background: var(--gradient-warning); }
.stat-card.stat-info { background: linear-gradient(135deg, #2193b0, #6dd5ed); }

.stat-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.stat-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}

.stat-info p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table { margin-bottom: 0; }
.table thead th { background: #f8f9fa; border-bottom: 2px solid #e9ecef; font-weight: 600; font-size: 0.85rem; color: #555; padding: 12px 15px; white-space: nowrap; }
.table tbody td { padding: 12px 15px; vertical-align: middle; font-size: 0.9rem; }
.table-hover tbody tr:hover { background: rgba(102,126,234,0.04); }

/* Badges */
.badge { font-weight: 500; font-size: 0.8rem; padding: 5px 10px; border-radius: 6px; }

/* Buttons */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: all 0.3s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gradient-primary); border: none; }
.btn-primary:hover { box-shadow: 0 3px 15px rgba(102,126,234,0.4); }

/* Forms */
.form-control, .form-select { border-radius: var(--radius-sm); border: 2px solid #e9ecef; padding: 10px 15px; transition: all 0.3s; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
.form-label { font-weight: 500; font-size: 0.9rem; color: #444; }
.money-input { direction: ltr; text-align: right; font-family: 'Vazirmatn', monospace; }
.persian-date { direction: ltr; text-align: center; }

/* Pagination */
.pagination .page-link { border-radius: var(--radius-sm) !important; margin: 0 2px; color: var(--primary); border: none; font-size: 0.9rem; }
.pagination .page-item.active .page-link { background: var(--gradient-primary); color: white; }

/* Modal */
.modal-content { border: none; border-radius: var(--radius-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid #f0f0f0; }

/* Course Card */
.course-card { transition: all 0.3s; }
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* Alerts */
.alert { border-radius: var(--radius-md); border: none; }
.alert-success { background: rgba(17,153,142,0.1); color: var(--success); }
.alert-danger { background: rgba(231,76,111,0.1); color: var(--danger); }
.alert-info { background: rgba(102,126,234,0.1); color: var(--primary); }
.alert-warning { background: rgba(245,175,25,0.1); color: #d4940a; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

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

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        width: 280px;
        z-index: 9999;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
    }
    /* When sidebar is open, push main content behind */
    body.sidebar-open .main-content {
        position: relative;
        z-index: 1;
    }
    body.sidebar-open .top-navbar {
        z-index: 2;
    }
    body.sidebar-open {
        overflow: hidden;
    }
    body.sidebar-open .table-responsive {
        overflow: hidden !important;
        max-height: none !important;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.55);
        z-index: 9998;
    }
    .sidebar-overlay.show {
        display: block;
    }
    /* Hide username on mobile */
    .user-dropdown .d-none.d-md-inline {
        display: none !important;
    }
    .stat-card { padding: 12px; gap: 8px; }
    .stat-icon { width: 38px; height: 38px; min-width: 38px; font-size: 1.2rem; }
    .stat-info h3 { font-size: 1rem; }
    .stat-info p { font-size: 0.75rem; }
    .page-content { padding: 15px; overflow-x: hidden; }
    .table-responsive { font-size: 0.85rem; }
    .card { overflow: visible; }
    .card-body { overflow: visible; }
}

@media (max-width: 575.98px) {
    .top-navbar { padding: 0 10px; }
    .page-content { padding: 10px; }
    .card-body { padding: 15px; }
    .stat-card { padding: 10px; gap: 6px; }
    .stat-icon { width: 32px; height: 32px; min-width: 32px; font-size: 1rem; }
    .stat-info h3 { font-size: 0.85rem; }
    .stat-info p { font-size: 0.7rem; }
}

/* Sidebar open on desktop - keep stat cards compact */
@media (min-width: 992px) and (max-width: 1400px) {
    .stat-info h3 { font-size: 1rem; }
    .stat-info p { font-size: 0.75rem; }
    .stat-icon { width: 40px; height: 40px; min-width: 40px; }
    .stat-card { padding: 12px; }
}

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