/**
 * Desktop-optimized CSS for ngager Student Engagement Platform
 * Targets screens with min-width: 769px
 * Requirements: 15.4 - Desktop-optimized web interface
 */

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    min-height: 100vh;
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Connection Status Indicator */
.connection-status {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border-radius: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.connection-status.connected {
    background-color: #4caf50;
    color: white;
}

.connection-status.disconnected {
    background-color: #f44336;
    color: white;
}

.connection-status.degraded {
    background-color: #ff9800;
    color: white;
}

.connection-status.hidden {
    display: none;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: #4a90d9;
    color: white;
}

.btn-primary:hover {
    background-color: #3a7bc8;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #43a047;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #e53935;
}

.btn-block {
    width: 100%;
}

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

.btn-lg {
    min-height: 48px;
    padding: 12px 28px;
    font-size: 16px;
}

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

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

.form-input {
    width: 100%;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-input.error {
    border-color: #f44336;
}

.form-error {
    color: #f44336;
    font-size: 13px;
    margin-top: 4px;
}

/* Card Component */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* ==================== Ngager Screen - Split Panel Layout ==================== */
/* Requirements: 15.4 - Desktop-optimized web interface */
/* Lecturer interface with left panel (questions) and right panel (active question) */

.ngager-screen {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    min-height: calc(100vh - 120px);
    padding: 8px 0;
}

/* Responsive grid for different desktop sizes */
@media (min-width: 1200px) {
    .ngager-screen {
        grid-template-columns: 420px 1fr;
        gap: 32px;
    }
}

@media (min-width: 1600px) {
    .ngager-screen {
        grid-template-columns: 480px 1fr;
        gap: 40px;
    }
}

/* Narrower screens - reduce left panel */
@media (max-width: 1024px) {
    .ngager-screen {
        grid-template-columns: 320px 1fr;
        gap: 20px;
    }
}

.ngager-left-panel {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 24px;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* Custom scrollbar for left panel */
.ngager-left-panel::-webkit-scrollbar {
    width: 8px;
}

.ngager-left-panel::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.ngager-left-panel::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.ngager-left-panel::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.ngager-right-panel {
    background-color: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

@media (min-width: 1200px) {
    .ngager-right-panel {
        padding: 40px;
    }
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #444;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title .question-count {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    background-color: #f0f2f5;
    padding: 4px 12px;
    border-radius: 12px;
}

/* ==================== Question List (Left Panel) - Drag and Drop ==================== */
/* Requirements: 7.1 - Drag-and-drop question activation */

.question-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.question-item {
    padding: 18px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    /* Drag handle indicator */
    padding-left: 36px;
}

/* Drag handle visual indicator */
.question-item::before {
    content: '⋮⋮';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 14px;
    letter-spacing: 2px;
    transition: color 0.2s ease;
}

.question-item:hover {
    background-color: #f0f4f8;
    border-color: #4a90d9;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.15);
    transform: translateY(-2px);
}

.question-item:hover::before {
    color: #4a90d9;
}

/* Active dragging state */
.question-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

/* Question item that's been activated (used) */
.question-item.used {
    background-color: #f5f5f5;
    border-color: #ddd;
    opacity: 0.7;
}

.question-item.used::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 12px;
    color: #4caf50;
    font-size: 16px;
    font-weight: bold;
}

.question-item-type {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.question-item-text {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Question time limit badge */
.question-item-time {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    background-color: #e8e8e8;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ==================== Active Question Area (Right Panel) ==================== */

.active-question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Drop Zone - Enhanced for desktop drag-and-drop */
.drop-zone {
    flex: 1;
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.drop-zone:hover {
    border-color: #b0b0b0;
    background-color: #f5f5f5;
}

/* Drag over state - visual feedback */
.drop-zone.drag-over {
    border-color: #4a90d9;
    border-style: solid;
    background-color: rgba(74, 144, 217, 0.08);
    box-shadow: inset 0 0 20px rgba(74, 144, 217, 0.1);
    transform: scale(1.01);
}

.drop-zone.drag-over .drop-zone-text {
    color: #4a90d9;
}

.drop-zone.drag-over .drop-zone-icon {
    transform: scale(1.2);
    color: #4a90d9;
}

.drop-zone-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.drop-zone-text {
    color: #888;
    font-size: 18px;
    text-align: center;
    transition: color 0.3s ease;
}

.drop-zone-hint {
    color: #aaa;
    font-size: 14px;
    margin-top: 8px;
}

/* ==================== Timer Display - Desktop Optimized ==================== */
/* Requirements: 8.1 - Display countdown timer on all connected devices */

.timer {
    font-size: 72px;
    font-weight: 700;
    text-align: center;
    padding: 40px 48px;
    border-radius: 16px;
    background-color: #f5f5f5;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Larger timer for wide screens */
@media (min-width: 1200px) {
    .timer {
        font-size: 84px;
        padding: 48px 56px;
    }
}

@media (min-width: 1600px) {
    .timer {
        font-size: 96px;
        padding: 56px 64px;
    }
}

.timer.warning {
    background-color: #fff3e0;
    color: #e65100;
    box-shadow: inset 0 2px 4px rgba(230, 81, 0, 0.1);
}

.timer.critical {
    background-color: #ffebee;
    color: #c62828;
    animation: pulse 1s ease-in-out infinite;
    box-shadow: inset 0 2px 4px rgba(198, 40, 40, 0.1);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

/* Timer controls container */
.timer-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.timer-controls .btn {
    min-width: 140px;
}

/* Timer extension button states */
.btn-extend-time {
    background-color: #ff9800;
    color: white;
}

.btn-extend-time:hover:not(:disabled) {
    background-color: #f57c00;
}

.btn-extend-time:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* ==================== Question Display - Desktop Optimized ==================== */

.question-container {
    margin-bottom: 40px;
}

.question-text {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 32px;
    line-height: 1.5;
    color: #222;
}

@media (min-width: 1200px) {
    .question-text {
        font-size: 32px;
        margin-bottom: 40px;
    }
}

/* ==================== Answer Options - Desktop Optimized ==================== */

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-option:hover {
    background-color: #f0f2f5;
    border-color: #d0d0d0;
    transform: translateX(4px);
}

.answer-option.selected {
    background-color: #e3f2fd;
    border-color: #4a90d9;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.2);
}

.answer-option.correct {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.answer-option.incorrect {
    background-color: #ffebee;
    border-color: #f44336;
}

.answer-option input[type="radio"] {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    accent-color: #4a90d9;
    cursor: pointer;
}

.answer-option-label {
    font-size: 17px;
    color: #333;
    flex: 1;
}

/* Answer option letter indicator (A, B, C, D) */
.answer-option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #e0e0e0;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-right: 16px;
    flex-shrink: 0;
}

.answer-option.selected .answer-option-letter {
    background-color: #4a90d9;
    color: white;
}

/* ==================== Yes/No Buttons - Desktop Optimized ==================== */

.yes-no-container {
    display: flex;
    gap: 24px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.yes-no-container .btn {
    min-width: 180px;
    min-height: 72px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px;
}

.yes-no-container .btn-yes {
    background-color: #4caf50;
    color: white;
}

.yes-no-container .btn-yes:hover {
    background-color: #43a047;
}

.yes-no-container .btn-yes.selected {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
}

.yes-no-container .btn-no {
    background-color: #f44336;
    color: white;
}

.yes-no-container .btn-no:hover {
    background-color: #e53935;
}

.yes-no-container .btn-no.selected {
    box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.3);
}

/* ==================== Short Answer Input - Desktop Optimized ==================== */

.short-answer-input {
    width: 100%;
    max-width: 700px;
    min-height: 140px;
    padding: 20px;
    font-size: 17px;
    border: 2px solid #d0d0d0;
    border-radius: 12px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.short-answer-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.1);
}

.short-answer-input::placeholder {
    color: #aaa;
}

/* Lesson Join Screen */
.join-screen {
    max-width: 450px;
    margin: 60px auto;
}

.join-screen .logo {
    text-align: center;
    margin-bottom: 40px;
}

.join-screen .logo h1 {
    font-size: 36px;
    color: #4a90d9;
}

/* QR Code Display */
.qr-code-container {
    text-align: center;
    padding: 32px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qr-code-container img {
    max-width: 250px;
    margin-bottom: 16px;
}

/* QR Scanner Container (for mobile web on desktop viewport) */
.qr-scanner-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 24px;
    aspect-ratio: 1;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.qr-scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text Muted */
.text-muted {
    color: #888;
    font-size: 14px;
}

.lesson-number-display {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    letter-spacing: 4px;
}

/* Student List */
.student-list {
    max-height: 300px;
    overflow-y: auto;
}

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

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

.student-name {
    font-weight: 500;
}

.student-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
}

.student-status.connected {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.student-status.disconnected {
    background-color: #ffebee;
    color: #c62828;
}

/* ==================== Summary Table - Desktop Optimized ==================== */
/* Requirements: 11.1 - Summary with per-student performance data */

.summary-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.summary-table th,
.summary-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.summary-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #444;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.summary-table tbody tr {
    transition: background-color 0.15s ease;
}

.summary-table tbody tr:hover {
    background-color: #f8f9fa;
}

.summary-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths for summary table */
.summary-table th:nth-child(1),
.summary-table td:nth-child(1) {
    width: 25%;
    min-width: 150px;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2) {
    width: 25%;
    min-width: 180px;
}

/* Numeric columns - right aligned */
.summary-table th:nth-child(n+3),
.summary-table td:nth-child(n+3) {
    text-align: center;
    width: 12%;
    min-width: 80px;
}

/* Status indicators in table */
.summary-table .status-correct {
    color: #4caf50;
    font-weight: 600;
}

.summary-table .status-incorrect {
    color: #f44336;
    font-weight: 600;
}

.summary-table .status-unanswered {
    color: #ff9800;
    font-weight: 600;
}

/* Score badge in table */
.score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 13px;
}

.score-badge.high {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.score-badge.medium {
    background-color: #fff3e0;
    color: #e65100;
}

.score-badge.low {
    background-color: #ffebee;
    color: #c62828;
}

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

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

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}


/* Lesson Creation Styles */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mode-selection .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 80px;
}

.mode-description {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 6px;
}

/* Student Upload Tabs */
.student-upload-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-tab {
    flex: 1;
    min-height: 40px;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-tab.active {
    background-color: #4a90d9;
    color: white;
}

.upload-panel {
    padding: 16px 0;
}

.form-hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

/* Student Entry Row */
.student-entry-row {
    margin-bottom: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.student-entry-fields {
    display: flex;
    gap: 12px;
    align-items: center;
}

.student-entry-fields .form-input {
    flex: 1;
    min-height: 40px;
}

.student-entry-fields .btn-sm {
    min-height: 40px;
    min-width: 40px;
    padding: 8px;
}

/* Student Preview */
.student-preview-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
}

.student-preview-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.student-preview-item:last-child {
    border-bottom: none;
}

/* Warning Text */
.text-warning {
    color: #e65100;
    font-size: 14px;
}


/* ==================== Modal Dialogs - Desktop Optimized ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 32px;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease-out;
}

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

/* Larger modal for wide screens */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 650px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    border-radius: 8px;
}

.btn-close:hover {
    color: #333;
    background-color: #f0f0f0;
    transform: scale(1.1);
}

#question-form {
    padding: 28px;
}

.question-textarea {
    min-height: 120px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}

.modal-footer .btn {
    flex: 1;
    min-height: 48px;
}

/* Multiple Choice Option Styles */
.mc-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mc-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}

.mc-option-input {
    flex: 1;
}

.mc-option-row .btn-sm {
    min-height: 40px;
    min-width: 40px;
    padding: 8px;
    flex-shrink: 0;
}

/* Yes/No Selection Styles */
.yes-no-selection {
    display: flex;
    gap: 20px;
}

.yes-no-selection .answer-option {
    flex: 1;
    justify-content: center;
    min-height: 50px;
}

.yes-no-selection .answer-option input[type="radio"] {
    margin-right: 10px;
}


/* Summary Preview Styles */
.summary-preview {
    padding: 16px 0;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-value.stat-correct {
    color: #4caf50;
}

.stat-value.stat-incorrect {
    color: #f44336;
}

.stat-value.stat-unanswered {
    color: #ff9800;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Accuracy Bar */
.summary-accuracy {
    text-align: center;
}

.accuracy-bar {
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background-color: #4caf50;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.accuracy-text {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
}

/* Top Students Preview */
.top-students {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.top-students h4 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.mb-8 {
    margin-bottom: 8px;
}

/* Summary Warning */
.summary-warning {
    padding: 12px 16px;
    background-color: #fff3e0;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
}

/* Lesson List Styles */
.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.lesson-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.lesson-list-item:hover {
    background-color: #f0f2f5;
    border-color: #4a90d9;
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lesson-number-badge {
    font-size: 16px;
    font-weight: 700;
    color: #4a90d9;
    background-color: #e3f2fd;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
}

.lesson-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lesson-status {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}

.lesson-status.status-draft {
    background-color: #e0e0e0;
    color: #666;
}

.lesson-status.status-ready {
    background-color: #e3f2fd;
    color: #1976d2;
}

.lesson-status.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.lesson-status.status-ended {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.lesson-date {
    font-size: 13px;
    color: #666;
}

.lesson-mode {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

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

.btn-sm {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 13px;
}

.lesson-list-header {
    align-items: center;
}


/* ==================== Desktop-Specific Hover States ==================== */

/* Enhanced button hover states for desktop */
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:hover:not(:disabled) {
    background-color: #3a7bc8;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #d5d5d5;
}

.btn-success:hover:not(:disabled) {
    background-color: #43a047;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background-color: #e53935;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Card hover effects */
.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Form input focus states - enhanced for desktop */
.form-input:hover:not(:focus) {
    border-color: #b0b0b0;
}

.form-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.12);
}

/* ==================== Larger Display Optimizations ==================== */

/* Wide screen container adjustments */
@media (min-width: 1400px) {
    #main-content {
        max-width: 1600px;
        padding: 32px 40px;
    }
}

@media (min-width: 1800px) {
    #main-content {
        max-width: 1800px;
        padding: 40px 48px;
    }
}

/* Join screen - centered and appropriately sized for large screens */
.join-screen {
    max-width: 480px;
    margin: 80px auto;
}

@media (min-width: 1200px) {
    .join-screen {
        max-width: 520px;
        margin: 100px auto;
    }
}

/* QR Code Display - larger for desktop projection */
.qr-code-container {
    text-align: center;
    padding: 48px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.qr-code-container img {
    max-width: 320px;
    margin-bottom: 24px;
    border-radius: 8px;
}

@media (min-width: 1200px) {
    .qr-code-container img {
        max-width: 380px;
    }
}

.lesson-number-display {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    letter-spacing: 6px;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1200px) {
    .lesson-number-display {
        font-size: 52px;
        letter-spacing: 8px;
    }
}

/* ==================== Student List - Desktop Optimized ==================== */

.student-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.15s ease;
}

.student-item:hover {
    background-color: #f8f9fa;
}

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

.student-name {
    font-weight: 500;
    font-size: 15px;
}

.student-email {
    color: #888;
    font-size: 13px;
    margin-left: 12px;
}

.student-status {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 16px;
    font-weight: 500;
}

.student-status.connected {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.student-status.disconnected {
    background-color: #ffebee;
    color: #c62828;
}

.student-status.answering {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* ==================== Lesson List - Desktop Optimized ==================== */

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 600px;
    overflow-y: auto;
}

.lesson-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background-color: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.lesson-list-item:hover {
    background-color: #f0f4f8;
    border-color: #4a90d9;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.1);
    transform: translateX(4px);
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lesson-number-badge {
    font-size: 18px;
    font-weight: 700;
    color: #4a90d9;
    background-color: #e3f2fd;
    padding: 10px 16px;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.lesson-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lesson-status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-date {
    font-size: 14px;
    color: #666;
}

.lesson-mode {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-actions {
    display: flex;
    gap: 12px;
}

/* ==================== Summary Preview - Desktop Optimized ==================== */

.summary-preview {
    padding: 20px 0;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 24px;
    padding: 28px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1200px) {
    .stat-value {
        font-size: 42px;
    }
}

.stat-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* Accuracy Bar - Desktop */
.summary-accuracy {
    text-align: center;
    margin-top: 24px;
}

.accuracy-bar {
    height: 16px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    border-radius: 8px;
    transition: width 0.5s ease;
}

.accuracy-text {
    font-size: 16px;
    color: #555;
    margin-top: 12px;
    font-weight: 500;
}

/* ==================== Active Question Display (Lecturer View) ==================== */

.active-question-display {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.active-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.active-question-type {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.active-question-stats {
    display: flex;
    gap: 24px;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.stat-mini-value {
    font-weight: 700;
    color: #333;
}

/* Response progress bar */
.response-progress {
    margin-top: 24px;
}

.response-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.response-progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.response-progress-fill {
    height: 100%;
    background-color: #4a90d9;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ==================== Keyboard Shortcuts Hint ==================== */

.keyboard-hint {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.keyboard-hint.visible {
    opacity: 1;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    margin: 0 4px;
}

/* ==================== Print Styles for Summary ==================== */

@media print {
    .connection-status,
    .btn,
    .ngager-left-panel,
    .keyboard-hint {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .ngager-screen {
        display: block;
    }
    
    .ngager-right-panel {
        box-shadow: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .summary-table {
        font-size: 12px;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 8px 12px;
    }
}

/* ==================== Focus Visible States (Accessibility) ==================== */

.btn:focus-visible,
.form-input:focus-visible,
.answer-option:focus-visible,
.question-item:focus-visible {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

/* ==================== Reduced Motion Preference ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .question-item:hover,
    .lesson-list-item:hover,
    .btn:hover {
        transform: none;
    }
}


/* ==================== Landing Page Styles ==================== */

.landing-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

.landing-header {
    text-align: center;
    margin-bottom: 48px;
}

.landing-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 12px;
}

.landing-subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 400;
}

.landing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.landing-card {
    background-color: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.landing-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #4a90d9;
}

.landing-card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.landing-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.landing-card p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.landing-card-link {
    margin-top: 12px;
    font-size: 14px;
}

.landing-card-link a {
    color: #4a90d9;
    text-decoration: none;
}

.landing-card-link a:hover {
    text-decoration: underline;
}

.landing-divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}

.landing-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: #e0e0e0;
}

.landing-divider span {
    position: relative;
    background-color: #ffffff;
    padding: 0 20px;
    color: #888;
    font-size: 14px;
}

.landing-quick-start {
    display: flex;
    justify-content: center;
}

.landing-card-wide {
    max-width: 500px;
    width: 100%;
}

/* ==================== Dashboard Styles ==================== */

.dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.dashboard-logo {
    max-width: 180px;
    height: auto;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
}

.dashboard-content h2 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.dashboard-content > p {
    font-size: 16px;
    color: #666;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.dashboard-card {
    background-color: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid transparent;
}

.dashboard-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #4a90d9;
}

.dashboard-card-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.dashboard-card p {
    font-size: 14px;
    color: #666;
}

/* ==================== End Lesson Bar ==================== */

.end-lesson-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.lesson-info-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}


/* ==================== Site Header (top bar) ==================== */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
}

.site-header-logo img {
    max-height: 44px;
    width: auto;
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav-link {
    color: #444;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-nav-link:hover {
    color: #4a90d9;
}

/* ==================== Site Footer ==================== */

.site-footer {
    margin-top: 80px;
    border-top: 1px solid #e8e8e8;
    background-color: #fafafa;
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.site-footer-social {
    display: flex;
    gap: 18px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e8eef5;
    color: #4a90d9;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background-color: #4a90d9;
    color: #fff;
    transform: translateY(-2px);
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.site-footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.site-footer-links a:hover {
    color: #4a90d9;
    text-decoration: underline;
}

.site-footer-copyright {
    color: #999;
    font-size: 13px;
}

/* Landing page no longer needs top padding since header handles it */
.landing-page {
    padding-top: 32px;
}


/* ==================== Subscription Page ==================== */

.subscription-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
}

.subscription-title {
    font-size: 30px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.subscription-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.plan-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.plan-card {
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    padding: 32px 24px;
    transition: all 0.2s ease;
    position: relative;
}

.plan-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.plan-card.selected {
    border-color: #4a90d9;
    box-shadow: 0 8px 24px rgba(74,144,217,0.15);
}

.plan-card-featured {
    border-color: #4a90d9;
}

.plan-badge {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a90d9;
    margin-bottom: 16px;
}

.plan-price {
    margin-bottom: 8px;
}

.plan-amount {
    font-size: 40px;
    font-weight: 700;
    color: #333;
}

.plan-period {
    font-size: 16px;
    color: #888;
}

.plan-original {
    font-size: 16px;
    color: #999;
    min-height: 22px;
    margin-bottom: 8px;
}

.plan-save {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.plan-select-btn {
    margin-top: 16px;
}

.coupon-section {
    max-width: 460px;
    margin: 0 auto 32px;
    text-align: left;
}

.coupon-row {
    display: flex;
    gap: 12px;
}

.coupon-row .form-input {
    flex: 1;
    margin-bottom: 0;
}

.coupon-msg {
    margin-top: 10px;
    font-size: 14px;
}

.coupon-success { color: #2e7d32; }
.coupon-error { color: #c62828; }

.checkout-area {
    max-width: 460px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    background: #fafafa;
}

.checkout-summary {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
}

.checkout-note {
    font-size: 13px;
    color: #888;
    margin-top: 12px;
}
