* {
    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;
    color: #333;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    padding: 40px;
    min-height: 600px;
}

.screen.active {
    display: block;
}

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

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.menu-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 30px 20px;
    border-radius: 15px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.menu-btn.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.menu-btn.secondary:hover {
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.6);
}

.menu-btn .icon {
    font-size: 2.5em;
}

.menu-btn .text {
    font-weight: 600;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    background: #f5576c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

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

.progress {
    display: flex;
    gap: 20px;
    font-weight: 600;
    color: #667eea;
}

/* Flashcards */
.flashcard-container {
    perspective: 1000px;
    margin: 40px 0;
    min-height: 400px;
}

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

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.flashcard-content {
    padding: 40px;
    text-align: center;
    width: 100%;
}

.flashcard-content h2 {
    margin-bottom: 30px;
    font-size: 2em;
}

#flashcard-scenario {
    font-size: 1.5em;
    line-height: 1.8;
}

#flashcard-answer {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
}

.deviation-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.1em;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.control-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.control-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Quiz */
.quiz-container {
    margin: 30px 0;
}

.quiz-question {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.quiz-question h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
}

#quiz-scenario {
    font-size: 1.4em;
    line-height: 1.8;
}

.quiz-answers {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.quiz-answer-btn {
    background: white;
    border: 3px solid #667eea;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
}

.quiz-answer-btn:hover {
    background: #f0f0f0;
    transform: translateX(5px);
    border-color: #764ba2;
}

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

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

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

.quiz-feedback {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #4caf50;
}

.quiz-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f44336;
}

.quiz-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* True/False specific styles */
.true-false-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.true-false-btn {
    padding: 30px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.true-false-btn.true-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.true-false-btn.false-btn {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    color: white;
}

.true-false-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.true-false-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Strategy Table */
.strategy-table-container {
    margin: 20px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.strategy-table-section {
    margin-bottom: 40px;
}

.strategy-table-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-align: center;
}

.strategy-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.strategy-table th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

.strategy-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 0.85em;
}

.strategy-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.strategy-table tbody tr:hover {
    background: #e8f0fe;
}

.action-cell {
    font-weight: 600;
    padding: 8px;
    border-radius: 5px;
}

.action-S {
    background: #fff3cd;
    color: #856404;
}

.action-H {
    background: #f8d7da;
    color: #721c24;
}

.action-D {
    background: #d4edda;
    color: #155724;
}

.action-Ds {
    background: #cfe2ff;
    color: #084298;
}

.action-Y {
    background: #d4edda;
    color: #155724;
}

.action-N {
    background: #f8d7da;
    color: #721c24;
}

.action-YN {
    background: #d1ecf1;
    color: #0c5460;
}

.deviation-cell {
    font-size: 0.75em;
    color: #d63384;
    font-weight: 600;
    margin-top: 3px;
}

/* Practice Table */
.practice-table-container {
    margin: 20px 0;
}

.practice-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.practice-table td {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.practice-table td:hover {
    background: #e8f0fe !important;
    transform: scale(1.05);
}

.practice-table td.filled {
    font-weight: 600;
}

.practice-table td.selected {
    background: #fff3cd !important;
    border: 3px solid #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.practice-table td.correct {
    background: #d4edda !important;
    color: #155724;
}

.practice-table td.incorrect {
    background: #f8d7da !important;
    color: #721c24;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.control-btn.secondary {
    background: #6c757d;
}

.control-btn.secondary:hover {
    background: #5a6268;
}

.practice-results {
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.practice-results.show {
    display: block;
}

.practice-results h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #667eea;
}

.practice-results .score {
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
}

.practice-results .score-text {
    font-size: 1.2em;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #667eea;
    text-align: center;
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.modal-action-btn {
    padding: 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.modal-action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }

    .screen {
        padding: 20px;
        min-height: auto;
    }

    h1 {
        font-size: 2em;
    }

    .menu-buttons {
        grid-template-columns: 1fr;
    }

    .flashcard {
        height: 350px;
    }

    .flashcard-content {
        padding: 20px;
    }

    #flashcard-scenario {
        font-size: 1.2em;
    }

    #flashcard-answer {
        font-size: 1.5em;
    }

    .true-false-buttons {
        grid-template-columns: 1fr;
    }

    .strategy-table {
        font-size: 0.7em;
    }

    .strategy-table th,
    .strategy-table td {
        padding: 8px 4px;
    }

    .strategy-table-container {
        max-height: 60vh;
    }
}
