* {
    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;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #333;
    margin-bottom: 10px;
}

header p {
    color: #666;
}

#quiz-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

/* Certification Selection */
#cert-container {
    text-align: center;
}

#cert-container h2 {
    color: #333;
    margin-bottom: 30px;
}

/* Mode Selection */
#mode-container {
    text-align: center;
}

#mode-container h2 {
    color: #333;
    margin-bottom: 10px;
}

.cert-badge {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mode-buttons {
    display: flex;
    gap: 20px;
}

.mode-btn {
    flex: 1;
    background: #f7f7f7;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mode-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.mode-icon {
    font-size: 2.5em;
}

.mode-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.mode-desc {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* Quiz Header */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#question-number, #card-number {
    color: #667eea;
    font-weight: bold;
}

#timer {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.2em;
    background: #f0ebf5;
    padding: 8px 16px;
    border-radius: 6px;
}

/* Flashcard */
.flashcard {
    perspective: 1000px;
    height: 280px;
    margin-bottom: 30px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 30px;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.flashcard-front h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.4;
}

.flip-hint {
    opacity: 0.7;
    font-size: 0.9em;
}

.flashcard-back {
    background: #f7f7f7;
    border: 2px solid #667eea;
    transform: rotateY(180deg);
}

.flashcard-back p {
    font-size: 1.15em;
    line-height: 1.6;
    color: #333;
    text-align: center;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Question Area */
#question-container, #results-container {
    text-align: center;
}

#question-text {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.3em;
    line-height: 1.5;
}

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

.answer-btn {
    background: #f7f7f7;
    border: 2px solid #ddd;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-btn:hover {
    background: #e8e8e8;
    border-color: #667eea;
}

.answer-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.answer-btn.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.answer-btn.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.answer-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.select-hint {
    color: #764ba2;
    font-weight: bold;
    font-size: 0.95em;
    margin-top: -20px;
    margin-bottom: 20px;
}

#submit-row {
    text-align: center;
    margin-bottom: 20px;
}

#submit-btn {
    padding: 12px 40px;
    font-size: 1em;
}

.answer-btn.missed {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

/* Buttons */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #5568d3;
}

.btn-primary {
    background: #764ba2;
    padding: 20px 50px;
    font-size: 1.2em;
}

.btn-primary:hover {
    background: #653a8f;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.85em;
    background: #999;
}

.btn-small:hover {
    background: #777;
}

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

.results-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Results */
#results-container h2 {
    color: #333;
    margin-bottom: 20px;
}

#score {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: bold;
}

#time-result {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    header, #quiz-container {
        padding: 20px;
    }

    .mode-buttons {
        flex-direction: column;
    }

    #question-text {
        font-size: 1.1em;
    }

    .flashcard {
        height: 240px;
    }

    .flashcard-front h3 {
        font-size: 1.4em;
    }
}
