:root {
    --primary-color: #4a6fa5;
    --secondary-color: #e17055;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

select, button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: white;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 16px;
}

select {
    background-color: white;
    color: var(--dark-color);
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    transition: all 0.2s;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 300px;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: var(--shadow);
    border-radius: 10px;
}

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

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

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

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

.word {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.meaning {
    font-size: 24px;
    margin-bottom: 15px;
}

.example {
    font-size: 16px;
    font-style: italic;
    opacity: 0.9;
}

.navigation, .feedback {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

.feedback {
    margin-top: 20px;
}

#know-btn {
    background-color: #4CAF50;
    color: white;
}

#dont-know-btn {
    background-color: var(--secondary-color);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: var(--shadow);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#mistake-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.mistake-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mistake-word {
    font-weight: bold;
}

.remove-mistake {
    color: var(--secondary-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .flashcard-container {
        height: 250px;
    }

    .word {
        font-size: 28px;
    }

    .meaning {
        font-size: 20px;
    }

    .navigation, .feedback {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .flashcard-container {
        height: 200px;
    }

    .word {
        font-size: 24px;
    }

    .meaning {
        font-size: 18px;
    }

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

.word-count {
    margin: 0 10px;
    color: #666;
    font-size: 14px;
    padding: 5px 0;
    vertical-align: middle;
}

#import-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

#import-btn:hover {
    background-color: #45a049;
}

#import-btn:hover {
    background-color: #45a049;
}