/* Technova LMS - Modern CSS Framework */
/* Created: 2025-10-18 */

/* ========================================
   CSS VARIABLES & THEME SYSTEM
======================================== */
:root {
    /* Light Theme Colors */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --info-color: #4299e1;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --bg-hover: #e2e8f0;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e0;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --text-light: #718096;
    
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --bg-hover: #4a5568;
    
    --border-color: #4a5568;
    --border-light: #2d3748;
    --border-dark: #718096;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
}

/* ========================================
   TYPOGRAPHY
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   LAYOUT COMPONENTS
======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main Content Area */
.content-main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px); /* Ensure content fills viewport */
}

/* Module-specific content optimization */
.module-content {
    padding: 1rem 0;
}

.module-section {
    margin-bottom: 1.5rem;
}

.module-section:last-child {
    margin-bottom: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
.main-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo i {
    color: var(--primary-color);
    font-size: 2rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle,
.notification-bell,
.instructor-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.theme-toggle:hover,
.notification-bell:hover,
.instructor-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: var(--error-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-info:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.user-details p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-muted);
    text-transform: capitalize;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: var(--transition);
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Instructor Panel Styles */
.instructor-panel {
    position: relative;
}

.instructor-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: var(--transition);
    z-index: 1000;
}

.instructor-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.instructor-header {
    background: var(--bg-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.instructor-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructor-links {
    padding: 0.5rem 0;
}

.instructor-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
}

.instructor-links a:last-child {
    border-bottom: none;
}

.instructor-links a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.instructor-links a i {
    width: 1rem;
    text-align: center;
    color: var(--primary-color);
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #dd6b20;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* ========================================
   FORMS
======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.875rem;
    color: var(--error-color);
    margin-top: 0.25rem;
}

/* ========================================
   CARDS
======================================== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ========================================
   ALERTS
======================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.2);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    border: 1px solid rgba(237, 137, 54, 0.2);
    color: var(--warning-color);
}

.alert-error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.2);
    color: var(--error-color);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.2);
    color: var(--info-color);
}

/* ========================================
   GRID SYSTEM
======================================== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ========================================
   COURSE CARDS
======================================== */
.course-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.course-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.course-content {
    padding: 1.5rem;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.category {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-beginner {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.difficulty-intermediate {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning-color);
}

.difficulty-advanced {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
}

.course-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-title a {
    color: inherit;
    text-decoration: none;
}

.course-title a:hover {
    color: var(--primary-color);
}

.course-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.course-instructor {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.course-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.course-price {
    margin-bottom: 1rem;
    text-align: right;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price.free {
    color: var(--success-color);
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   DASHBOARD STYLES
======================================== */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.dashboard-card .icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.dashboard-card .icon.primary { background: var(--primary-color); }
.dashboard-card .icon.success { background: var(--success-color); }
.dashboard-card .icon.warning { background: var(--warning-color); }
.dashboard-card .icon.info { background: var(--info-color); }

/* ========================================
   NOTIFICATIONS PAGE STYLES
======================================== */

/* Content Header */
.content-header {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.content-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); }
.stat-icon.success { background: linear-gradient(135deg, var(--success-color), #38a169); }
.stat-icon.warning { background: linear-gradient(135deg, var(--warning-color), #dd6b20); }
.stat-icon.info { background: linear-gradient(135deg, var(--info-color), #3182ce); }
.stat-icon.error { background: linear-gradient(135deg, var(--error-color), #e53e3e); }

/* Default stat icon colors */
.stat-icon:not(.primary):not(.success):not(.warning):not(.info):not(.error) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    line-height: 1;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    padding: 2rem;
}

.load-more-btn {
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Tab Navigation */
.content-tabs {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
    border-radius: 2px 2px 0 0;
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Tabs */
@media (max-width: 768px) {
    .content-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab-btn:last-child {
        border-bottom: none;
    }
    
    .tab-btn.active::after {
        display: none;
    }
}

/* Notifications Container */
.notifications-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.notification-group {
    border-bottom: 1px solid var(--border-color);
}

.notification-group:last-child {
    border-bottom: none;
}

.group-header {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.group-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.notifications-list {
    padding: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(102, 126, 234, 0.02);
    border-left: 4px solid var(--primary-color);
}

.notification-item.read {
    opacity: 0.8;
}

.notification-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.notification-icon i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.notification-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: 1rem;
}

.notification-message {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.notification-data {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.data-item {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification-actions {
    margin-left: 1rem;
    flex-shrink: 0;
}

.load-more-container {
    text-align: center;
    padding: 2rem;
}

/* ========================================
   GRADES PAGE STYLES
======================================== */
.grades-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.grades-table {
    width: 100%;
    border-collapse: collapse;
}

.grades-table th,
.grades-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.grades-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grades-table td {
    color: var(--text-secondary);
}

.grades-table tr:hover {
    background: var(--bg-secondary);
}

.course-info strong {
    color: var(--text-primary);
}

.grade-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    min-width: 2rem;
}

.grade-a { background: #d4edda; color: #155724; }
.grade-b { background: #cce5ff; color: #004085; }
.grade-c { background: #fff3cd; color: #856404; }
.grade-d { background: #f8d7da; color: #721c24; }
.grade-f { background: #f5c6cb; color: #721c24; }

.attendance-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.course-attendance {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.course-attendance:last-child {
    border-bottom: none;
}

.course-attendance h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.attendance-stats {
    margin-bottom: 1rem;
}

.attendance-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.attendance-percentage {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.attendance-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attendance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.attendance-date {
    font-weight: 500;
    color: var(--text-primary);
}

.attendance-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-present {
    background: #d4edda;
    color: #155724;
}

.status-absent {
    background: #f8d7da;
    color: #721c24;
}

.status-late {
    background: #fff3cd;
    color: #856404;
}

.status-excused {
    background: #cce5ff;
    color: #004085;
}

.attendance-notes {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.course-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.course-content {
    padding: 1.5rem;
}

.course-content h3 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.course-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.course-meta i {
    width: 1rem;
    text-align: center;
}

.course-actions {
    margin-top: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        padding: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .course-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .course-content {
        padding: 1rem;
    }
    
    /* Mobile header improvements for very small screens */
    .main-header .logo {
        font-size: 1rem;
    }
    
    .main-header .logo i {
        font-size: 1.2rem;
    }
    
    .main-header .mobile-menu-toggle {
        font-size: 1.1rem;
        padding: 0.4rem;
    }
    
    .main-header .user-avatar {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.7rem;
    }
    
    .main-header .theme-toggle,
    .main-header .notification-bell,
    .main-header .instructor-toggle {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    /* Reduce content spacing on very small screens */
    .content-main {
        padding: 0.75rem 0;
    }
    
    .module-content {
        padding: 0.25rem 0;
    }
    
    .module-section {
        margin-bottom: 0.75rem;
    }
    
    .content-header {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
}

/* ========================================
   UTILITIES
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }
.visible { display: block; }

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
======================================== */

/* Mobile First Approach - Base styles are mobile */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-header .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .main-header .nav-menu {
        display: flex;
        flex-direction: row;
    }
    
    .main-header .mobile-menu-toggle {
        display: none;
    }
    
    .content-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: auto;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile-specific styles (max-width: 767px) */
@media (max-width: 767px) {
    /* Header adjustments */
    .main-header {
        padding: 0.75rem 0;
    }
    
    .main-header .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .main-header .logo {
        font-size: 1.1rem;
        flex: 1;
    }
    
    .main-header .logo span {
        display: none; /* Hide text on very small screens */
    }
    
    .main-header .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 1001;
    }
    
    .main-header .nav-menu.active {
        display: flex;
    }
    
    .main-header .nav-menu li {
        margin: 0;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-header .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .main-header .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.25rem;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .main-header .header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .main-header .user-info {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        min-width: 0; /* Allow shrinking */
    }
    
    .main-header .user-details {
        display: none; /* Hide user details on mobile to save space */
    }
    
    .main-header .user-avatar {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
    
    .main-header .theme-toggle,
    .main-header .notification-bell {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .main-header .instructor-toggle {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    /* Mobile dropdown improvements */
    .main-header .user-dropdown,
    .main-header .instructor-dropdown {
        position: absolute;
        right: 0;
        top: 100%;
        min-width: 200px;
        z-index: 1002;
    }
    
    .main-header .user-dropdown {
        margin-top: 0.5rem;
    }
    
    .main-header .instructor-dropdown {
        margin-top: 0.5rem;
    }
    
    /* Content adjustments */
    .content-main {
        padding: 1rem 0.5rem;
    }
    
    .module-content {
        padding: 0.5rem 0;
    }
    
    .module-section {
        margin-bottom: 1rem;
    }
    
    .content-header {
        padding: 1rem 0;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .content-header p {
        font-size: 0.9rem;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    /* Courses grid */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .course-card {
        padding: 1rem;
    }
    
    .course-card .course-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .course-card .course-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .course-card .course-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Content tabs */
    .content-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    /* Tables */
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .card h2 {
        font-size: 1.25rem;
    }
    
    .card h3 {
        font-size: 1.1rem;
    }
    
    /* Admin specific */
    .admin-header .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-header .admin-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-header .admin-nav a {
        padding: 0.75rem;
        text-align: center;
    }
    
    /* Dashboard specific */
    .dashboard-section {
        padding: 1rem;
    }
    
    .dashboard-section h2 {
        font-size: 1.25rem;
    }
    
    /* Module cards */
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .module-card {
        padding: 1rem;
    }
    
    .module-card .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .module-card .module-actions {
        width: 100%;
    }
    
    .module-card .module-actions .btn {
        width: 100%;
    }
    
    /* Week management */
    .weeks-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .week-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .week-info {
        width: 100%;
    }
    
    /* Settings grid */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .setting-item {
        padding: 1rem;
    }
    
    /* User dropdown */
    .user-dropdown {
        position: static;
        box-shadow: none;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-top: 1rem;
    }
    
    /* Notifications */
    .notification-item {
        padding: 1rem;
    }
    
    .notification-item .notification-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Course detail page */
    .course-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .course-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Login/Register forms */
    .auth-container {
        padding: 1rem;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .auth-form h1 {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .main-footer {
        padding: 2rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        width: 100%;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .content-main {
        padding: 0.5rem 0;
    }
    
    .main-header {
        padding: 0.5rem 0;
    }
    
    .main-header .logo {
        font-size: 1.1rem;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card h3 {
        font-size: 1.25rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.25rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    .main-header {
        padding: 0.5rem 0;
    }
    
    .content-main {
        padding: 0.5rem 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .main-header .logo i,
    .stat-card .stat-icon i,
    .btn i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark theme mobile adjustments */
@media (max-width: 767px) {
    [data-theme="dark"] .main-header .nav-menu {
        background: var(--bg-secondary);
        border-top-color: var(--border-color);
    }
    
    [data-theme="dark"] .main-header .nav-menu li {
        border-bottom-color: var(--border-color);
    }
    
    [data-theme="dark"] .user-dropdown {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .main-header,
    .btn,
    .user-dropdown {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}