/* ==========================================
   BEU+ Education Management System
   Base Styles - Umumiy stillar
   ========================================== */

/* === CSS Variables === */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --secondary: #64748b;
    
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --sidebar-width: 260px;
    --header-height: 65px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    
    --transition: all 0.3s ease;
}

/* === Reset & Base === */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

/* === Sidebar === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
    font-size: 20px;
}

.sidebar-logo {
    padding: 20px;
    font-size: 24px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo i {
    color: #818cf8;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    color: #94a3b8;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-link.active {
    background: var(--primary);
}

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

/* === Main Content === */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.main-content.expanded {
    margin-left: 70px;
}

/* === Header === */
.header {
    background: var(--card-bg);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* === Page Content === */
.page-content {
    padding: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* === Cards === */
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 14px;
}

.table-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* === Tables === */
.table {
    margin: 0;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border: none;
}

.table td {
    padding: 16px;
    vertical-align: middle;
    border-color: var(--border-color);
}

/* === Badges === */
.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
}

/* === Buttons === */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

/* === User Dropdown === */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    cursor: pointer;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 180px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: var(--bg-color);
}

.user-dropdown-menu a:first-child {
    border-radius: 10px 10px 0 0;
}

.user-dropdown-menu a:last-child {
    border-radius: 0 0 10px 10px;
}

.user-dropdown-menu .divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-dropdown-menu a.text-danger {
    color: var(--danger);
}

.user-dropdown-menu a.text-danger:hover {
    background: #fef2f2;
}

/* === Global Search === */
.search-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.search-result-icon.student {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.search-result-icon.teacher {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.search-result-icon.group {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.search-result-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.search-no-results,
.search-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* === Forms === */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ==========================================
   Responsive Styles
   ========================================== */

/* Tablet (992px va kichik) */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .search-wrapper {
        width: 200px !important;
    }
}

/* Mobile (768px va kichik) */
@media (max-width: 767.98px) {
    .header {
        padding: 12px 16px;
    }
    
    .search-wrapper {
        display: none !important;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card-value {
        font-size: 22px;
    }
    
    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Hide some columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
}

/* Small mobile (576px va kichik) */
@media (max-width: 575.98px) {
    .header {
        padding: 10px 12px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    .page-title {
        font-size: 18px;
        margin-bottom: 16px !important;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-card-value {
        font-size: 20px;
    }
    
    .table-card {
        border-radius: 8px;
    }
    
    .user-dropdown-toggle span {
        display: none;
    }
    
    .filter-form .col-md-2,
    .filter-form .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
