/* QUIZ MODULE STYLES */
/* Based on original quiz design with gradient background */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

:root {
    /* Quiz-specific colors */
    --quiz-primary: #667eea;
    --quiz-secondary: #764ba2;
    --quiz-success: #4CAF50;
    --quiz-danger: #F44336;
    --quiz-warning: #FF9800;
    --quiz-info: #00BCD4;
    
    /* Answer colors */
    --answer-correct: #4CAF50;
    --answer-wrong: #F44336;
    --answer-neutral: #E0E0E0;
    --answer-hover: #BBDEFB;
    
    /* Progress colors */
    --progress-bg: #E0E0E0;
    --progress-fill: var(--quiz-primary);
}

/* Header Styling - based on original menu-bar */
.header {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    color: #90EE90;
    font-weight: bold;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(144, 238, 144, 0.3);
}

.user-info .btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-info .btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

.user-info .btn-secondary {
    background-color: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.4);
}

.user-info .btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 100, 100, 0.4);
}

/* Breadcrumbs - styled as status bar */
.breadcrumbs {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: white;
}

.status-left {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    flex-wrap: wrap;
}

.status-right {
    display: flex;
    align-items: center;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.server-status.online {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.server-status.offline {
    background-color: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
}

.server-status.checking {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
}

.status-indicator {
    font-size: 12px;
    animation: pulse 2s infinite;
}

.status-text {
    font-weight: bold;
    font-size: 12px;
    color: white;
}

.status-mode {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.breadcrumbs a {
    color: #ffd700;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.breadcrumbs a:hover {
    color: #ffed4a;
    text-shadow: 0 0 5px rgba(255, 237, 74, 0.5);
}

/* Navigation links container */
#navigation-links-container a {
    color: #ffd700;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

#navigation-links-container a:hover {
    color: #ffed4a;
    text-shadow: 0 0 5px rgba(255, 237, 74, 0.5);
}

.separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.6);
}

.current {
    font-weight: 500;
    color: white;
}

/* Main Content - full width like original */
.main-content {
    padding: 20px;
    min-height: calc(100vh - 120px);
}

/* Navigation Controls - based on original nav-controls */
.nav-controls {
    background-color: rgba(40, 53, 147, 0.8);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-controls .form-group {
    margin: 10px 0;
    min-width: 200px;
}

.nav-controls .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.table-select, .nav-controls select {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
}

.table-select option, .nav-controls select option {
    background-color: #333;
    color: white;
}

.nav-controls button, .nav-button {
    background-color: rgba(40, 53, 147, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-controls button:hover:not(:disabled), .nav-button:hover:not(:disabled) {
    background-color: rgba(40, 53, 147, 1);
    transform: translateY(-2px);
}

.nav-controls button:disabled, .nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start-quiz-button {
    background-color: rgba(76, 175, 80, 0.8);
    border-color: rgba(76, 175, 80, 1);
}

.start-quiz-button:hover:not(:disabled) {
    background-color: rgba(76, 175, 80, 1);
}

.end-test-button {
    background-color: rgba(244, 67, 54, 0.8);
    border-color: rgba(244, 67, 54, 1);
}

.end-test-button:hover:not(:disabled) {
    background-color: rgba(244, 67, 54, 1);
}

.hint-checkbox {
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hint-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* Question Section - based on original design */
.quiz-interface, .question-section {
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 15px;
    padding: 25px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.progress-section, .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
}

.question-text {
    background-color: #283593;
    padding: 20px;
    border-radius: 8px;
    border: none;
    font-size: 28px;
    line-height: 1.4;
    margin-bottom: 25px;
    color: white;
    min-height: 100px;
    display: flex;
    align-items: center;
    text-align: left;
}

.question-text[disabled] {
    opacity: 0.6;
    background-color: rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 18px;
}

/* Answer Options - based on original design with ORANGE background */
.answers-section, .answer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.answer-option {
    background-color: #ff5722;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    min-height: 80px;
    border: 2px solid transparent;
}

.answer-option:hover {
    background-color: #ff7043;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
}

.answer-letter {
    font-weight: bold;
    margin-right: 15px;
    font-size: 18px;
    min-width: 25px;
}

.answer-text {
    flex: 1;
    font-size: 18px;
    line-height: 1.3;
}

/* Answer states */
.answer-option.correct {
    background-color: #4caf50;
    border-color: #2e7d32;
}

.answer-option.wrong {
    background-color: #f44336;
    border-color: #c62828;
}

.answer-option.selected {
    background-color: #2196f3;
    border-color: #1976d2;
}

.answer-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Hints and Explanations */
.correct-answer-hint, .explanation {
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: white;
}

.hidden {
    display: none;
}

/* Quiz Setup */
.quiz-setup {
    margin-bottom: 2rem;
}

.setup-card {
    background: rgba(40, 53, 147, 0.8);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.setup-card h2 {
    margin: 0 0 1.5rem 0;
    color: white;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.setup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setup-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Progress Section */
.progress-section {
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 500;
    color: white;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--progress-fill) 0%, var(--quiz-secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Card */
.question-card {
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
    background-color: rgba(40, 53, 147, 0.8);
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
}

.question-header h3 {
    margin: 0;
    color: white;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    padding: 1rem 0;
    min-height: 60px;
}

/* Hint Display */
.hint-display {
    background-color: rgba(40, 53, 147, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: white;
}

.hint-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 500;
}

/* Answer Options */
.answers-section {
    margin-bottom: 1.5rem;
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: #ff5722;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    font-size: 1rem;
    min-height: 60px;
    color: white;
}

.answer-option:hover:not(:disabled):not(.correct):not(.wrong) {
    background-color: #ff7043; /* Světlejší odstín oranžové */
    border-color: #ffffff;
    box-shadow: 
        0 4px 15px rgba(255, 87, 34, 0.4), 
        inset 0 0 20px rgba(255, 255, 255, 0.1),
        0 0 0 3px rgba(255, 112, 67, 0.3);
    transform: translateY(-2px) scale(1.02);
    animation: pulse-glow 1.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 
            0 4px 15px rgba(255, 87, 34, 0.4), 
            inset 0 0 20px rgba(255, 255, 255, 0.1),
            0 0 0 3px rgba(255, 112, 67, 0.3);
    }
    100% {
        box-shadow: 
            0 6px 20px rgba(255, 87, 34, 0.6), 
            inset 0 0 25px rgba(255, 255, 255, 0.2),
            0 0 0 5px rgba(255, 112, 67, 0.4);
    }
}

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

.answer-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--answer-neutral);
    border-radius: 50%;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.answer-text {
    flex: 1;
    line-height: 1.4;
}

/* Answer States - vyšší specificita pro přepsání hover efektů */
.answer-option.correct,
.answer-option.correct:hover {
    border-color: #ffffff !important;
    background-color: #4CAF50 !important; /* Zelená pro správnou odpověď */
    color: white !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4) !important;
    transform: none !important;
    animation: none !important;
}

.answer-option.correct .answer-letter {
    background-color: #2E7D32 !important; /* Tmavší zelená pro písmeno */
    color: white !important;
}

.answer-option.wrong,
.answer-option.wrong:hover {
    border-color: #ffffff !important;
    background-color: #F44336 !important; /* Červená pro špatnou odpověď */
    color: white !important;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4) !important;
    transform: none !important;
    animation: none !important;
}

.answer-option.wrong .answer-letter {
    background-color: #C62828 !important; /* Tmavší červená pro písmeno */
    color: white !important;
}

.answer-option.selected {
    border-color: var(--quiz-primary);
    background-color: #2196F3; /* Modrá pro vybranou (ale ještě nevyhodnocenou) */
    color: white;
}

.answer-option.selected .answer-letter {
    background-color: #1976D2;
    color: white;
}

/* Keyboard Hint */
.keyboard-hint {
    text-align: center;
    font-size: 0.9rem;
    color: white;
    padding: 1rem;
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Explanation Panel */
.explanation-panel {
    background-color: rgba(40, 53, 147, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: white;
}

.explanation-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 1rem 1.5rem;
}

.explanation-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

.explanation-content {
    padding: 1.5rem;
}

.explanation-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Results Summary */
.results-summary {
    margin-top: 2rem;
}

.results-card {
    background-color: rgba(40, 53, 147, 0.8);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.results-card h2 {
    margin: 0 0 2rem 0;
    color: white;
    font-size: 1.8rem;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--quiz-primary);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Settings Modal Enhancements */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E0E0E0;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .setup-row {
        grid-template-columns: 1fr;
    }
    
    .setup-actions {
        justify-content: center;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .question-actions {
        width: 100%;
        justify-content: center;
    }
    
    .navigation-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .answers-grid {
        gap: 0.75rem;
    }
    
    .answer-option {
        padding: 0.75rem 1rem;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .setup-card,
    .question-card,
    .progress-section,
    .results-card {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .answer-option {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
        min-height: 45px;
    }
    
    .answer-letter {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .answer-option,
    .progress-fill,
    .btn {
        transition: none;
    }
    
    .answer-option:hover:not(:disabled) {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .answer-option {
        border-width: 3px;
    }
    
    .answer-option.correct {
        border-color: #2E7D32;
        background: #C8E6C9;
    }
    
    .answer-option.wrong {
        border-color: #C62828;
        background: #FFCDD2;
    }
}

/* Print Styles */
@media print {
    .header,
    .navigation-controls,
    .setup-actions,
    .question-actions,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 1rem;
    }
    
    .question-card,
    .answers-section {
        break-inside: avoid;
    }
}
