* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    line-height: 1.5;
}

#progress-bar {
    background: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

#progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

#question-counter {
    text-align: right;
    color: #666;
    margin-bottom: 20px;
    font-weight: bold;
}

#question-image {
    text-align: center;
    margin: 20px 0;
}

#question-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    max-height: 500px;
}

#answers-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.answer-option {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-option > div:first-child {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 15px;
}

.answer-option:hover:not(.correct):not(.incorrect) {
    background: #e8e8e8;
    border-color: #667eea;
    transform: translateX(5px);
}

.answer-option input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.answer-option label {
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
}

.answer-option.selected {
    background: #e8e8ff;
    border-color: #667eea;
}

.answer-option.correct {
    background: #d4edda;
    border-color: #28a745;
}

.answer-option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.answer-option.correct-answer {
    border: 3px solid #28a745;
    background: #e8f5e9;
    position: relative;
}

.answer-option.correct-answer::before {
    content: '✓ Správná odpověď';
    position: absolute;
    top: -12px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: bold;
}

.answer-explanation {
    margin-top: 5px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #667eea;
    border-radius: 5px;
    font-size: 0.9em;
    color: #333;
    line-height: 1.5;
    display: none;
    word-wrap: break-word;
}

.answer-explanation.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin: 20px auto 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.button-container button {
    margin: 0;
    flex: 1;
    max-width: 200px;
}

#prev-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

#results-container {
    text-align: center;
}

#score-display {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

#percentage-display {
    font-size: 1.5em;
    color: #666;
    margin: 20px 0;
}

#details-container {
    margin: 30px 0;
    text-align: left;
}

#details-container h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.question-detail {
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.3s ease;
}

.question-header:hover {
    background: #e9ecef;
}

.question-header.open {
    background: #667eea;
    color: white;
}

.question-header.open .question-score {
    color: white !important;
}

.question-number {
    font-weight: bold;
    font-size: 1.1em;
}

.question-score {
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.95em;
}

.question-score.perfect {
    background: #d4edda;
    color: #155724;
}

.question-score.good {
    background: #fff3cd;
    color: #856404;
}

.question-score.bad {
    background: #f8d7da;
    color: #721c24;
}

.question-content {
    display: none;
    padding: 20px;
    background: white;
    border-top: 2px solid #e0e0e0;
}

.question-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.detail-question-text {
    font-size: 1.05em;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.5;
    color: #333;
}

.detail-question-image {
    text-align: center;
    margin: 15px 0;
}

.detail-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    object-fit: contain;
}

.detail-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.detail-answer {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
}

.detail-answer.correct-answer {
    border-color: #28a745;
    background: #e8f5e9;
}

.detail-answer.user-correct {
    border-color: #28a745;
    background: #d4edda;
    border-width: 3px;
}

.detail-answer.user-incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    border-width: 3px;
}

.detail-answer-text {
    font-size: 0.95em;
    margin-bottom: 8px;
    line-height: 1.5;
}

.detail-answer-text strong {
    margin-right: 5px;
    font-size: 1.1em;
}

.detail-answer-explanation {
    font-size: 0.85em;
    color: #555;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #667eea;
    border-radius: 4px;
    line-height: 1.4;
    margin-top: 8px;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px 15px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1em;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    #question-counter {
        font-size: 0.9em;
    }
    
    #question-image img {
        border-radius: 8px;
        max-height: 300px;
        object-fit: contain;
    }
    
    #answers-container {
        gap: 12px;
        margin: 20px 0;
    }
    
    .answer-option {
        padding: 12px 15px;
    }
    
    .answer-option > div:first-child {
        gap: 10px;
    }
    
    .answer-option input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .answer-option label {
        font-size: 0.95em;
    }
    
    .answer-explanation {
        font-size: 0.85em;
        padding: 10px 12px;
    }
    
    .answer-option.correct-answer::before {
        font-size: 0.7em;
        padding: 2px 8px;
        top: -10px;
        right: 5px;
    }
    
    .button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-container button {
        max-width: 100%;
        width: 100%;
        padding: 12px 20px;
        font-size: 1em;
    }

    button {
        padding: 12px 25px;
        font-size: 1em;
        width: 100%;
        margin-top: 15px;
    }
    
    #score-display {
        font-size: 2em;
    }
    
    #percentage-display {
        font-size: 1.2em;
    }
    
    #details-container h3 {
        font-size: 1.1em;
    }
    
    .question-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .question-number {
        font-size: 1em;
    }
    
    .question-score {
        font-size: 0.85em;
        padding: 4px 12px;
    }
    
    .question-content {
        padding: 15px;
    }
    
    .detail-question-text {
        font-size: 0.95em;
    }
    
    .detail-answer {
        padding: 10px 12px;
    }
    
    .detail-answer-text {
        font-size: 0.9em;
    }
    
    .detail-answer-explanation {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

/* Extra malé mobily */
@media (max-width: 400px) {
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    h2 {
        font-size: 0.95em;
    }
    
    .answer-option {
        padding: 10px 12px;
    }
    
    .answer-option label {
        font-size: 0.9em;
    }
    
    .answer-explanation {
        font-size: 0.8em;
        padding: 8px 10px;
    }
    
    .button-container button {
        padding: 10px 15px;
        font-size: 0.95em;
    }
    
    .question-header {
        padding: 10px 12px;
    }
    
    .detail-answer {
        padding: 8px 10px;
    }
}