:root {
    --primary-color: #b5d33d;
    /* Vibrant Pistachio/Lime green */
    --secondary-color: #9ab829;
    /* Vivid deeper green */
    --accent-color: #ff9800;
    /* Bright Orange */
    --success-color: #4ade80;
    /* Bright Green */
    --error-color: #ff5722;
    /* Vivid Red-Orange */
    --bg-gradient: linear-gradient(135deg, #fffcf5 0%, #f3fad4 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Background animated shapes for visual flair */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
    will-change: transform;
    transform: translateZ(0);
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    bottom: -5%;
    right: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -50px) scale(1.1);
    }
}

/* Glassmorphism Container */
.glass-container {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Buttons */
.primary-btn,
.secondary-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background: #fdfcff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(109, 40, 217, 0.1);
}

.setup-section {
    display: flex;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Practice / Test mode choice ─────────────────────────────────────────── */
.quiz-mode-choice {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.choice-card {
    flex: 1 1 220px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.choice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.choice-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.choice-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.choice-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Test name input ─────────────────────────────────────────────────────── */
#test-name-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 0.5rem;
}

#student-name-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    text-align: center;
    transition: border-color 0.2s;
}

#student-name-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Test mode badge ─────────────────────────────────────────────────────── */
#test-mode-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(232, 146, 58, 0.12);
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

/* Results saved message ───────────────────────────────────────────────── */
.test-saved-msg {
    font-size: 0.95rem;
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Quiz questions */
.question-card {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
    contain: layout style paint;
}

.question-card:hover {
    transform: translateX(4px);
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.8);
}

.question-label {
    flex: 1 1 200px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.inputs-container {
    flex: 2 1 400px;
    display: flex;
    gap: 1rem;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Validation styles */
.input-group.correct input[type="text"] {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.input-group.incorrect input[type="text"] {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.correction-feedback {
    font-size: 0.85rem;
    color: var(--error-color);
    margin-top: 0.3rem;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.3s;
}

.input-group.incorrect .correction-feedback {
    display: block;
}

.card-status-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.question-card.status-correct .card-status-icon {
    opacity: 1;
    color: var(--success-color);
}

.question-card.status-incorrect .card-status-icon {
    opacity: 1;
    color: var(--error-color);
}


.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#results-summary {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: fadeIn 0.5s;
}

#score-text {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 800;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .glass-container {
        padding: 2rem 1.5rem;
    }

    .inputs-container {
        flex-direction: column;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Mode Toggle */
.mode-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 99px;
    padding: 0.3rem;
    margin-top: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toggle-btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Group Selector */
.group-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.group-btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 1.2rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.group-btn:hover:not(.disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.group-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.group-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Generator List */
.generated-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.verb-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s;
}

.verb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(109, 40, 217, 0.1);
}

.verb-card.highlight-orange {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.verb-card.highlight-green {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 4px 12px rgba(156, 227, 108, 0.797);
}

.verb-card .lang {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.verb-card .word {
    font-size: 1.4rem;
    font-weight: 800;
}

.english-word {
    color: var(--primary-color) !important;
}

.catalan-word {
    color: var(--accent-color) !important;
}

.center {
    justify-content: center !important;
}