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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo {
    height: 60px;
    width: auto;
}

.header-title h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.header-title p {
    font-size: 0.95rem;
    opacity: 0.9;
}

#user-display {
    margin-top: 1rem;
    font-size: 0.95rem;
    opacity: 0.85;
}

main {
    flex: 1;
    max-width: 700px;
    margin: 2rem auto;
    width: 100%;
    padding: 0 1rem;
}

.screen {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.screen h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.screen p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

#sets-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.big-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.big-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.big-btn.primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.big-btn.secondary {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
}

.back-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateX(-3px);
}

#question-container {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
    border-left: 4px solid #1976d2;
}

#answers-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    background: #fff3e0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #f57c00;
}

#answers-container label {
    display: block;
    padding: 0.8rem;
    background: #f0f4f8;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

#answers-container label:hover {
    background: #e8f4f8;
    border-color: #3498db;
}

#answers-container input[type="radio"] {
    margin-right: 0.6rem;
    cursor: pointer;
}

#answers-container label:has(input:checked) {
    background: #d4edff;
    border-color: #3498db;
    font-weight: 600;
}

#answers-container label.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

#answers-container label.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

#next-btn {
    width: 100%;
    padding: 1.2rem !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffa726 0%, #f57c00 100%) !important;
    color: #fff !important;
}

#result-text {
    background: #f0f8ff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

table th, table td {
    border: 1px solid #e0e0e0;
    padding: 1rem;
    text-align: left;
}

table th {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-weight: 600;
}

table tr:nth-child(even) {
    background: #f9f9f9;
}

table tr:hover {
    background: #f0f8ff;
}

.hidden {
    display: none;
}

/* Help ikona */
.help-icon {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 100;
}

.help-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Skryt ikonu když nejsme na login stránce */
body > .help-icon {
    display: none;
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.help-modal.hidden {
    display: none;
}

.help-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
}

.help-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.help-modal-close:hover {
    color: #333;
}

.help-modal-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

/* Taby */
.help-tabs {
    margin-bottom: 1.5rem;
}

#help-tabs-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.help-tab-btn {
    padding: 0.8rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.help-tab-btn:hover {
    color: #9c27b0;
}

.help-tab-btn.active {
    color: #9c27b0;
    border-bottom-color: #9c27b0;
}

#help-tabs-content {
    min-height: 300px;
}

.help-tab-pane {
    display: none;
}

.help-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Leaderboard tabs */
.leaderboard-tabs {
    margin-bottom: 1.5rem;
}

#leaderboard-tabs-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.leaderboard-tab-btn {
    padding: 0.75rem 1.5rem;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.leaderboard-tab-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.leaderboard-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

#leaderboard-tabs-content {
    min-height: 300px;
}

.leaderboard-tab-pane {
    display: none;
    overflow-x: auto;
}

.leaderboard-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

.help-question {
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #9c27b0;
}

.help-question-text {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.help-answer {
    padding: 0.6rem 0.8rem;
    margin: 0.3rem 0;
    background: white;
    border-left: 3px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.help-answer.correct {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .help-icon {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }

    .help-modal-content {
        padding: 1.5rem;
        max-height: 90vh;
    }

    #help-tabs-buttons {
        gap: 0.25rem;
    }

    .help-tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tabulka s chybami */
#mistakes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#mistakes-table th,
#mistakes-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#mistakes-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#mistakes-table td:nth-child(3) {
    font-weight: 600;
    color: #dc3545;
}

@media (max-width: 600px) {
    .header-content {
        gap: 1rem;
    }

    .logo {
        height: 50px;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .screen {
        padding: 1.5rem;
    }

    main {
        margin: 1rem auto;
    }
}