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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.progress-fill {
    background: #4ade80;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.3);
}

.filter-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.category-select {
    display: flex;
    justify-content: center;
}

.category-select select {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 20px;
}

.flashcard {
    width: 100%;
    height: 300px;
    cursor: pointer;
    position: relative;
}

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

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

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

.flashcard-front {
    background: white;
}

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: rotateY(180deg);
}

.card-image {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
}

.card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    font-size: 3rem;
}

.card-word {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    color: #333;
}

.flashcard-back .card-word {
    color: white;
    font-size: 2rem;
}

.card-hint {
    margin-top: 15px;
    color: #999;
    font-size: 0.85rem;
}

.card-category {
    margin-top: 15px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 5px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
}

.answer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.answer-buttons.visible {
    opacity: 1;
    visibility: visible;
}

.answer-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.answer-btn:hover {
    transform: scale(1.05);
}

.answer-btn:active {
    transform: scale(0.98);
}

.unknown-btn {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.known-btn {
    background: #22c55e;
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-counter {
    color: white;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    color: #666;
}

.empty-state h2 {
    margin-bottom: 10px;
    color: #333;
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .flashcard {
        height: 280px;
    }

    .card-word {
        font-size: 1.5rem;
    }

    .flashcard-back .card-word {
        font-size: 1.7rem;
    }

    .answer-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
