/*
 * Common CSS for InterSystems Certification Workshop
 * Uses CSS variables for theming - import colors.css before this file
 */

/* ============================================
   CSS VARIABLES (defaults, override in colors.css)
   ============================================ */
:root {
    /* Body & Background */
    --bg-gradient-start: #607d8b;
    --bg-gradient-end: #546e7a;

    /* Header */
    --header-start: #78909c;
    --header-end: #607d8b;

    /* Primary Colors */
    --primary: #607d8b;
    --primary-dark: #546e7a;
    --primary-light: #90a4ae;

    /* Button Colors */
    --quiz-btn: #607d8b;
    --quiz-btn-hover: #546e7a;
    --knowledge-btn: #90a4ae;
    --knowledge-btn-hover: #78909c;

    /* Accent Colors (consistent across all exams) */
    --accent-orange: #ff9800;
    --accent-orange-dark: #e65100;
    --accent-green: #43a047;
    --accent-green-dark: #2e7d32;
    --accent-pink: #e91e63;
    --accent-pink-dark: #c2185b;
    --accent-purple: #7b1fa2;

    /* Text Colors */
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --text-light: #999;

    /* Backgrounds */
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --bg-gray: #f5f5f5;
    --bg-border: #e0e0e0;
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Index page uses wider container */
.container.wide {
    max-width: 1200px;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.nav-bar {
    background: rgba(0,0,0,0.2);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255,255,255,0.25);
}

.quiz-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--knowledge-btn);
    transition: all 0.3s ease;
}

.quiz-link:hover {
    background: var(--knowledge-btn-hover);
    transform: scale(1.05);
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    gap: 6px;
    align-items: center;
}

.lang-btn,
a.lang-btn,
button.lang-btn {
    display: inline-block !important;
    padding: 8px 14px !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: white !important;
    background: rgba(255,255,255,0.15) !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.lang-btn:hover,
a.lang-btn:hover,
button.lang-btn:hover {
    background: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15) !important;
}

.lang-btn.active,
a.lang-btn.active,
button.lang-btn.active {
    background: #4CAF50 !important;
    color: white !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.4) !important;
}

/* Language toggle on light backgrounds (index pages) */
.topic-selector .lang-btn,
.topic-selector a.lang-btn,
.topic-selector button.lang-btn {
    color: #333 !important;
    background: #e0e0e0 !important;
    border-color: #ccc !important;
}

.topic-selector .lang-btn:hover,
.topic-selector a.lang-btn:hover,
.topic-selector button.lang-btn:hover {
    background: #d0d0d0 !important;
    color: #333 !important;
}

.topic-selector .lang-btn.active,
.topic-selector a.lang-btn.active,
.topic-selector button.lang-btn.active {
    background: #4CAF50 !important;
    color: white !important;
    border-color: #4CAF50 !important;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--header-start), var(--header-end));
    color: white;
    text-align: center;
    padding: 25px 30px;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Smaller header for quiz/knowledge pages */
.header.compact {
    padding: 30px;
}

.header.compact h1 {
    font-size: 1.8em;
}

/* ============================================
   AUTH BAR (Quiz pages)
   ============================================ */
.auth-bar {
    background: var(--bg-gray);
    padding: 8px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--bg-border);
    font-size: 0.9em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85em;
}

.auth-btn {
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.login-btn:hover {
    background: var(--primary-dark);
}

.logout-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #ddd;
}

.logout-btn:hover {
    background: var(--bg-border);
}

/* Knowledge page auth bar (transparent) */
.nav-bar .auth-bar {
    background: transparent;
    border: none;
}

.nav-bar .login-btn {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-bar .login-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-bar .logout-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    display: none;
}

.nav-bar .user-info {
    display: none;
    color: white;
}

.nav-bar .user-avatar {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   INDEX PAGE - INFO BOXES
   ============================================ */
.exam-info {
    background: var(--bg-gray);
    border-left: 4px solid #9e9e9e;
    padding: 15px 20px;
    margin: 15px 40px;
    border-radius: 5px;
}

.exam-info h3 {
    color: #616161;
    margin-bottom: 10px;
}

.exam-info p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.exam-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.stat {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: #616161;
}

.practice-info {
    background: #e3f2fd;
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 0 40px 15px 40px;
    border-radius: 5px;
}

.practice-info h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.practice-info p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.practice-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.practice-stat {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: var(--primary);
}

/* ============================================
   INDEX PAGE - PROGRESS SECTION
   ============================================ */
.progress-section {
    background: #fff3e0;
    border-left: 4px solid var(--accent-orange);
    padding: 12px 20px;
    margin: 15px 40px;
    border-radius: 5px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.progress-header h3 {
    color: var(--accent-orange-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-toggle {
    background: none;
    border: none;
    color: var(--accent-orange-dark);
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.progress-toggle.expanded {
    transform: rotate(180deg);
}

.progress-summary {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.progress-stat {
    background: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.9em;
    color: var(--accent-orange-dark);
    font-weight: 500;
}

.progress-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.progress-details.expanded {
    max-height: 500px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(230, 81, 0, 0.2);
}

.quiz-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.quiz-progress-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85em;
}

.quiz-progress-item .quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.quiz-progress-item .quiz-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.quiz-progress-item .quiz-score {
    font-weight: bold;
}

.quiz-progress-item .quiz-score.excellent {
    color: #1b5e20;
}

.quiz-progress-item .quiz-score.good {
    color: #f57c00;
}

.quiz-progress-item .quiz-score.poor {
    color: #d32f2f;
}

.quiz-progress-item .not-taken {
    color: #9e9e9e;
    font-style: italic;
}

.quiz-mini-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-border);
    border-radius: 2px;
    overflow: hidden;
}

.quiz-mini-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quiz-mini-progress-fill.excellent {
    background: linear-gradient(90deg, #2e7d32, #1b5e20);
}

.quiz-mini-progress-fill.good {
    background: linear-gradient(90deg, #ff9800, #f57c00);
}

.quiz-mini-progress-fill.poor {
    background: linear-gradient(90deg, #ef5350, #d32f2f);
}

.overall-progress-bar {
    background: #ffe0b2;
    border-radius: 10px;
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
}

.overall-progress-fill {
    background: linear-gradient(90deg, #ff9800, #f57c00);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ============================================
   INDEX PAGE - TOPIC SELECTOR
   ============================================ */
.topic-selector {
    padding: 25px 40px;
}

.topic-selector h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    text-align: center;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.topic-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--bg-border);
    text-decoration: none;
    color: inherit;
    display: block;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.topic-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.topic-card p {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-bottom: 15px;
}

.topic-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--header-start), var(--header-end));
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.subtopics {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--bg-border);
}

.subtopic-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-border);
}

.subtopic-row:last-child {
    border-bottom: none;
}

.subtopic-label {
    flex: 1;
    font-size: 0.9em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.subtopic-label::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    margin-right: 8px;
    flex-shrink: 0;
}

.subtopic-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Legacy support for old structure */
.subtopic-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.subtopic-item::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    margin-right: 8px;
}

/* ============================================
   QUIZ/KNOWLEDGE BUTTONS
   ============================================ */
.quiz-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.quiz-btn {
    display: inline-block;
    padding: 8px 15px;
    background: var(--quiz-btn);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.quiz-btn:hover {
    background: var(--quiz-btn-hover);
    transform: scale(1.05);
}

.knowledge-btn {
    background: var(--knowledge-btn);
}

.knowledge-btn:hover {
    background: var(--knowledge-btn-hover);
}

/* ============================================
   QUIZ PAGE STYLES
   ============================================ */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: var(--text-muted);
}

.error {
    text-align: center;
    padding: 50px;
    color: #d32f2f;
    background: #ffebee;
    margin: 20px;
    border-radius: 10px;
}

.quiz-container {
    padding: 30px;
}

.question {
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 10px;
    background: var(--bg-light);
    border-left: 5px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}

.question.multiple-choice {
    border-left-color: var(--accent-purple);
}

.question h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2em;
    padding-right: 40px;
}

.question-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.single-choice-badge {
    background: #e3f2fd;
    color: var(--primary);
}

.multiple-choice-badge {
    background: #f3e5f5;
    color: var(--accent-purple);
}

/* Quiz Version/Date Meta Info */
.quiz-meta {
    margin-top: 12px;
    font-size: 0.8em;
    opacity: 0.85;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.quiz-version,
.quiz-date {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Revised Question Badge */
.revised-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    font-size: 0.6em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.report-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #ddd;
    color: var(--text-light);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
}

.report-btn:hover {
    background: #fff3e0;
    border-color: var(--accent-orange);
    color: #f57c00;
}

.options {
    display: grid;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--bg-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option:hover {
    border-color: var(--primary);
    background: #e3f2fd;
    transform: translateX(5px);
}

.option.multiple-hover:hover {
    border-color: var(--accent-purple);
    background: #f3e5f5;
}

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.option input[type="checkbox"] {
    accent-color: var(--accent-purple);
}

.option input[type="radio"] {
    accent-color: var(--primary);
}

.option label {
    cursor: pointer;
    flex-grow: 1;
    font-weight: 500;
}

.submit-btn {
    display: block;
    width: 200px;
    margin: 40px auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--header-start), var(--header-end));
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.results {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 10px;
    border-left: 5px solid var(--primary);
}

.score {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.explanation {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--accent-orange);
    position: relative;
}

.explanation h4 {
    color: var(--accent-orange-dark);
    margin-bottom: 10px;
    font-size: 1.1em;
    padding-right: 80px;
}

.explanation.correct h4 {
    color: var(--accent-green);
}

.explanation.incorrect h4 {
    color: #e53935;
}

.explanation.partial h4 {
    color: var(--accent-orange);
}

.explanation p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   KNOWLEDGE PAGE STYLES
   ============================================ */
.toc {
    background: #e3f2fd;
    padding: 20px 30px;
    border-bottom: 1px solid #bbdefb;
}

.toc h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.toc ol {
    margin-left: 20px;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: #1976d2;
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

.content {
    padding: 30px;
    position: relative;
}

.knowledge-item {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--bg-border);
}

.knowledge-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.knowledge-item h2 {
    color: var(--primary);
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* Key Points Section */
.key-points {
    background: #e8f5e9;
    border-left: 4px solid var(--accent-green);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.key-points h3 {
    color: #2e7d32;
    margin-bottom: 12px;
    font-size: 1em;
}

.key-points ul {
    margin-left: 20px;
    padding-left: 0;
}

.key-points li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.key-points strong {
    color: #1b5e20;
}

/* Detailed Notes Section */
.detailed-notes {
    background: #fff3e0;
    border-left: 4px solid var(--accent-orange);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.detailed-notes h3 {
    color: var(--accent-orange-dark);
    margin-bottom: 12px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detailed-notes h3::after {
    content: "[-]";
    font-size: 0.8em;
}

.detailed-notes.collapsed h3::after {
    content: "[+]";
}

.detailed-notes.collapsed .notes-content {
    display: none;
}

.detailed-notes p {
    color: var(--text-secondary);
    text-align: justify;
    margin-bottom: 12px;
}

/* NEW: Detailed Notes h4 styling for better title differentiation */
.detailed-notes h4 {
    color: var(--accent-orange-dark);
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ffcc80;
    padding-bottom: 4px;
}

/* NEW: Proper list indentation in Detailed Notes */
.detailed-notes ul,
.detailed-notes ol {
    margin-left: 20px;
    padding-left: 20px;
}

.detailed-notes li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.detailed-notes ul ul,
.detailed-notes ol ol,
.detailed-notes ul ol,
.detailed-notes ol ul {
    margin-left: 20px;
    margin-top: 8px;
}

/* References Section */
.references {
    background: var(--bg-gray);
    padding: 20px;
    border-radius: 8px;
}

.references h3 {
    color: #616161;
    margin-bottom: 12px;
    font-size: 1em;
}

.references ul {
    list-style: none;
    margin: 0;
}

.references li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.references li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.references a {
    color: #1976d2;
    text-decoration: none;
}

.references a:hover {
    text-decoration: underline;
}

.references .pdf-ref {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

/* Exam Prep Section */
.exam-prep {
    background: #fce4ec;
    border-left: 4px solid var(--accent-pink);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.exam-prep h2 {
    color: var(--accent-pink-dark);
    border-bottom: none;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.exam-prep h3 {
    color: #ad1457;
    margin: 15px 0 10px 0;
    font-size: 1em;
}

.exam-prep ul,
.exam-prep ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.exam-prep li {
    margin-bottom: 6px;
}

/* Take Quiz Button */
.take-quiz-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--knowledge-btn), var(--knowledge-btn-hover));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.take-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-gray);
    color: var(--text-muted);
    font-size: 0.9em;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--bg-border);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

.modal-field select:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-field textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-cancel {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: var(--bg-border);
}

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

.modal-btn-submit:hover {
    background: var(--primary-dark);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.report-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
}

.question-options-preview {
    margin-top: 10px;
    padding-left: 15px;
    font-size: 0.9em;
    color: var(--text-muted);
}

/* ============================================
   REPORT MODAL (Knowledge Pages)
   ============================================ */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.report-modal.active {
    display: flex;
}

.report-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.report-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.report-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.report-content select,
.report-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--bg-border);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    margin-bottom: 15px;
}

.report-content select:focus,
.report-content textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.report-content textarea {
    min-height: 100px;
    resize: vertical;
}

.report-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.report-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.report-actions button[type="button"] {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

.report-actions button[type="button"]:hover {
    background: var(--bg-border);
}

.report-actions button[type="submit"],
.report-actions button.submit-report {
    background: var(--primary);
    color: white;
}

.report-actions button[type="submit"]:hover,
.report-actions button.submit-report:hover {
    background: var(--primary-dark);
}

/* ============================================
   CODE BLOCKS
   ============================================ */
code {
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

pre {
    background: var(--bg-gray);
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 10px 0;
    border-left: 3px solid var(--primary);
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* ============================================
   MODAL COMPONENTS (for feedback, etc.)
   ============================================ */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1565c0;
}

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

.required {
    color: #d32f2f;
}

.char-counter {
    font-size: 0.85em;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.char-counter.warning {
    color: #ff9800;
}

.char-counter.error {
    color: #d32f2f;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #1565c0;
    color: white;
}

.btn-primary:hover {
    background: #0d47a1;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.4em;
    }

    .content {
        padding: 20px;
    }

    .nav-bar {
        flex-direction: column;
        gap: 10px;
    }

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

    .exam-info,
    .practice-info,
    .progress-section {
        margin: 20px 15px;
    }

    .topic-selector {
        padding: 20px;
    }
}

/* ============================================
   SUBSECTION REPORT BUTTONS (Knowledge Pages)
   ============================================ */
.subsection-report-btn {
    background: transparent;
    border: 1px solid var(--bg-border);
    color: var(--text-muted);
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.subsection-report-btn:hover {
    background: var(--bg-light);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

/* ============================================
   FEEDBACK BUTTON
   ============================================ */
.feedback-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Feedback modal specific styles */
#feedbackModal .modal {
    width: 90%;
    max-width: 600px;
}

#feedbackModal .char-counter {
    text-align: right;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

#feedbackModal .char-counter.warning {
    color: #f57c00;
}

#feedbackModal .char-counter.error {
    color: #d32f2f;
}

#feedbackModal .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

#feedbackModal .checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}
