* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
}

.app-container {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 0 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1rem;
}

/* Decks Selection */
.decks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.deck-card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.deck-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.deck-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.deck-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    align-items: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e2e8f0;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    transition: background 0.1s;
}

.download-btn:hover {
    background: #cbd5e1;
}

.test-btn, .reset-progress-btn {
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.1s;
}

.test-btn:hover, .reset-progress-btn:hover {
    background: #eff6ff;
}

.reset-progress-btn {
    color: #dc2626;
    border-color: #dc2626;
}
.reset-progress-btn:hover {
    background: #fef2f2;
}

/* Flashcard Area */
.study-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.back-btn {
    background: transparent;
    color: #2563eb;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.back-btn:hover {
    color: #1d4ed8;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

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

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.4s ease-in-out;
    transform-style: preserve-3d;
    cursor: pointer;
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid #ccc;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-y: auto;
}

.card-front {
    color: #000;
}

.card-back {
    color: #000;
    transform: rotateY(180deg);
}

.card-content {
    font-size: 1.2rem;
    line-height: 1.5;
}

.card-hint {
    position: absolute;
    bottom: 1rem;
    font-size: 0.8rem;
    color: #999;
}

.controls {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    visibility: hidden;
}

.controls.visible {
    visibility: visible;
}

.control-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    background: #f9f9f9;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.control-btn:hover {
    background: #eee;
}

.card-face hr {
    border: none;
    border-top: 1px solid #ccc;
    width: 80%;
    margin: 15px auto;
}
