:root {
    --primary-color: #6C63FF;
    --secondary-color: #03DAC6;
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --text-color: #E0E0E0;
    --text-muted: #A0A0A0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FFC107;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: #5a52d5;
    transform: translateY(-2px);
}

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

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

.btn-block {
    display: block;
    width: 100%;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

/* Timetable */
.timetable-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.day-filter {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-filter.active, .day-filter:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.timetable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.timetable-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.timetable-card:hover {
    transform: translateY(-5px);
}

.time-slot {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.subject-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.teacher-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    height: 100vh;
}

.sidebar {
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.nav-menu {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover, .nav-btn.active {
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
}

.nav-btn i {
    width: 20px;
}

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

.dashboard-content {
    overflow-y: auto;
    padding-right: 10px;
}

/* Dashboard Stats */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-paid { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.status-pending { background: rgba(244, 67, 54, 0.2); color: #e57373; }
.status-partial { background: rgba(255, 193, 7, 0.2); color: #ffd54f; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1E1E1E;
    width: 400px;
    max-width: 90%;
    position: relative;
    border: 1px solid var(--glass-border);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Utilities */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

.row {
    display: flex;
    gap: 20px;
}

.col {
    flex: 1;
}

/* Attendance */
.attendance-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.student-attendance-card {
    background: var(--surface-color);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.student-attendance-card.present {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.student-attendance-card.absent {
    border-color: var(--danger-color);
    background: rgba(244, 67, 54, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

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

/* Mobile Responsive Styles */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
    border-radius: 12px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    border-radius: 50%;
    transition: background 0.3s;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.text-center {
    text-align: center;
}

.btn-icon:hover {
    background: var(--glass-bg);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .dashboard-layout {
        display: block;
        height: auto;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 999;
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        background: var(--surface-color);
        box-shadow: 4px 0 15px rgba(0,0,0,0.5);
        padding-top: 60px; /* Space for close button if needed, or just padding */
    }

    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Optional: Hide sidebar logo on mobile if it duplicates header */
    .sidebar .logo {
        display: none; 
    }

    .dashboard-content {
        padding: 0;
        overflow-y: visible;
    }
    
    .stats-grid {
        grid-template-columns: 1fr; /* Stack cards */
    }
    
    /* Better table scrolling */
    .table-container {
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        box-shadow: none; /* Remove heavy shadow on mobile */
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .view-section {
        padding-bottom: 80px;
    }
    
    .form-group row {
        flex-direction: column;
        gap: 0;
    }
    
    .col {
        width: 100%;
    }
    
    /* Adjust timetable grid */
    .timetable-grid {
        grid-template-columns: 1fr;
    }
}
