/* ==========================================
   CHALKBOARD — Lecture Feedback System
   Design System & Global Styles
   ========================================== */

/* -- CSS Variables / Design Tokens -- */
:root {
    /* Primary palette */
    --primary: #6C5CE7;
    --primary-light: #a29bfe;
    --primary-dark: #4834d4;
    --primary-glow: rgba(108, 92, 231, 0.35);

    /* Accent */
    --accent: #00cec9;
    --accent-light: #81ecec;
    --accent-dark: #00b894;

    /* Semantic */
    --success: #00b894;
    --success-light: rgba(0, 184, 148, 0.15);
    --warning: #fdcb6e;
    --warning-light: rgba(253, 203, 110, 0.15);
    --danger: #e17055;
    --danger-light: rgba(225, 112, 85, 0.15);
    --info: #74b9ff;
    --info-light: rgba(116, 185, 255, 0.15);

    /* Dark theme surfaces */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(20, 20, 50, 0.7);
    --bg-card-hover: rgba(30, 30, 65, 0.85);
    --bg-input: rgba(255, 255, 255, 0.05);

    /* Text */
    --text-primary: #f0f0ff;
    --text-secondary: #a0a0c0;
    --text-muted: #6a6a90;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(108, 92, 231, 0.5);

    /* Glass */
    --glass-bg: rgba(18, 18, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Spacing */
    --nav-height: 64px;
}

/* -- Reset & Base -- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global background texture */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(225, 112, 85, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* -- Utility Classes -- */
.hidden { display: none !important; }

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 32px;
}

/* ===================
   SCREENS
   =================== */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.screen.active { display: block; }

/* ===================
   LOGIN SCREEN
   =================== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
    animation: fadeInDown 0.8s ease;
}

.brand-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 8px 30px var(--primary-glow);
    animation: float 3s ease-in-out infinite;
}

.login-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.login-card {
    max-width: 480px;
    width: 100%;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.login-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.role-btn {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    cursor: pointer;
    text-align: center;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.role-btn:hover {
    border-color: var(--primary-light);
    background: rgba(108, 92, 231, 0.1);
    transform: translateY(-2px);
}

.role-btn.selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 20px var(--primary-glow);
}

.role-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.role-btn span {
    font-weight: 600;
    font-size: 14px;
}

.role-btn small {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Login bg shapes */
.login-bg-shapes {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: morphShape 8s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
    animation: morphShape 10s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--danger);
    top: 50%;
    left: 50%;
    animation: morphShape 12s ease-in-out infinite;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(108, 92, 231, 0.05);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-lg {
    font-size: 22px !important;
    text-align: center;
    letter-spacing: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

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

.form-card {
    max-width: 720px;
    margin: 0 auto;
}

/* -- Buttons -- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px var(--primary-glow);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-icon {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    background: rgba(108, 92, 231, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--accent-dark));
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #d63031);
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #e17055);
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
    color: #1a1a2e;
}

/* ===================
   TOP NAVIGATION
   =================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 24px;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand i {
    -webkit-text-fill-color: var(--primary-light);
    margin-right: 6px;
}

.nav-center {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.user-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.user-badge i {
    margin-right: 6px;
    color: var(--primary-light);
}

/* ===================
   PAGE HEADER
   =================== */
.page-header {
    padding: 32px 32px 0;
    margin-bottom: 24px;
}

.page-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header h2 i {
    color: var(--primary-light);
    margin-right: 10px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===================
   TAB CONTENT
   =================== */
.tab-content {
    display: none;
    padding: 0 32px 32px;
    animation: fadeIn 0.3s ease;
}
.tab-content.active { display: block; }

/* ===================
   LECTURES LIST/GRID
   =================== */
.lectures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.lecture-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.lecture-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.lecture-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.lecture-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.lecture-subject {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.lecture-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-scheduled {
    background: var(--info-light);
    color: var(--info);
}

.status-completed {
    background: var(--success-light);
    color: var(--success);
}

.status-active {
    background: var(--warning-light);
    color: var(--warning);
}

.lecture-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.lecture-meta span i {
    color: var(--primary-light);
    margin-right: 6px;
    width: 14px;
}

.lecture-topic {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.lecture-topic i {
    color: var(--accent);
    margin-right: 8px;
}

.lecture-actions {
    display: flex;
    gap: 10px;
}

.lecture-feedback-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(0, 206, 201, 0.1);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
    display: inline-block;
    margin-bottom: 16px;
}

/* ===================
   QR DISPLAY
   =================== */
.qr-display-area {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.qr-placeholder {
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

.qr-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}

.qr-active-display {
    text-align: center;
}

.qr-active-display .qr-code-container {
    display: inline-block;
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin: 24px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.qr-active-display .qr-lecture-info {
    margin-bottom: 16px;
}

.qr-active-display .qr-lecture-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    margin-bottom: 4px;
}

.qr-active-display .qr-lecture-info p {
    color: var(--text-secondary);
}

.qr-feedback-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 6px;
    margin: 16px 0;
    padding: 12px 24px;
    background: rgba(0, 206, 201, 0.1);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    display: inline-block;
}

.qr-instructions {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 12px;
}

/* ===================
   SCAN / FEEDBACK AREA (Student)
   =================== */
.scan-area {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.feedback-form-area {
    max-width: 640px;
    margin: 24px auto 0;
    animation: fadeInUp 0.5s ease;
}

.lecture-info-banner {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.lecture-info-banner .banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.lecture-info-banner .banner-text h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    margin-bottom: 2px;
}

.lecture-info-banner .banner-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* -- Star Rating -- */
.rating-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.rating-category {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.rating-category:hover {
    border-color: var(--primary-light);
    background: rgba(108, 92, 231, 0.05);
}

.rating-category label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.star-rating {
    display: flex;
    gap: 6px;
}

.star-rating i {
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.star-rating i:hover {
    color: var(--warning);
    transform: scale(1.2);
}

.star-rating i.active {
    color: var(--warning);
    text-shadow: 0 0 10px rgba(253, 203, 110, 0.5);
}

.rating-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

.feedback-form-area h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 20px;
    font-size: 20px;
}

.feedback-form-area h3 i {
    color: var(--warning);
    margin-right: 8px;
}

/* ===================
   STATS GRID (Admin)
   =================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 32px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.feedback-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.stat-icon.complaint-icon {
    background: linear-gradient(135deg, var(--danger), #d63031);
}

.stat-icon.rating-icon {
    background: linear-gradient(135deg, var(--warning), #e17055);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* -- Dashboard Grid -- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 0 32px;
}

.dashboard-grid h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    margin-bottom: 20px;
}

.dashboard-grid h3 i {
    margin-right: 8px;
    color: var(--primary-light);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

.empty-state i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* -- Recent Complaints List -- */
.recent-list .complaint-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.recent-list .complaint-item:last-child {
    border-bottom: none;
}

.complaint-severity {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.severity-high { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.severity-medium { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.severity-low { background: var(--info); box-shadow: 0 0 8px var(--info); }

.complaint-content {
    flex: 1;
}

.complaint-content strong {
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.complaint-content p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.complaint-content .complaint-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* -- Leaderboard -- */
.leaderboard .leader-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard .leader-item:last-child {
    border-bottom: none;
}

.leader-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.leader-rank.gold { background: rgba(253, 203, 110, 0.2); color: var(--warning); }
.leader-rank.silver { background: rgba(200, 200, 220, 0.2); color: #c8c8dc; }
.leader-rank.bronze { background: rgba(225, 112, 85, 0.2); color: var(--danger); }

.leader-info {
    flex: 1;
}

.leader-info strong {
    font-size: 14px;
    display: block;
}

.leader-info small {
    font-size: 12px;
    color: var(--text-muted);
}

.leader-rating {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--warning);
}

.leader-rating i {
    font-size: 14px;
    margin-left: 2px;
}

/* ===================
   COMPLAINTS LIST (ADMIN)
   =================== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
}

.filter-bar select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-bar select option {
    background: var(--bg-secondary);
}

.filter-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.complaints-list,
.all-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.complaint-card,
.feedback-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: var(--transition-smooth);
    position: relative;
}

.complaint-card:hover,
.feedback-card:hover {
    background: var(--bg-card-hover);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.complaint-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.complaint-card-header .teacher-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
}

.complaint-card-header .teacher-name i {
    color: var(--primary-light);
    margin-right: 6px;
}

.complaint-card .complaint-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.complaint-card .complaint-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.complaint-card .rating-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.rating-pill .rating-stars {
    color: var(--warning);
}

.complaint-card .complaint-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.complaint-footer .meta-info {
    font-size: 12px;
    color: var(--text-muted);
}

.complaint-footer .meta-info span {
    margin-right: 14px;
}

.complaint-footer .meta-info i {
    margin-right: 4px;
}

.complaint-actions {
    display: flex;
    gap: 8px;
}

.complaint-actions .btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.complaint-actions .btn-sm:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.complaint-actions .btn-sm.btn-review {
    border-color: var(--warning);
    color: var(--warning);
    background: var(--warning-light);
}

.complaint-actions .btn-sm.btn-resolve {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-reviewed {
    background: var(--info-light);
    color: var(--info);
}

.status-resolved {
    background: var(--success-light);
    color: var(--success);
}

/* Feedback type badges */
.type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-feedback {
    background: var(--info-light);
    color: var(--info);
}

.type-complaint {
    background: var(--danger-light);
    color: var(--danger);
}

.type-suggestion {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-light);
}

.type-appreciation {
    background: var(--success-light);
    color: var(--success);
}

/* ===================
   FEEDBACK CARD (All feedback in admin)
   =================== */
.feedback-card {
    border-left: 3px solid var(--primary);
}

.feedback-card.type-complaint-card {
    border-left-color: var(--danger);
}

.feedback-card.type-suggestion-card {
    border-left-color: var(--primary-light);
}

.feedback-card.type-appreciation-card {
    border-left-color: var(--success);
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-card-header .teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-card-header .teacher-info strong {
    font-family: 'Outfit', sans-serif;
}

.feedback-card .feedback-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.feedback-card .feedback-comment {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-style: italic;
}

.feedback-card .feedback-footer {
    font-size: 12px;
    color: var(--text-muted);
}

.feedback-card .feedback-footer span {
    margin-right: 14px;
}

.feedback-card .feedback-footer i {
    margin-right: 4px;
}

/* ===================
   TEACHERS REPORT (Admin)
   =================== */
.teachers-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.teacher-report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-smooth);
}

.teacher-report-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.teacher-report-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.teacher-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: white;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}

.teacher-report-header .teacher-info h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.teacher-report-header .teacher-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.teacher-ratings-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-bar-label {
    font-size: 12px;
    color: var(--text-secondary);
    width: 100px;
    flex-shrink: 0;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-bar-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.teacher-report-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mini-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.mini-stat .mini-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    display: block;
}

.mini-stat .mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.mini-stat .mini-stat-value.rating-color { color: var(--warning); }
.mini-stat .mini-stat-value.feedback-color { color: var(--accent); }
.mini-stat .mini-stat-value.complaint-color { color: var(--danger); }

/* ===================
   FEEDBACK HISTORY (Student)
   =================== */
.feedback-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: var(--transition-smooth);
}

.history-card:hover {
    background: var(--bg-card-hover);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.history-card-header strong {
    font-family: 'Outfit', sans-serif;
}

.history-card .history-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.history-card .history-comment {
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

.history-card .history-footer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===================
   TOAST NOTIFICATION
   =================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--glass-shadow);
    animation: slideInRight 0.4s ease;
    max-width: 380px;
    min-width: 280px;
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-error .toast-icon { color: var(--danger); }
.toast.toast-warning .toast-icon { color: var(--warning); }
.toast.toast-info .toast-icon { color: var(--info); }

/* ===================
   MODAL
   =================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal {
    max-width: 540px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger);
}

/* ===================
   SUCCESS OVERLAY
   =================== */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-content {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-checkmark {
    font-size: 80px;
    color: var(--success);
    margin-bottom: 20px;
    animation: successPulse 1s ease infinite;
}

.success-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    margin-bottom: 8px;
}

.success-content p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===================
   ANIMATIONS
   =================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes morphShape {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(45deg); }
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 768px) {
    .role-selector {
        grid-template-columns: 1fr;
    }

    .top-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tab {
        font-size: 12px;
        padding: 8px 12px;
    }

    .page-header {
        padding: 20px 20px 0;
    }

    .page-header h2 { font-size: 22px; }

    .tab-content { padding: 0 16px 24px; }

    .stats-grid { padding: 0 16px; }
    .dashboard-grid {
        padding: 0 16px;
        grid-template-columns: 1fr;
    }

    .lectures-grid {
        grid-template-columns: 1fr;
    }

    .teachers-report-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .glass-card { padding: 20px; }

    .rating-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input[type="text"] {
        width: 100%;
    }

    .complaint-card-header,
    .feedback-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .complaint-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-brand h1 { font-size: 32px; }

    .qr-feedback-code {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .stat-card { flex-direction: column; text-align: center; }

    .teacher-report-stats {
        grid-template-columns: 1fr;
    }
}

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

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

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

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

/* ===================
   REGISTRATION PANEL
   =================== */
.register-role-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.register-role-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.register-role-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.08);
}

.register-role-btn.active {
    border-color: var(--primary);
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 20px var(--primary-glow);
}

.register-role-btn i {
    font-size: 18px;
}

/* ===================
   FORM ERRORS & STATUS
   =================== */
.form-error {
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--danger-light);
    border: 1px solid rgba(225, 112, 85, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.form-status {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.form-status i {
    margin-right: 8px;
}

.form-status-success {
    background: var(--success-light);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: var(--success);
}

.form-status-error {
    background: var(--danger-light);
    border: 1px solid rgba(225, 112, 85, 0.3);
    color: var(--danger);
}

/* ===================
   USER MANAGEMENT CARDS
   =================== */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.user-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
    border-color: var(--primary-light);
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.user-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-role-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px !important;
    text-transform: capitalize;
}

.user-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ===================
   DISABLED BUTTONS
   =================== */
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===================
   LOGIN FORM ENHANCEMENTS
   =================== */
.login-form .form-group + .form-group {
    margin-top: 16px;
}

.login-form .btn-primary {
    margin-top: 8px;
}

/* ===================
   RESPONSIVE — NEW ELEMENTS
   =================== */
@media (max-width: 768px) {
    .register-role-selector {
        flex-direction: column;
    }

    .user-card {
        flex-direction: column;
        text-align: center;
    }

    .user-card-meta {
        justify-content: center;
    }

    .user-card-actions {
        justify-content: center;
    }
}

/* ===================
   CRUD ACTION BUTTONS
   =================== */
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-action-edit:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(108, 92, 231, 0.12);
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-action-key:hover {
    color: var(--warning);
    border-color: var(--warning);
    background: var(--warning-light);
    box-shadow: 0 0 12px rgba(253, 203, 110, 0.2);
}

.btn-action-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
    box-shadow: 0 0 12px rgba(225, 112, 85, 0.2);
}

/* ===================
   CRUD MODAL
   =================== */
.crud-modal h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.crud-modal h3 i {
    margin-right: 10px;
}

.crud-form {
    margin-top: 8px;
}

.crud-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.crud-modal-actions .btn-primary {
    flex: 1;
}

.crud-modal-actions .btn-secondary {
    flex: 0 0 auto;
    padding: 14px 24px;
}

.btn-warning-action {
    background: linear-gradient(135deg, var(--warning), #e17055) !important;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3) !important;
    color: #1a1a2e !important;
}

.btn-warning-action:hover {
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.4) !important;
}

.btn-danger-action {
    background: linear-gradient(135deg, var(--danger), #d63031) !important;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3) !important;
}

.btn-danger-action:hover {
    box-shadow: 0 8px 25px rgba(225, 112, 85, 0.4) !important;
}

/* User card action buttons spacing */
.user-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
