/* CSS: Styling the website */
:root {
    --primary-color: #415fe6; /* Professional Blue */
    --secondary-color: #ffffff;
    --text-color: #333;
    --active-nav: #415fe6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: var(--text-color);
    margin-top: 100px; /* Pushes content down to not be obscured by the floating header */
}

/* Header and Navigation Styling */
header {
    background-color: var(--primary-color);
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: fixed; /* Makes the header float */
    top: 20px; /* Distance from the top */
    left: 50%;
    transform: translateX(-50%); /* Centers the header */
    z-index: 1000; /* Ensures it's on top of other content */
    border-radius: 12px; /* Rounded corners for the "island" effect */
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.tab-button {
    background-color: transparent;
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* The class usually applied to the currently active tab button */
.tab-button.active {
    background-color: white;
    color: var(--primary-color);
    font-weight: bold;
}

/* Main Content Styling */
main {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.content-section {
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s;
}

/* Animation for smooth switching */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.card {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}
/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
    display: block;
}

.accordion {
    margin-top: 15px;
}

.accordion details {
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    margin-bottom: 5px;
    background-color: #fff;
}

.accordion summary {
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

.accordion details[open] summary {
    background-color: #f0f0f0;
}

.accordion .content {
    padding: 10px;
    border-top: 1px solid #ccc;
}

/* Flashcard Stack Styles */
.flashcard-stack-container {
    position: relative;
    width: 250px;
    height: 200px; /* Ensure enough height */
    margin: 40px auto;
}

.flashcard {
    position: absolute;
    width: 200px;
    height: 150px;
    top: 0;
    left: 25px; /* (250 - 200) / 2 */
    cursor: pointer;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.flashcard.current {
    transform: scale(1);
    opacity: 1;
    z-index: 10;
}

.flashcard.next-1 {
    transform: translateX(30px) scale(0.9);
    opacity: 1;
    z-index: 9;
}

.flashcard.next-2 {
    transform: translateX(60px) scale(0.8);
    opacity: 1;
    z-index: 8;
}

.flashcard.prev-1 {
    transform: translateX(-30px) scale(0.9);
    opacity: 1;
    z-index: 9;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    border-radius: 8px;
}

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
}

.flashcard-front {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.flashcard-back {
    background-color: #f9f9f9;
    color: var(--text-color);
    transform: rotateY(180deg);
}

/* Buttons */
.stack-nav {
    position: absolute;
    top: 50%;
    left: -30%; /* Move further left */
    width: 160%; /* Widen the container more */
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 5; /* Below the cards */
    pointer-events: none;
}

.stack-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: auto;
}

.hidden {
    display: none;
}

/* Progress Bar Styles */
.progress-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 10px;
}

.progress-bar {
    width: 0%;
    height: 30px;
    background-color: #4caf50;
    text-align: center;
    line-height: 30px;
    color: white;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}
