/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo {
    margin-bottom: 15px;
}

.logo-img {
    width: 100px;
    height: auto;
    margin: 0 auto;
    display: block;
    background: #ffffff;
    border-radius: 50%;
    padding: 5px;
    filter: drop-shadow(0 4px 15px rgba(251, 202, 17, 0.3));
}

header h1 {
    color: #fbca11;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Lesson Selection Screen */
#lesson-screen h2 {
    text-align: center;
    color: #fbca11;
    margin-bottom: 25px;
    font-size: 24px;
}

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

.lesson-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border: 2px solid #fbca11;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.lesson-card:hover,
.lesson-card:active {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251, 202, 17, 0.4);
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.lesson-card h3 {
    color: #fbca11;
    font-size: 20px;
    margin-bottom: 8px;
}

.lesson-card p {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 10px;
}

.lesson-card .card-count {
    color: #fbca11;
    font-size: 13px;
    font-weight: 600;
}

/* Flashcard Screen */
.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-back {
    background: #3a3a3a;
    color: #fbca11;
    border: 1px solid #fbca11;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover,
.btn-back:active {
    background: #fbca11;
    color: #000000;
}

.progress {
    background: #3a3a3a;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #fbca11;
}

#card-counter {
    color: #fbca11;
    font-weight: 600;
    font-size: 16px;
}

.lesson-title {
    text-align: center;
    color: #fbca11;
    font-size: 20px;
    margin-bottom: 25px;
}

/* Flashcard */
.flashcard-container {
    perspective: 1000px;
    margin-bottom: 30px;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.flashcard {
    width: 100%;
    min-height: 400px;
    cursor: pointer;
}

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

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 400px;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.flashcard-front {
    background: linear-gradient(135deg, #fbca11 0%, #f5b800 100%);
    color: #000000;
}

.flashcard-back {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: #ffffff;
    border: 3px solid #fbca11;
    transform: rotateY(180deg);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-text {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
}

.example-text {
    font-size: 16px;
    font-style: italic;
    color: #cccccc;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #fbca11;
}

.tap-hint {
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 15px;
}

.flashcard-front .tap-hint {
    color: #000000;
}

.flashcard-back .tap-hint {
    color: #fbca11;
}

/* Navigation */
.navigation {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.btn-nav {
    flex: 1;
    background: #fbca11;
    color: #000000;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(251, 202, 17, 0.3);
}

.btn-nav:hover,
.btn-nav:active {
    background: #f5b800;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(251, 202, 17, 0.4);
}

.btn-nav:disabled {
    background: #3a3a3a;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-shuffle {
    background: #3a3a3a;
    color: #fbca11;
    border: 2px solid #fbca11;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-shuffle:hover,
.btn-shuffle:active {
    background: #fbca11;
    color: #000000;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 24px;
    }

    .flashcard-container {
        min-height: 350px;
    }

    .flashcard {
        min-height: 350px;
    }

    .flashcard-inner,
    .flashcard-front,
    .flashcard-back {
        min-height: 350px;
    }

    .card-text {
        font-size: 20px;
    }

    .example-text {
        font-size: 14px;
    }

    .btn-nav {
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn-shuffle {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    header h1 {
        font-size: 32px;
    }

    .flashcard-container {
        min-height: 450px;
    }

    .flashcard {
        min-height: 450px;
    }

    .flashcard-inner,
    .flashcard-front,
    .flashcard-back {
        min-height: 450px;
    }
}

/* Quiz Styles */
.quiz-container {
    margin-top: 20px;
}

.quiz-question {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border: 2px solid #fbca11;
    border-radius: 12px;
    padding: 25px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 25px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-option {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border: 2px solid #666666;
    border-radius: 10px;
    padding: 18px 20px;
    font-size: 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.quiz-option:hover {
    border-color: #fbca11;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    transform: translateX(5px);
}

.quiz-option.selected {
    border-color: #fbca11;
    background: linear-gradient(135deg, #fbca11 0%, #f5b800 100%);
    color: #000000;
    font-weight: 600;
}

.quiz-option.correct {
    border-color: #4caf50;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #ffffff;
}

.quiz-option.incorrect {
    border-color: #f44336;
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    color: #ffffff;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.quiz-feedback {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-message {
    font-size: 18px;
    font-weight: 600;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
}

.feedback-message.correct {
    background: #4caf50;
    color: #ffffff;
}

.feedback-message.incorrect {
    background: #f44336;
    color: #ffffff;
}

/* Quiz Results Styles */
.results-container {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-in;
}

.results-title {
    color: #fbca11;
    font-size: 32px;
    margin-bottom: 40px;
}

.results-score {
    margin-bottom: 30px;
}

.score-circle {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #fbca11 0%, #f5b800 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(251, 202, 17, 0.4);
    border: 5px solid #000000;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
    color: #000000;
}

.results-message {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Responsive Quiz Styles */
@media (max-width: 480px) {
    .quiz-question {
        font-size: 18px;
        padding: 20px;
        min-height: 100px;
    }

    .quiz-option {
        font-size: 15px;
        padding: 15px 18px;
    }

    .feedback-message {
        font-size: 16px;
        padding: 12px 20px;
    }

    .results-title {
        font-size: 26px;
        margin-bottom: 30px;
    }

    .score-circle {
        width: 160px;
        height: 160px;
    }

    .score-number {
        font-size: 40px;
    }

    .results-message {
        font-size: 18px;
    }
}
