:root {
    --primary-color: #2196f3;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 5em
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.controls {
    display: flex;
    gap: 1rem;
}

.controls button,
.controls select {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flashcard {
    width: 100%;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    transition: transform 0.6s;
}

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

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

.navigation {
    display: flex;
    gap: 1rem;
}

.navigation button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.progress {
    margin-top: 2rem;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 20px;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
}

.categories {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.categories h2 {
    color: #666;
    margin-bottom: 1rem;
}

.word-groups-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.word-group {
    aspect-ratio: 1;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-group.active {
    background: #4caf50;
    color: white;
}

.word-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .flashcard {
        height: 200px;
    }

    .flashcard-front,
    .flashcard-back {
        font-size: 1.5rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }
}

.controls button:hover,
.controls select:hover,
.navigation button:hover {
    background: #1976d2;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.controls button:active,
.controls select:active,
.navigation button:active {
    transform: translateY(0);
}

.flashcard:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Add these new styles */
.word {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.pos {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.definition {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.examples {
    font-size: 1rem;
    color: #666;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.small {
    font-size: 0.9rem;
    line-height: 1.4;
}

.direction-toggle {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.direction-toggle:hover {
    background: #1976d2;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    color: #666;
}

.close-modal:hover {
    color: #333;
}

/* Update word groups grid for modal */
.word-groups-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
    width: 800px;
    max-width: 100%;
}

.word-group {
    aspect-ratio: 1;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.5rem;
}

/* Add modal animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-content {
    padding: 1rem 0;
}

.setting-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-group label {
    font-weight: bold;
    min-width: 150px;
}

.setting-group input[type="time"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.test-button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.test-button:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.test-button:active {
    transform: translateY(0);
}

.rating-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
}

.rating-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    flex: 1;
}

.rating-button.again {
    background: #ff5252;
    color: white;
}

.rating-button.hard {
    background: #ff9100;
    color: white;
}

.rating-button.good {
    background: #4caf50;
    color: white;
}

.rating-button.easy {
    background: #2196f3;
    color: white;
}

.rating-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.flag-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;  /* Set appropriate size for your flags */
    height: 32px;
}

.french-flag {
    color: #002395; /* French blue */
}

.english-flag {
    color: #cf142b; /* British red */
} 