/* CSS Styling for Quiz Master App */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --tertiary-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --vh: 1vh;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

html {
    height: -webkit-fill-available;
}

.app-container {
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
}

.admin-access-hint {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1300;
    border: none;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.92);
    color: #f9fafb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 7px 14px;
    cursor: pointer;
    transition: var(--transition);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    -webkit-tap-highlight-color: transparent;
}

.admin-access-hint:hover {
    transform: translateY(-2px);
    background: rgba(17, 24, 39, 0.94);
}

/* PAGE STRUCTURE */
.page {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.page.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* HOME PAGE STYLING */
.home-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideInCenter 0.6s ease-out;
}

.brand-icon {
    font-size: 80px;
    color: var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.subject-btn {
    background: linear-gradient(135deg, var(--light), white);
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 30px 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.subject-btn i {
    font-size: 40px;
    color: var(--primary-color);
    transition: var(--transition);
}

.subject-btn span {
    font-size: 14px;
}

.subject-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.subject-btn:hover i {
    color: var(--secondary-color);
}

.subject-btn.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--secondary-color);
}

.subject-btn.selected i {
    color: white;
}

/* DIFFICULTY PAGE STYLING */
.difficulty-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 30px;
    padding: 8px 16px;
}

.btn-back:hover {
    color: var(--secondary-color);
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.difficulty-btn {
    background: linear-gradient(135deg, var(--light), white);
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 40px 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 600;
}

.difficulty-btn i {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
    transition: var(--transition);
}

.difficulty-btn h5 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 20px;
}

.difficulty-btn p {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

.difficulty-btn.basic i {
    color: #10b981;
}

.difficulty-btn.intermediate i {
    color: #f59e0b;
}

.difficulty-btn.advanced i {
    color: #ef4444;
}

.difficulty-btn.test-bank i {
    color: #2563eb;
}

.difficulty-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.difficulty-btn.selected {
    color: white;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.difficulty-btn.selected i {
    color: white;
}

.test-bank-config {
    margin-top: 24px;
    border: 2px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: left;
}

/* QUIZ PAGE STYLING */
.quiz-header {
    background: white;
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.quiz-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.quiz-header-content h3 {
    flex: 1;
    margin: 0;
    color: var(--dark);
    font-size: 18px;
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
}

.progress-section {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.progress {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.quiz-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.question-section h4 {
    color: var(--dark);
    font-size: 22px;
    line-height: 1.5;
    font-weight: 600;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.option-item input[type="radio"] {
    margin-top: 3px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.option-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-weight: 500;
    color: var(--dark);
}

.option-item:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.option-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    font-weight: 600;
    color: var(--primary-color);
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
}

.btn-outline-secondary {
    background: white;
    color: var(--dark);
    border: 2px solid #d1d5db;
}

.btn-outline-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.btn-outline-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* RESULTS PAGE STYLING */
.results-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    animation: slideInCenter 0.6s ease-out;
}

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

.success-icon {
    font-size: 80px;
    color: var(--success-color);
    animation: bounce 0.8s ease-in-out;
}

.results-header h2 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 20px;
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.score-number {
    font-size: 80px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    font-size: 18px;
    color: #6b7280;
    font-weight: 500;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 10px;
    margin-bottom: 20px;
}

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

.stat-item h6 {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-lg {
    padding: 16px 60px;
    font-size: 18px;
    border-radius: 10px;
    width: 100%;
}

/* REVIEW PAGE STYLING */
.review-header {
    background: white;
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.review-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.review-header-content h3 {
    flex: 1;
    margin: 0;
    color: var(--dark);
    font-size: 18px;
}

.review-content {
    padding: 30px 0;
}

.review-questions-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.review-question-card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.review-question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.review-question-number {
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 8px 16px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
}

.review-question-status {
    font-size: 24px;
}

.review-question-status.correct {
    color: var(--success-color);
}

.review-question-status.incorrect {
    color: var(--danger-color);
}

.review-question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 20px;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-option {
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-option-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.review-option-text {
    flex: 1;
    color: var(--dark);
    font-weight: 500;
}

.review-option.user-answer {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
}

.review-option.user-answer .review-option-icon {
    color: var(--danger-color);
}

.review-option.correct-answer {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.review-option.correct-answer .review-option-icon {
    color: var(--success-color);
}

.review-option.user-correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.review-option.user-correct .review-option-icon {
    color: var(--success-color);
}

/* ANIMATIONS */
@keyframes slideInCenter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* PORTAL PAGE STYLING */
.portal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideInCenter 0.6s ease-out;
}

.portal-selection {
    display: grid;
    grid-template-columns: minmax(260px, 420px);
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
}

.portal-helper-text {
    font-weight: 600;
    color: #6b7280;
}

.portal-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 50px 30px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 600;
}

.portal-btn i {
    font-size: 60px;
    margin-bottom: 20px;
    display: block;
    transition: var(--transition);
}

.portal-btn h3 {
    color: var(--dark);
    font-size: 24px;
    margin-bottom: 12px;
}

.portal-btn p {
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

.portal-btn.student-portal i {
    color: #10b981;
}

.portal-btn.admin-portal i {
    color: #f59e0b;
}

.portal-btn:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.portal-btn.student-portal:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.portal-btn.admin-portal:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

/* ADMIN PAGE STYLING */
.admin-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #111827, #1f2937);
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.admin-logo h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.admin-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-nav-btn i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.admin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    font-weight: 700;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

.admin-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.students-attempts {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 22px;
}

.students-attempts-title {
    margin: 0 0 14px;
    font-size: 20px;
    color: var(--dark);
}

.students-attempts-list {
    display: grid;
    gap: 10px;
}

.attempt-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f9fafb;
}

.attempt-detail {
    color: #4b5563;
    font-size: 14px;
}

.attempt-time {
    color: #6b7280;
    font-size: 12px;
}

.admin-main h2 {
    color: var(--dark);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-color);
}

.stat-card h4 {
    margin: 0;
    font-size: 28px;
    color: var(--dark);
    font-weight: 700;
}

.stat-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.upload-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(139, 92, 246, 0.02));
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.upload-area h4 {
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.upload-area p {
    color: #6b7280;
    margin: 0;
}

.uploaded-icons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.icon-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.icon-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.icon-item img,
.icon-item i {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.icon-item-name {
    font-size: 12px;
    color: var(--dark);
    font-weight: 600;
    word-break: break-word;
}

.icon-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

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

.questions-container,
#subjectsListContainer {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.question-card {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.question-card h5 {
    margin: 0;
    color: var(--dark);
    font-weight: 700;
    flex: 1;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-edit:hover {
    opacity: 0.8;
}

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

.btn-delete:hover {
    opacity: 0.8;
}

.subject-card {
    background: linear-gradient(135deg, var(--light), white);
    border: 2px solid #e5e7eb;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.subject-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-content {
    width: 100%;
    max-width: 460px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 28px;
}

.auth-modal-content h3 {
    margin: 0 0 8px;
    color: var(--dark);
    font-weight: 700;
}

.auth-field {
    margin-top: 14px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
}

.auth-message {
    min-height: 22px;
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.auth-message.error {
    color: var(--danger-color);
}

.auth-message.success {
    color: var(--success-color);
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.subject-info h5 {
    margin: 0 0 5px 0;
    color: var(--dark);
    font-weight: 700;
}

.subject-info p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* RESPONSIVE ADMIN */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 220px;
        padding: 20px 15px;
    }

    .admin-main {
        padding: 30px 25px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
    }

    .admin-logo {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .admin-nav {
        flex-direction: row;
        flex: 1;
        margin: 0 20px;
        gap: 5px;
    }

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

    .admin-nav-btn span {
        display: none;
    }

    .admin-main {
        padding: 20px 15px;
    }

    .students-attempts {
        padding: 16px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

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

    .portal-selection {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .home-content,
    .difficulty-content,
    .results-content {
        padding: 40px 25px;
    }

    .brand-icon {
        font-size: 60px;
    }

    .subjects-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .subject-btn {
        padding: 20px 15px;
    }

    .subject-btn i {
        font-size: 30px;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
    }

    .difficulty-btn {
        padding: 30px 20px;
    }

    .difficulty-btn i {
        font-size: 40px;
    }

    .quiz-content {
        padding: 25px;
    }

    .quiz-header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
    }

    .quiz-header-content h3 {
        flex: none;
    }

    .timer-section {
        width: 100%;
        justify-content: center;
    }

    .question-section h4 {
        font-size: 18px;
    }

    .results-stats {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .score-number {
        font-size: 60px;
    }

    .quiz-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Review page mobile styles */
    .review-header-content {
        padding: 0 20px;
    }

    .review-content {
        padding: 20px 0;
    }

    .review-question-card {
        padding: 20px;
    }

    .review-question-header {
        flex-wrap: wrap;
    }

    .review-question-text {
        font-size: 16px;
    }

    .review-option {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .home-content,
    .difficulty-content,
    .results-content {
        padding: 30px 20px;
    }

    body {
        font-size: 14px;
    }

    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .subject-btn {
        padding: 15px 10px;
    }

    .subject-btn i {
        font-size: 24px;
    }

    .subject-btn span {
        font-size: 12px;
    }

    .difficulty-btn h5 {
        font-size: 16px;
    }

    .quiz-header-content {
        padding: 0 15px;
    }

    .quiz-content {
        padding: 15px;
    }

    .quiz-controls {
        gap: 10px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .score-number {
        font-size: 48px;
    }

    .score-label {
        font-size: 14px;
    }

    .admin-access-hint {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 6px 11px;
    }

    /* Review page small mobile styles */
    .review-header-content {
        padding: 0 15px;
    }

    .review-question-card {
        padding: 15px;
    }

    .review-question-number {
        font-size: 14px;
        padding: 6px 12px;
        min-width: 40px;
    }

    .review-question-status {
        font-size: 20px;
    }

    .review-question-text {
        font-size: 15px;
    }

    .review-option {
        padding: 10px 12px;
    }

    .review-option-icon {
        font-size: 16px;
        min-width: 20px;
    }

    .review-option-text {
        font-size: 14px;
    }
}

/* iOS COMPATIBILITY FIXES */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .app-container {
        height: -webkit-fill-available;
    }
    
    .page {
        min-height: -webkit-fill-available;
    }
}

/* Touch handling for iOS */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
}

input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* UTILITY CLASSES */
.min-vh-100 {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.flex-grow-1 {
    flex-grow: 1;
}

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

.text-muted {
    color: #6b7280;
}

.lead {
    font-size: 18px;
    line-height: 1.6;
}

.fw-bold {
    font-weight: 700;
}

.display-4 {
    font-size: 56px;
    font-weight: 700;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
