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

/* Lato Font */
@font-face {
    font-family: 'Lato';
    src: url('Lato/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('Lato/Lato-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('Lato/Lato-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('Lato/Lato-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

:root {
    --primary-color: #c75050;
    --primary-dark: #a84444;
    --secondary-color: #e6b44c;
    --background: #f5f5f5;
    --card-bg: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #757575;
    --success: #6db070;
    --error: #d96a6a;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    padding: 30px 0;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Home Button */
.home-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
    filter: brightness(1.1);
}

.home-btn img {
    width: 32px;
    height: 32px;
}

.home-btn.hidden {
    display: none;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Options */
.options {
    margin-bottom: 25px;
}

.options-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Radio Button Group */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-option {
    flex: 1;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-btn {
    display: block;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-btn {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: var(--text-primary);
}

.radio-option:hover .radio-btn {
    border-color: var(--secondary-color);
}

/* Wrapped radio group for many options */
.radio-group-wrap {
    flex-wrap: wrap;
    justify-content: center;
}

.radio-group-wrap .radio-option {
    flex: 1 1 auto;
}

.radio-group-wrap .radio-btn {
    padding: 10px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(199, 80, 80, 0.4);
}

.btn.secondary {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Progress Bar */
.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress {
    background: var(--secondary-color);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Practice Card */
.practice-card {
    text-align: center;
}

.verb-prompt {
    background: #6b7db3;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    color: white;
}

.verb-prompt .label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.verb-prompt .verb {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.verb-prompt .translation {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Form */
#answer-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-tense {
    text-transform: uppercase;
}

.feedback-tense {
    text-transform: uppercase;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.input-group input.correct {
    border-color: var(--success);
    background-color: rgba(76, 175, 80, 0.1);
}

.input-group input.incorrect {
    border-color: var(--error);
    background-color: rgba(244, 67, 54, 0.1);
}

/* Feedback */
.feedback {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.correct-answers {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
}

.correct-answers p {
    margin-bottom: 5px;
    color: var(--text-primary);
}

.correct-answers p:first-child {
    margin-bottom: 10px;
}

.answer-hidden {
    visibility: hidden;
}

.action-buttons {
    margin-top: 20px;
    position: relative;
}

.action-buttons .btn {
    width: 100%;
}

.action-buttons .btn.hidden {
    display: none;
}

/* Results */
.score {
    text-align: center;
    margin: 30px 0 10px;
}

.score-number {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
}

.score-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.score-percentage {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--success);
}

/* Mistakes Summary */
.mistakes-summary {
    margin: 25px 0;
    text-align: left;
}

.mistakes-summary.hidden {
    display: none;
}

.mistakes-summary h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.mistakes-summary ul {
    list-style: none;
}

.mistakes-summary li {
    background: #fff3e0;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--secondary-color);
}

.mistakes-summary li strong {
    color: var(--primary-color);
}

/* Mode Selection Buttons */
.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.mode-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.mode-icon img {
    width: 48px;
    height: 48px;
}

.mode-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.mode-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 5px 0;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-color);
}

/* Results Buttons */
.results-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Flashcards */
.flashcards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.flashcard {
    perspective: 1000px;
    height: 100px;
    cursor: pointer;
}

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

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

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

.flashcard-front {
    background: #d0d0d0;
    color: var(--text-secondary);
}

.flashcard-back {
    background: var(--success);
    color: white;
    transform: rotateX(180deg);
}

.flashcard-label {
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.flashcard-tense {
    text-transform: uppercase;
}

.flashcard-hint {
    font-size: 1rem;
    font-style: italic;
}

.flashcard-answer {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Memorize Card */
.memorize-card {
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

footer .copyright {
    font-size: 0.8rem;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.4);
}

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

    header h1 {
        font-size: 1.8rem;
    }

    .card {
        padding: 20px;
    }

    .verb-prompt .verb {
        font-size: 1.6rem;
    }

    .flashcard {
        height: 90px;
    }

    .flashcard-answer {
        font-size: 1.3rem;
    }
}
