/* --- Base Styles (General structure) --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Light background for the page */
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px; /* Space between nav links and the back button container */
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: #555;
}

/* Go Back Button Styling (Based on inline styles provided) */
.notes-page button[onclick="history.back()"] {
    background: linear-gradient(90deg, #acdcee, #6274fc, #5911f4);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap; /* Prevent button text from wrapping */
}

/* --- Main Content and Buttons Grid --- */
main {
    padding: 20px;
    flex-grow: 1; /* Allows main content to take up available space */
    max-width: 1200px;
    margin: 0 auto; /* Center the main content horizontally */
    width: 100%;
}

main h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #007bff;
}

/* Adopting the grid structure from courses-button-container */
.notes-button-container {
    display: grid;
    /* Use grid-template-columns for a responsive layout */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px; /* Increased gap for better spacing */
    padding: 10px;
}

/* Styling for the unit buttons */
.notes-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* Style from the provided courses-button, but updated color */
    padding: 20px 10px;
    background: linear-gradient(90deg, #2ab8ec, #e2f5ff, #de92ec);
    color: rgb(19, 5, 53);
    text-decoration: none;
    border-radius: 8px; /* Slightly larger border-radius */
    text-align: center;
    line-height: 1.4;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.notes-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
}


/* --- Footer Styles --- */
footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: white;
    margin-top: auto; /* Pushes the footer to the bottom */
}


/* --- Mobile Responsiveness (Simplified) --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Reduce the minimum size of the grid items on smaller screens */
    .notes-button-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* Feedback Button styles (Kept as it's a floating UI element) */
.pulse-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-image: linear-gradient(to right, #c7bded, #5e46e7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 0 0 0 rgba(180, 61, 244, 0.7); /* Initial shadow for pulse */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(180, 61, 244, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}






/* --- Practice Page Styles --- */

.practice-button-container {
    display: grid;
    grid-template-columns: repeat(4, 250px);
    gap: 20px;
    justify-content: center;
}

.practice-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* Style from the provided courses-button, but updated color */
    padding: 20px 10px;
    background: linear-gradient(90deg, #60a6bf, #147ab0, #200898);
    color: rgb(19, 5, 53);
    text-decoration: none;
    border-radius: 8px; /* Slightly larger border-radius */
    text-align: center;
    line-height: 1.4;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.practice-button:hover {
    background-color: #303030;
}

/* --- Courses Page Styles --- */
.courses-grid-wrapper {
    padding: 10px;
}

.courses-button-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.courses-button {
    display: block;
    padding: 10px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
}

.courses-button:hover {
    background-color: #545b62;
}

/* --- Quiz Page Styles --- */
.quiz-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.quiz-area {
    width: 60%;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.explanation-area {
    width: 60%;
    padding: 20px;
    background-color: #ffe1e1;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.question {
    margin-bottom: 15px;
    font-weight: bold;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.option {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.option.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.option.wrong {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

#explanation-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: none;
}

#explanation-button:hover {
    background-color: #0056b3;
}

#explanation-text {
    margin-top: 15px;
}
