body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: var(--color-background);
    /* Override global beige background */
}

main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: var(--spacing-md);
}

/* Flashcard Styles */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 300px;
    margin: var(--spacing-sm) auto;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: var(--border-width) solid var(--color-primary);
    background-color: var(--color-surface);
    color: var(--color-text-main);
}

.card-front {
    background-color: var(--color-surface);
    color: var(--color-text-main);
}

.card-back {
    background: linear-gradient(180deg, #1976D2 0%, #0D47A1 100%);
    color: white;
    transform: rotateY(180deg);
    border-color: transparent;
}

.card-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
    display: block;
    /* Force display */
}

.card-content {
    font-family: var(--font-family-heading);
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 800;
}

.card-back .card-content {
    font-size: 1.5rem;
}

.card-hint {
    margin-top: var(--spacing-md);
    font-size: 0.9rem;
    opacity: 0.8;
    animation: bounce 2s infinite;
    color: var(--color-text-light);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Insight Styles (Hidden by default) */
.insight-container {
    display: none;
    width: 100%;
    margin-top: var(--spacing-xl);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.insight-container.visible {
    display: block;
    opacity: 1;
}

.question-block {
    background-color: var(--color-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.2);
}

.question-block h1 {
    font-size: 2rem;
    margin-bottom: 0;
    line-height: 1.2;
    color: white;
}

.insight-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.concept-block {
    padding: var(--spacing-md);
    /* Removed border and background for minimalist look */
    border: none;
    background-color: transparent;
}

.concept-title {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    color: var(--color-text-main);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.takeaway-box {
    background-color: #F8FAFC;
    /* Very light slate/blue grey */
    border: 1px solid #E2E8F0;
    /* Subtle border */
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    margin-top: var(--spacing-md);
    position: relative;
}

.takeaway-icon {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-success);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 204, 102, 0.3);
}

.takeaway-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.takeaway-box .btn {
    margin-top: var(--spacing-md);
}

.quiz-container {
    margin-top: var(--spacing-md);
    width: 100%;
}

.quiz-options {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: var(--spacing-md);
    justify-content: center;
}

.btn-quiz {
    background: white;
    border: 1px solid #e2e8f0;
    /* 3D effect removed */
    color: var(--color-text-main);
    padding: 15px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: center;
    font-weight: 700;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    position: relative;
    user-select: none;
    transform: translateY(0);
}

.btn-quiz:hover {
    background-color: #f1f5f9;
    /* Light grey hover */
    border-color: #cbd5e1;
}

.btn-quiz:active {
    background-color: #e2e8f0;
    transform: translateY(1px);
}

.btn-quiz.correct {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 204, 102, 0.4);
}

.btn-quiz.incorrect {
    background-color: #ff4d4d;
    border-color: #ff4d4d;
    color: white;
    opacity: 0.8;
}

.quiz-feedback {
    margin-top: 10px;
    font-weight: 500;
    padding: 10px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.8);
}

.quiz-feedback.success {
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.quiz-feedback.error {
    color: #d63031;
    border: 1px solid #d63031;
}

.highlight {
    background: linear-gradient(120deg, rgba(255, 204, 0, 0.3) 0%, rgba(255, 204, 0, 0.3) 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 88%;
    display: inline;
}

/* Controls */
.controls {
    margin-top: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    width: 100%;
    z-index: 20;
}

.btn {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--color-theme-blue);
    color: white;
}

.btn-secondary {
    background-color: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.hidden {
    display: none !important;
}

/* Animation for transition */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

/* Item ID Display */
.item-id-display {
    position: relative;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-light);
    opacity: 0.6;
    font-family: monospace;
    margin-top: -10px;
    /* Pull it slightly up towards the card */
    margin-bottom: var(--spacing-sm);
    pointer-events: none;
    z-index: 5;
}