/* Exit Exam Preparation System - Green Gradient Theme */

:root {
    --primary-green: #10b981;
    --dark-green: #059669;
    --light-green: #34d399;
    --bg-white: #ffffff;
    --bg-light: #f0fdf4;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border-color: #d1fae5;
    --shadow: 0 4px 6px rgba(16, 185, 129, 0.1);
    --dark-bg: #1e293b;
    --darker-bg: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Disable right-click and text selection */
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
}

/* Header */
.header {
    background: var(--darker-bg);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-green);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.nav-links a:hover {
    color: var(--primary-green);
    background: rgba(16, 185, 129, 0.1);
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: 20px;
    cursor: pointer;
}

.back-button:hover {
    background: var(--bg-light);
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateX(-3px);
}

.back-button::before {
    content: '←';
    font-size: 18px;
}

/* Page Header with Back Button */
.page-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.page-header h2 {
    margin: 0;
    flex: 1;
}
    display: none;
}

/* Footer */
.footer {
    background: var(--darker-bg);
    color: #94a3b8;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-green);
}

.footer-section p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p i {
    color: var(--primary-green);
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #334155;
    color: #64748b;
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    color: #94a3b8;
    font-size: 20px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-green);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Department Card with Image */
.dept-card {
    position: relative;
    overflow: hidden;
}

.dept-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block; /* Prevent extra space below image */
    aspect-ratio: 400 / 180; /* Maintain aspect ratio */
}

.dept-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-green);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

/* Preview Questions */
.preview-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: var(--shadow);
}

.preview-question {
    padding: 20px;
    border-left: 4px solid var(--primary-green);
    background: var(--bg-light);
    margin-bottom: 20px;
    border-radius: 8px;
}

.preview-question.locked {
    background: #f3f4f6;
    border-left-color: #9ca3af;
    position: relative;
    filter: blur(3px);
    user-select: none;
}

.preview-question.locked::after {
    content: '🔒 Purchase to unlock';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    filter: blur(0);
}

.question-number {
    color: var(--primary-green);
    font-weight: bold;
    margin-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* Question Interface */
.question-container {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    max-width: 800px;
    margin: 24px auto;
}

.question-text {
    font-size: 17px;
    margin-bottom: 28px;
    line-height: 1.7;
    color: #1f2937;
    font-weight: 500;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.question-number-badge {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.progress-bar-container {
    flex: 1;
    max-width: 400px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-left: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-green);
    transition: width 0.3s;
    border-radius: 3px;
}

.answer-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--primary-green);
}

.answer-section h3 {
    color: var(--primary-green);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.answer-section p {
    color: #374151;
    line-height: 1.6;
    font-size: 15px;
}

.hint-explanation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hint, .btn-explanation {
    padding: 10px 24px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-hint:hover, .btn-explanation:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: #f0fdf4;
}

/* Mobile responsive for buttons */
@media (max-width: 768px) {
    .hint-explanation-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 0 15px;
    }
    
    .hint-explanation-buttons button {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.question-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    background: white;
    transition: all 0.2s;
}

.page-number:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.page-number.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.page-ellipsis {
    color: #9ca3af;
    padding: 0 4px;
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: var(--dark-green);
    border: 1px solid var(--primary-green);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: var(--darker-bg);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a,
    .nav-links button {
        padding: 15px 20px;
        font-size: 16px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .theme-toggle {
        margin: 0;
        justify-content: flex-start;
    }
    
    /* Hamburger button */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
    }
    
    .mobile-menu-btn span {
        width: 25px;
        height: 3px;
        background: white;
        transition: all 0.3s;
        border-radius: 2px;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    .question-container {
        padding: 20px;
    }
    
    .navigation-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .progress-bar-container {
        width: 100%;
        margin-left: 0;
    }
    
    .question-pagination {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .page-number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Hide elements for print/screenshot protection */
@media print {
    body {
        display: none;
    }
}

/* Multiple Choice Styles */
.choice-option {
    padding: 16px 20px;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    font-size: 15px;
    color: #374151;
}

.choice-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.choice-option.selected {
    border-color: var(--primary-green);
    background: #f0fdf4;
    border-width: 2px;
}

.choice-option input[type="radio"] {
    display: none;
}

.choice-option label {
    cursor: pointer;
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.choice-option strong {
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    min-width: 24px;
}

.choice-option.selected strong {
    color: var(--primary-green);
}


/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    margin: 0 10px;
}

.theme-toggle:hover {
    background: var(--primary-green);
    color: white;
    transform: scale(1.1);
}

/* Dark Theme for User Pages */
body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
}

body.dark-theme .header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: #334155;
}

body.dark-theme .logo {
    color: #f1f5f9;
}

body.dark-theme .nav-links a {
    color: #cbd5e1;
}

body.dark-theme .nav-links a:hover {
    color: var(--primary-green);
}

body.dark-theme .theme-toggle {
    border-color: #cbd5e1;
    color: #cbd5e1;
}

body.dark-theme .theme-toggle:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

body.dark-theme .container {
    color: #f1f5f9;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4 {
    color: #f1f5f9;
}

body.dark-theme .card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .dept-card {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-theme .dept-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

body.dark-theme .dept-card h3 {
    color: var(--primary-green);
}

body.dark-theme .dept-card p {
    color: #cbd5e1;
}

body.dark-theme .btn-secondary {
    background: #334155;
    color: #f1f5f9;
}

body.dark-theme .btn-secondary:hover {
    background: #475569;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme select,
body.dark-theme textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #64748b;
}

body.dark-theme .form-group label {
    color: #cbd5e1;
}

body.dark-theme .footer {
    background: rgba(15, 23, 42, 0.95);
    border-top-color: #334155;
    color: #cbd5e1;
}

body.dark-theme .question-container {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .question-text {
    color: #f1f5f9;
    background: #0f172a;
}

body.dark-theme .choice-option {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme .choice-option:hover {
    background: #334155;
}

body.dark-theme .choice-option.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-green);
}

body.dark-theme .answer-section {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary-green);
}

body.dark-theme .answer-section h3 {
    color: var(--primary-green);
}

body.dark-theme .answer-section p {
    color: #cbd5e1;
}

body.dark-theme .stat-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .stat-label {
    color: #94a3b8;
}

body.dark-theme .stat-value {
    color: #f1f5f9;
}

body.dark-theme .progress-bar-container {
    background: #334155;
}

body.dark-theme .alert {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .spinner {
    border-color: #334155;
    border-top-color: var(--primary-green);
}


/* Skeleton Loaders - Prevent CLS */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-button {
    height: 45px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-top: 15px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Prevent layout shift for card grid */
.card-grid {
    min-height: 400px; /* Reserve minimum space */
}

/* Image loading optimization */
img[loading="lazy"] {
    min-height: 180px; /* Reserve space for lazy-loaded images */
}
