:root {
    --primary-color: #007bff;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --card-height: 300px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

h1 {
    margin-bottom: 1.5rem;
}

.controls {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

button:hover {
    background-color: #eef5ff;
}

button.active {
    background-color: var(--primary-color);
    color: white;
}

.card-container {
    perspective: 1000px;
    height: var(--card-height);
    margin-bottom: 1.5rem;
}

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

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
    overflow-y: auto;
}

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

.question-number {
    font-size: 0.9rem;
    color: #888;
    position: absolute;
    top: 1rem;
    left: 1rem;
}

#question-text, #answer-text {
    font-size: 1.2rem;
    margin: 0;
}

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

.navigation button {
    min-width: 100px;
}

#progress-text {
    font-size: 1rem;
    color: #555;
}

.mode-switch {
    margin-top: 1.5rem;
    text-align: center;
}

.mode-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    display: inline-block;
    transition: all 0.2s ease;
}

.mode-switch a:hover {
    background-color: var(--primary-color);
    color: white;
}
