/* Custom CSS for Student Management System - Dark Theme */

/* Eye-Friendly Dark Theme Color Variables */
:root {
    --apple-blue: #4A90E2;
    --apple-gray: #9B9B9B;
    --apple-light-gray: #2A2A2A;
    --apple-white: #1E1E1E;
    --apple-black: #E8E8E8;
    --apple-dark-gray: #1A1A1A;
    --apple-medium-gray: #2A2A2A;
    --apple-text-primary: #E8E8E8;
    --apple-text-secondary: #B0B0B0;
    --apple-border: #404040;
    --apple-success: #4CAF50;
    --apple-warning: #FF9800;
    --apple-danger: #F44336;
    --apple-info: #2196F3;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #1E1E1E;
    --sidebar-text: #E8E8E8;
    --sidebar-hover: #2A2A2A;
    --sidebar-active: var(--apple-blue);
    --sidebar-border: #404040;
    
    /* Eye-friendly background colors */
    --chat-bg: #1E1E1E;
    --card-bg: #242424;
    --input-bg: #2A2A2A;
}

[data-bs-theme="light"] {
    --apple-light-gray: #F2F2F7;
    --apple-white: #FFFFFF;
    --apple-black: #000000;
    --apple-text-primary: #000000;
    --apple-text-secondary: #8E8E93;
    --apple-border: #E5E5EA;
    --sidebar-bg: #FFFFFF;
    --sidebar-text: #000000;
    --sidebar-hover: #F2F2F7;
    --sidebar-border: #E5E5EA;
    --chat-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --input-bg: #FFFFFF;
}

/* Global Styles */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--chat-bg);
    color: var(--apple-text-primary);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-left: var(--sidebar-width);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background-color: var(--sidebar-bg);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--sidebar-text);
    text-decoration: none;
    margin-bottom: 10px;
}

.sidebar-brand:hover {
    color: var(--sidebar-text);
}

.sidebar-brand img {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 8px;
}

.sidebar-brand i {
    font-size: 24px;
    margin-right: 12px;
    color: var(--apple-blue);
}

.subscription-badge {
    font-size: 12px;
    color: var(--apple-text-secondary);
    font-weight: 500;
}

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

.sidebar-nav-item {
    display: block;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.sidebar-nav-item.active {
    background-color: var(--apple-blue);
    color: white;
}

.sidebar-nav-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-nav-section-title {
    padding: 0 20px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.sidebar-footer .sidebar-nav-item {
    margin-bottom: 8px;
}

.sidebar-footer .sidebar-nav-item:last-of-type {
    margin-bottom: 0;
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 15px;
}

.dark-mode-toggle span {
    font-size: 14px;
    color: var(--sidebar-text);
}

.dark-mode-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: var(--apple-gray);
    border-radius: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dark-mode-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.dark-mode-switch.active {
    background-color: var(--apple-blue);
}

.dark-mode-switch.active::before {
    transform: translateX(18px);
}

/* Main Content */
.main-content {
    min-height: 100vh;
    background-color: var(--chat-bg);
    padding: 40px;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--apple-border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--apple-border);
    padding: 20px;
    font-weight: 600;
    color: var(--apple-text-primary);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--apple-text-primary);
    margin-bottom: 8px;
}

/* Statistics Cards */
.card.bg-primary {
    background: linear-gradient(135deg, var(--apple-blue) 0%, #0056CC 100%);
    border: none;
    color: white;
}

.card.bg-info {
    background: linear-gradient(135deg, var(--apple-info) 0%, #0099CC 100%);
    border: none;
    color: white;
}

.card.bg-success {
    background: linear-gradient(135deg, var(--apple-success) 0%, #28A745 100%);
    border: none;
    color: white;
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--apple-warning) 0%, #FD7E14 100%);
    border: none;
    color: white;
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--apple-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #0056CC;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--apple-blue);
    color: var(--apple-blue);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--apple-blue);
    color: white;
}

.btn-success {
    background-color: var(--apple-success);
}

.btn-success:hover {
    background-color: #28A745;
}

.btn-warning {
    background-color: var(--apple-warning);
}

.btn-warning:hover {
    background-color: #FD7E14;
}

.btn-danger {
    background-color: var(--apple-danger);
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-outline-danger {
    border: 2px solid var(--apple-danger);
    color: var(--apple-danger);
}

.btn-outline-warning {
    border: 2px solid var(--apple-warning);
    color: var(--apple-warning);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
}

/* Tables */
.table {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--apple-border);
}

.table th {
    background-color: var(--apple-light-gray);
    font-weight: 600;
    font-size: 14px;
    color: var(--apple-text-primary);
    border: none;
    padding: 16px;
}

.table td {
    padding: 16px;
    border: none;
    border-bottom: 1px solid var(--apple-border);
    color: var(--apple-text-primary);
}

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

.table-hover tbody tr:hover {
    background-color: var(--apple-light-gray);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid var(--apple-border);
    padding: 12px 16px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--apple-text-primary);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
    outline: none;
}

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

.form-label {
    font-weight: 600;
    color: var(--apple-text-primary);
    font-size: 14px;
    margin-bottom: 8px;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
}

.badge.bg-success {
    background-color: var(--apple-success) !important;
}

.badge.bg-warning {
    background-color: var(--apple-warning) !important;
}

.badge.bg-danger {
    background-color: var(--apple-danger) !important;
}

/* Status Colors */
.bg-light-success {
    background-color: rgba(52, 199, 89, 0.2) !important;
}

.bg-light-warning {
    background-color: rgba(255, 149, 0, 0.2) !important;
}

.bg-light-danger {
    background-color: rgba(255, 59, 48, 0.2) !important;
}

.bg-light-info {
    background-color: rgba(90, 200, 250, 0.2) !important;
}

.text-success {
    color: var(--apple-success) !important;
}

.text-warning {
    color: var(--apple-warning) !important;
}

.text-danger {
    color: var(--apple-danger) !important;
}

.text-primary {
    color: var(--apple-blue) !important;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.2);
    color: var(--apple-success);
}

.alert-warning {
    background-color: rgba(255, 149, 0, 0.2);
    color: var(--apple-warning);
}

.alert-danger {
    background-color: rgba(255, 59, 48, 0.2);
    color: var(--apple-danger);
}

.alert-info {
    background-color: rgba(90, 200, 250, 0.2);
    color: var(--apple-info);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 20px;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background-color: var(--apple-blue);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 18px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Focus Indicators */
.btn:focus,
.form-control:focus,
.form-select:focus,
.sidebar-nav-item:focus {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar {
        display: none !important;
    }
    
    body {
        padding-left: 0 !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--apple-gray);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--apple-blue);
}