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

:root {
    --bg-gradient-start: #0a0a0a;
    --bg-gradient-mid: #1a1a1a;
    --bg-gradient-end: #2a2a2a;
    --card-bg: #ffffff;
    --card-border: #000000;
    --text-primary: #000000;
    --text-secondary: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --hover-bg: #f8f8f8;
}

body.dark-mode {
    --bg-gradient-start: #0a0a0a;
    --bg-gradient-mid: #1a1a2a;
    --bg-gradient-end: #0f0f1f;
    --card-bg: #1e1e2e;
    --card-border: #3a3a4a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --shadow-color: rgba(0, 0, 0, 0.8);
    --shadow-light: rgba(0, 0, 0, 0.6);
    --hover-bg: #2a2a3a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Když je aktivní results-screen, body nemá padding pro lepší centrování */
body:has(#results-screen.active) {
    padding: 0;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Když je aktivní results-screen, container se chová jako flexbox pro centrování */
.container:has(#results-screen.active) {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
    width: 100%;
}

.screen.active {
    display: block;
    width: 100%;
}

#results-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: #1a1a1a;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#results-screen.active {
    display: flex !important;
}

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

/* Úvodní obrazovka */
.welcome-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow:
        0 20px 60px var(--shadow-color),
        0 10px 30px var(--shadow-light),
        inset 0 -2px 10px rgba(0, 0, 0, 0.05);
    border: 3px solid var(--card-border);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    transition: all 0.3s ease;
}


@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.welcome-card h1 {
    font-size: 2em;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
    font-weight: 800;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.options {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.1em;
    color: var(--text-primary);
}

.options input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 25px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--shadow-light);
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
}

.dark-mode-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.dark-mode-toggle .icon {
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover .icon {
    transform: scale(1.05);
}

.dark-mode-toggle .moon {
    display: none;
}

body.dark-mode .dark-mode-toggle .sun {
    display: none;
}

body.dark-mode .dark-mode-toggle .moon {
    display: inline;
}

/* Tlačítka */
.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: 3px solid #000000;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    border: 3px solid #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background: #f8f8f8;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-success {
    background: #000000;
    color: #ffffff;
    border: 3px solid #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-success:hover {
    background: #1a1a1a;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-success:active {
    transform: translateY(-1px) scale(0.98);
}

/* Kvíz obrazovka */
.quiz-header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 10px 15px;
    margin-bottom: 15px;
    box-shadow:
        0 8px 25px var(--shadow-light),
        0 3px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--card-border);
    animation: slideDown 0.5s ease-out;
    transition: all 0.3s ease;
}

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

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--hover-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--card-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #000000 0%, #333333 50%, #000000 100%);
    background-size: 200% 100%;
    animation: progressShine 2s linear infinite;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes progressShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-primary);
    font-weight: 600;
    gap: 10px;
}

.score {
    color: var(--text-primary);
}

.question-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow:
        0 10px 40px var(--shadow-light),
        0 5px 20px rgba(0, 0, 0, 0.2),
        inset 0 -2px 10px rgba(0, 0, 0, 0.05);
    border: 3px solid var(--card-border);
    animation: fadeIn 0.5s ease-out;
    position: relative;
    transition: all 0.3s ease;
}

.question-card h2 {
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    padding: 20px;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    font-size: 1.1em;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.answer-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: #000000;
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.answer-btn:hover {
    background: var(--hover-bg);
    border-color: var(--card-border);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.answer-btn:hover::before {
    height: 60%;
}

.answer-btn.selected {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateX(8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.answer-btn.selected::before {
    height: 60%;
    background: #ffffff;
}

.answer-btn.correct {
    background: #28a745;
    color: #ffffff;
    border-color: #28a745;
    border-width: 4px;
    font-weight: bold;
    animation: correctPulse 0.5s ease;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.answer-btn.incorrect {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
    border-width: 4px;
    animation: shake 0.5s ease;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* Styly pro více odpovědí (checkboxy) */
.answer-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.answer-item:hover {
    background: var(--hover-bg);
    border-color: var(--card-border);
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 6px 20px var(--shadow-light);
}

.answer-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.answer-label {
    flex: 1;
    cursor: pointer;
    font-size: 1.1em;
    color: var(--text-primary);
    line-height: 1.5;
}

.answer-item:has(.answer-checkbox:checked) {
    background: #000000;
    border-color: #000000;
}

.answer-item:has(.answer-checkbox:checked) .answer-label {
    color: #ffffff;
}

/* Špatná odpověď - červené pozadí */
.answer-item:has(.answer-label.incorrect) {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    border-width: 3px !important;
}

.answer-item:has(.answer-label.incorrect) .answer-label {
    color: #ffffff !important;
}

.answer-label.correct {
    color: #28a745;
    font-weight: bold;
}

/* Správně vybraná odpověď - zelené pozadí */
.answer-item:has(.answer-label.correct-selected) {
    background: #28a745 !important;
    border-color: #28a745 !important;
    border-width: 3px !important;
}

.answer-item:has(.answer-label.correct-selected) .answer-label {
    color: #ffffff !important;
    font-weight: bold;
}

.answer-label.incorrect {
    color: #ffffff !important;
    font-weight: bold;
    background-color: #dc3545;
    padding: 5px 10px;
    border-radius: 5px;
}

.answer-label.correct-missing {
    color: #28a745;
    font-weight: bold;
    text-decoration: underline;
    border-bottom: 2px solid #28a745;
}

.quiz-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow:
        0 8px 25px var(--shadow-light),
        0 3px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--card-border);
    animation: slideUp 0.5s ease-out 0.1s both;
    transition: all 0.3s ease;
}

.quiz-controls-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.quiz-controls-top #prev-btn {
    justify-self: start;
}

.quiz-controls-top #navigate-btn {
    justify-self: center;
}

.quiz-controls-top #next-btn,
.quiz-controls-top #finish-btn {
    justify-self: end;
}

.quiz-controls-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Navigační modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 3px solid var(--card-border);
    box-shadow:
        0 20px 60px var(--shadow-color),
        0 10px 30px var(--shadow-light);
    animation: modalSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.3s ease;
}

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

.modal-body {
    color: var(--text-primary);
}

.question-ranges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.range-btn {
    padding: 12px 15px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
}

.range-btn:hover {
    background: #000000;
    color: #ffffff;
}

.range-btn.active {
    background: #000000;
    color: #ffffff;
    font-weight: bold;
}

/* Výsledky - pouze na quiz.html */
#results-screen .results-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow:
        0 30px 80px var(--shadow-color),
        0 15px 40px var(--shadow-light),
        inset 0 -2px 10px rgba(0, 0, 0, 0.05);
    border: 3px solid var(--card-border);
    width: 100%;
    max-width: 800px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    animation: resultsPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}


@keyframes resultsPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.results-card h1 {
    font-size: 2.5em;
    color: var(--text-primary);
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 800;
}

#results-screen .score-display {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.score-circle {
    font-size: 4em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
    animation: countUp 0.8s ease-out;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#results-screen .score-label {
    font-size: 0.5em;
    color: var(--text-secondary);
}

#results-screen .percentage {
    font-size: 2em;
    color: var(--text-primary);
    font-weight: bold;
}

#results-screen .stats {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

#results-screen .stat-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#results-screen .stat-label {
    font-size: 1.1em;
    color: var(--text-secondary);
}

#results-screen .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
}

#results-screen .stat-value.correct {
    color: var(--text-primary);
}

#results-screen .stat-value.incorrect {
    color: var(--text-primary);
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
    width: 100%;
}

/* Responzivní design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .welcome-card, #results-screen .results-card {
        padding: 20px 15px;
    }

    .welcome-card h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .question-card {
        padding: 15px;
        margin-bottom: 10px;
    }

    .question-card h2 {
        font-size: 1em;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .answers {
        gap: 10px;
    }

    .answer-btn {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .answer-item {
        padding: 10px;
        margin-bottom: 8px;
    }

    .answer-label {
        font-size: 0.95em;
    }

    .quiz-header {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    .quiz-info {
        flex-direction: row;
        gap: 5px;
        text-align: center;
        font-size: 0.75em;
        justify-content: space-between;
    }
    
    .quiz-info .score {
        font-size: 0.9em;
    }

    .quiz-controls {
        padding: 15px;
        gap: 10px;
    }

    .quiz-controls-top {
        flex-direction: column;
        gap: 10px;
    }

    .quiz-controls-top button {
        width: 100%;
    }

    .quiz-controls-bottom {
        margin-top: 10px;
    }

    .quiz-controls-bottom button {
        width: 100%;
    }

    #results-screen .results-actions {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    #results-screen .results-actions .btn {
        width: 100%;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9em;
    }

    .score-circle {
        font-size: 2.5em;
    }

    .progress-bar {
        height: 8px;
        margin-bottom: 10px;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    .question-ranges {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .range-btn {
        padding: 10px 8px;
        font-size: 0.8em;
    }
}

/* Extra malé obrazovky */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .welcome-card, #results-screen .results-card {
        padding: 15px 10px;
        border-radius: 10px;
    }

    .question-card {
        padding: 12px;
    }

    .question-card h2 {
        font-size: 0.9em;
        margin-bottom: 12px;
    }

    .answer-btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .answer-item {
        padding: 8px;
    }

    .answer-label {
        font-size: 0.85em;
    }

    .quiz-header {
        padding: 12px;
    }

    .quiz-controls {
        padding: 12px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .modal-content {
        padding: 15px;
    }

    .question-ranges {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }

    .range-btn {
        padding: 8px 6px;
        font-size: 0.75em;
    }
}
