/* General Reset and Old-School Font */
body {
    font-family: 'Courier New', Courier, monospace; /* Classic Monospace Look */
    background-color: #D3D3D3; /* Light Grey Background */
    color: #000000;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Main Outer Container - The Desktop Window Look */
.oldschool-container {
    /* ... existing styles ... */
    width: 90%;
    max-width: 1000px;
    border: 3px solid #808080;
    box-shadow:
        5px 5px 0 0 #A9A9A9,
        -5px -5px 0 0 #FFFFFF,
        inset -1px -1px 0 0 #404040;
    background-color: #C0C0C0;
    padding: 0;
    margin-bottom: 50px;

    /* ADD THIS: Set this container to flex to arrange its children (tabs & content) */
    display: flex;
    flex-direction: column; /* Keep header on top */
}

/* Header Bar - Title and Blue Accent */
.header-bar {
    background-color: #000080; /* Classic Navy Blue */
    color: white;
    padding: 5px 10px;
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 3px solid #808080;
    text-shadow: 1px 1px #000000;
}

/* Tab Navigation Styling */
.tabs-container {
    display: flex;
    flex-direction: column; /* KEEP: Stacks buttons vertically */
    flex-wrap: nowrap;
    background-color: #C0C0C0;
    border-bottom: 2px solid #808080;
    padding-left: 5px;
    padding-right: 5px;
    /* CHANGE: Remove width: fit-content; to allow it to fill 100% of the parent */
    width: 100%; /* Make it fill the container width */
}

.tab-button {
    /* Base Button Style */
    background-color: #D3D3D3;
    color: #000000;
    border: 2px solid #C0C0C0;
    border-bottom: 2px solid #808080; /* Add bottom border for vertical separation */
    border-right: 2px solid #808080; /* Add right border */
    padding: 8px 15px;
    margin-right: 0; /* Remove horizontal margin */
    margin-bottom: 2px; /* Add a small vertical margin */
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: bold;
    text-align: left; /* Align text to the left for better look in a column */
    width: 100%;
    /* 3D Button Effect (adjusting for vertical stacking) */
    box-shadow:
        -1px -1px 0 0 #FFFFFF, /* Top/Left Highlight */
        1px 1px 0 0 #808080;   /* Bottom/Right Shadow */
}

/* Active Tab Style - Makes it look 'pressed' and connected to the content */
.active-tab {
    background-color: #EFEFEF;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #EFEFEF; /* Matches content background */
    border-bottom: 2px solid #808080;
    box-shadow: none; /* Remove 3D effect to look connected */
    position: relative;
    /* CHANGE: Reset top/right shifts, as it's a full-width block now */
    top: 0;
    right: 0;
}


/* Content Area - The main body box */
.content-area {
    background-color: #EFEFEF; /* Slightly lighter inner content area */
    padding: 15px;
    min-height: 400px;
    border-top: 1px solid #C0C0C0;
}

/* Hidden Content by default */
.tab-content {
    display: none;
}

/* Visible Content */
.active-content {
    display: block;
}

.section-title {
    color: #000080;
    border-bottom: 2px solid #808080;
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Flashcard Grid Layout */
.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* Flashcard Styling - The main visual element */
.flashcard {
    height: 150px;
    perspective: 1000px; /* For 3D flip effect */
    cursor: pointer;
    border: 1px solid #404040;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hide the back when looking at the front */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    font-size: 1.1em;
    font-weight: bold;
    border: 3px solid #808080;
    background-color: #FFFFFF; /* White card color */
    /* Visual Striking: Black border with 3D-like effect */
    box-shadow:
        1px 1px 0 0 #000000,
        2px 2px 0 0 #000000;
    transition: transform 0.6s;
    border-radius: 0; /* Sharp corners */
}

.card-back {
    background-color: #FFFFE0; /* Light Yellow for the 'answer' side */
    transform: rotateY(180deg);
    font-size: 0.9em;
    font-weight: normal;
}

/* Flashcard Flip State */
.flashcard.is-flipped .card-front {
    transform: rotateY(180deg);
}

.flashcard.is-flipped .card-back {
    transform: rotateY(360deg);
}

/* Footer Style */
.oldschool-footer {
    background-color: #C0C0C0; /* Same as the main container for continuity */
    color: #404040;
    padding: 5px 10px;
    font-size: 0.8em;
    text-align: right;
    border-top: 2px solid #808080; /* Shadow line */
    border-bottom: 2px solid #FFFFFF; /* Highlight line */
    box-shadow: inset 1px 1px 0 0 #FFFFFF; /* Inner highlight */
}