:root {
    --primary-color: #1E88E5;
    --secondary-color: #42A5F5;
    --accent-color: #90CAF9;
    --text-dark: #0D47A1;
    --bg-light: #E3F2FD;
    --gradient: linear-gradient(135deg, #1E88E5 0%, #42A5F5 100%);
    --glass-effect: rgba(30, 136, 229, 0.1);
    --glass-border: rgba(30, 136, 229, 0.2);
    --cyber-glow: rgba(66, 165, 245, 0.3);
    /* Accent RGB tuples consumed by results-page shadows/overlays.
       Override per page to retheme (e.g. teal for document eval). */
    --page-accent-rgb: 30, 136, 229;
    --page-accent-rgb-light: 66, 165, 245;
}

body {
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #E1F5FE 100%);
     background-attachment: fixed;
     color: var(--text-dark);
     min-height: 100vh;
     display: flex;
     flex-direction: column;
 }

 main {
     flex: 1;
 }

/* Modern Navbar Styling */
.navbar {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.95) 0%, rgba(66, 165, 245, 0.95) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(30, 136, 229, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1050;
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.98) 0%, rgba(66, 165, 245, 0.98) 100%) !important;
    box-shadow: 0 8px 40px rgba(30, 136, 229, 0.4);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.8rem;
    color: white !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-brand:hover img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Nav Links */
.navbar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.6rem 1rem !important;
    margin: 0 0.15rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.navbar .nav-link:hover::after {
    width: 60%;
}

/* Dropdown Toggle */
.navbar .dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.navbar .dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    z-index: 1060;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(30, 136, 229, 0.2);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    animation: dropdownFade 0.2s ease;
}

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

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.1) 0%, rgba(66, 165, 245, 0.1) 100%);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-item i {
    color: var(--secondary-color);
    width: 20px;
    transition: all 0.2s ease;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    border-color: rgba(30, 136, 229, 0.15);
    margin: 0.5rem 0;
}

/* Language Toggle Button */
.navbar .btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Mobile Navbar */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.navbar-toggler-icon {
    filter: brightness(1.2);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(30, 136, 229, 0.98);
        backdrop-filter: blur(20px);
        border-radius: 16px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .navbar .nav-link {
        padding: 0.8rem 1rem !important;
        margin: 0.2rem 0;
    }

    .navbar .nav-link::after {
        display: none;
    }

    .navbar .btn-outline-light {
        margin-top: 0.5rem;
        width: 100%;
    }

    .dropdown-menu {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        box-shadow: none;
    }

    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.15);
        color: white;
    }

    .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

.btn-primary {
    background: var(--gradient);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
     transform: translateY(-2px);
     box-shadow: 0 8px 25px rgba(30, 136, 229, 0.4);
     background: linear-gradient(135deg, #1976D2 0%, #1E88E5 100%);
 }

.card {
     border: 1px solid var(--glass-border);
     border-radius: 20px;
     background: rgba(255, 255, 255, 0.85);
     backdrop-filter: blur(10px);
     box-shadow: 0 8px 32px rgba(30, 136, 229, 0.15);
     transition: all 0.3s ease;
 }

 .card:hover {
     transform: translateY(-8px);
     box-shadow: 0 12px 40px rgba(30, 136, 229, 0.25);
     background: rgba(255, 255, 255, 0.9);
 }

.progress-bar {
    background: var(--gradient);
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    font-weight: bold;
    color: #666;
    position: relative;
}

.step.active {
    background: var(--gradient);
    color: white;
}

.step.completed {
     background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
     color: white;
     box-shadow: 0 4px 15px var(--cyber-glow);
}

.step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 20px;
    height: 2px;
    background: #e0e0e0;
    margin-left: 10px;
}

.step:last-child::after {
    display: none;
}

.hero-section {
    background: var(--gradient);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.feature-icon {
     font-size: 3rem;
     color: var(--secondary-color);
     margin-bottom: 20px;
     text-shadow: 0 0 20px var(--cyber-glow);
     filter: drop-shadow(0 4px 8px rgba(30, 136, 229, 0.3));
 }

.loading-spinner {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.audio-controls {
    text-align: center;
    margin: 20px 0;
}

.record-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: white;
    font-size: 2rem;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.record-button:hover {
    transform: scale(1.1);
}

.record-button.recording {
    animation: pulse 1s infinite;
}

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

.question-container {
     background: rgba(255, 255, 255, 0.9);
     backdrop-filter: blur(15px);
     border: 1px solid var(--glass-border);
     border-radius: 20px;
     padding: 30px;
     margin: 20px 0;
     box-shadow: 0 8px 32px rgba(30, 136, 229, 0.15);
 }

.answer-input {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    min-height: 120px;
    resize: vertical;
}

.answer-input:focus {
     border-color: var(--secondary-color);
     box-shadow: 0 0 0 0.2rem rgba(66, 165, 245, 0.25);
     background: rgba(255, 255, 255, 0.95);
 }

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.report-section {
     background: rgba(255, 255, 255, 0.9);
     backdrop-filter: blur(15px);
     border: 1px solid var(--glass-border);
     border-radius: 20px;
     padding: 30px;
     margin: 20px 0;
     box-shadow: 0 8px 32px rgba(30, 136, 229, 0.15);
 }

.score-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin: 5px;
}

.score-excellent {
     background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
     color: white;
     box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.score-good {
     background: linear-gradient(135deg, #90CAF9 0%, #42A5F5 100%);
     color: white;
     box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

.score-average {
     background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
     color: white;
     box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}
.score-poor {
     background: linear-gradient(135deg, #FFAB91 0%, #FF7043 100%);
     color: white;
     box-shadow: 0 4px 15px rgba(255, 112, 67, 0.3);
}

.score-fail {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Additional robotic effects */

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(30, 136, 229, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(66, 165, 245, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.step {
    position: relative;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(66, 165, 245, 0.3) 0%, transparent 70%);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.step:hover::before {
    width: 100px;
    height: 100px;
}

 /* Pulse animation for active elements */
@keyframes cyber-pulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(30, 136, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 136, 229, 0); }
}

.step.active {
    animation: cyber-pulse 2s infinite;
}

/* Enhanced glass effects */
.card::before {
 content: '';
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
 border-radius: 20px;
 pointer-events: none;
}

@media (max-width: 768px) {
 .hero-section {
     padding: 40px 0;
 }

 .step-indicator {
     flex-wrap: wrap;
 }

 .step {
     margin: 5px;
 }
}

/* Modern Footer Styling */
.modern-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.modern-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
}

.modern-footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(30, 136, 229, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(66, 165, 245, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-brand {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.footer-security {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-security i {
    color: var(--secondary-color);
}

/* Page Hero - Animated gradient box for page titles */
.page-hero {
    background: var(--gradient);
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(30, 136, 229, 0.4);
    margin-bottom: 40px;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: hero-float 20s infinite ease-in-out;
}

@keyframes hero-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, -30px) rotate(120deg); }
    66% { transform: translate(30px, 30px) rotate(240deg); }
}

.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.page-hero .hero-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.page-hero .hero-icon i {
    font-size: 2.5rem;
}

/* Page Hero Color Variants */
.page-hero.hero-warning {
    background: linear-gradient(135deg, #FF9800 0%, #FFC107 100%);
    box-shadow: 0 20px 60px rgba(255, 152, 0, 0.4);
}

.page-hero.hero-success {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    box-shadow: 0 20px 60px rgba(76, 175, 80, 0.4);
}

.page-hero.hero-info {
    background: linear-gradient(135deg, #00BCD4 0%, #4DD0E1 100%);
    box-shadow: 0 20px 60px rgba(0, 188, 212, 0.4);
}

.page-hero.hero-purple {
    background: linear-gradient(135deg, #7B1FA2 0%, #AB47BC 100%);
    box-shadow: 0 20px 60px rgba(123, 31, 162, 0.4);
}

.page-hero.hero-teal {
    background: linear-gradient(135deg, #00897B 0%, #26A69A 100%);
    box-shadow: 0 20px 60px rgba(0, 137, 123, 0.4);
}

.page-hero.hero-indigo {
    background: linear-gradient(135deg, #3949AB 0%, #5C6BC0 100%);
    box-shadow: 0 20px 60px rgba(57, 73, 171, 0.4);
}

/* Compact hero variant for pages with more content */
.page-hero.hero-compact {
    padding: 35px 30px;
    border-radius: 25px;
    margin-bottom: 30px;
}

.page-hero.hero-compact h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-hero.hero-compact p {
    font-size: 1rem;
}

.page-hero.hero-compact .hero-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
}

.page-hero.hero-compact .hero-icon i {
    font-size: 2rem;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 40px 20px;
        border-radius: 20px;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .page-hero .hero-icon {
        width: 70px;
        height: 70px;
    }

    .page-hero .hero-icon i {
        font-size: 2rem;
    }
}

/* ─── Evaluation results pages ──────────────────────────────────────────────
   Shared chrome for document_evaluation_results, paper_evaluation_results,
   and instructor_paper_evaluation_results. Themed via --page-accent-rgb
   so each page can recolor shadows/overlays without redefining structure. */

.results-hero {
    background: var(--gradient);
    border-radius: 30px;
    padding: 60px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(var(--page-accent-rgb), 0.4);
    margin-bottom: 40px;
}

.results-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: hero-float 20s infinite ease-in-out;
}

.results-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.score-display-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.2), 0 0 30px rgba(255,255,255,0.2); }
    50% { box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 50px rgba(255,255,255,0.4); }
}

.score-circle .score-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.score-circle .score-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

.level-badge-modern {
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.hero-meta {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(var(--page-accent-rgb), 0.15);
    transition: all 0.4s ease;
    margin-bottom: 40px;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(var(--page-accent-rgb), 0.25);
}

.summary-card h4 {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-text {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
}

.export-card {
    background: linear-gradient(135deg,
        rgba(var(--page-accent-rgb), 0.05) 0%,
        rgba(var(--page-accent-rgb-light), 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 2px dashed var(--glass-border);
    border-radius: 25px;
    padding: 35px;
    transition: all 0.4s ease;
}

.export-card:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg,
        rgba(var(--page-accent-rgb), 0.1) 0%,
        rgba(var(--page-accent-rgb-light), 0.1) 100%);
    transform: translateY(-3px);
}

.no-data-container {
    text-align: center;
    padding: 80px 20px;
}

.no-data-container i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 20px;
}

.no-data-container p {
    font-size: 1.2rem;
    color: #666;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient);
    color: white;
    border: none;
    box-shadow: 0 8px 32px rgba(var(--page-accent-rgb), 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(var(--page-accent-rgb), 0.4);
    color: white;
}

@media (max-width: 768px) {
    .results-hero {
        padding: 40px 20px;
    }

    .results-hero h1 {
        font-size: 1.8rem;
    }

    .score-circle {
        width: 140px;
        height: 140px;
    }

    .score-circle .score-value {
        font-size: 2.2rem;
    }
}

#hasImagesOrTables {
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#hasImagesOrTables:hover {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
    transform: scale(1.04);
}

label[for="hasImagesOrTables"] {
    cursor: pointer;
}
