/* ===== Base Styles ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 60px; /* Ensure footer doesn't overlap */
    background-color: #f4f4f9;
    color: #333;
    overflow-y: auto; /* Allows page scrolling */
    background-image: url('https://images.unsplash.com/photo-1732287931034-c4cc1b06de6a?q=80&w=2787&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-attachment: fixed;
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, #00cec9 0%, #6c5ce7 100%);
    padding: 40px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header h1 {
    text-align: center;
    font-size: 2.8em;
    color: #ffffff;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1::after {
    content: "";
    display: block;
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    margin: 20px auto;
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

header:hover h1::after {
    transform: scaleX(1);
}

/* === NAVIGATION BAR === */
.main-navbar {
  background: linear-gradient(to right, #74b9ff, #55efc4); /* soft blue to green */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: 'Poppins', sans-serif;
  position: sticky;
  top: 0;
  z-index: 1000;
}


.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;

}

.nav-links > li {
  position: relative;
}

.nav-links a {
  display: block;
  padding: 1rem 1.5rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
  border-radius: 6px;
}

.nav-links > li:hover > a {
  background-color: #ffffff;
  color: #2f3542;
}

/* === DROPDOWN === */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  z-index: 1001;
}

.dropdown li {
  margin: 0;
}

.dropdown a {
  color: #2d3436;
  padding: 10px 20px;
  border-radius: 0;
}

.dropdown a:hover {
  background-color: #f1f1f1;
  color: #00cec9;
}

/* Reveal dropdown on hover */
.nav-links li:hover .dropdown {
  display: block;
}

/* === Mobile Responsive (optional) === */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    align-items: center;
  }

  .nav-links > li {
    width: 100%;
  }

  .dropdown {
    position: static;
    box-shadow: none;
    background: transparent;
  }

  .dropdown a {
    background: #f0f0f0;
  }
}


/* ===== Main Content ===== */
main {
    padding: 20px;
    margin: 20px auto;
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* ===== Content Boxes ===== */
.content-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    border-left: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #00cec9;
    transition: width 0.3s ease;
}

.content-box:nth-child(even)::before {
    background: #6c5ce7;
}

.content-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.content-box:hover::before {
    width: 8px;
}

.content-box h2 {
    color: #2d3436;
    font-size: 1.8em;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(116, 185, 255, 0.3);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-align: center;
}

/* ===== Footer ===== */
footer {
    background-color: #2d3436;
    color: white;
    padding: 2rem;
    text-align: center;
    font-size: 0.9em;
    margin-top: 4rem;
    border-top: 5px solid #388e3c;
}

footer p {
    margin: 0;
    opacity: 0.8;
}

/* ===== Question Components ===== */
.question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.option {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.3s ease;
}

.option:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.option.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ===== Whiteboard ===== */
.whiteboard {
    width: 100%;
    height: 500px;
    border: 2px solid #333;
    margin: 1rem auto;
    background-color: #fff;
    touch-action: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.whiteboard-controls {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.whiteboard-controls button {
    padding: 0.5rem 1rem;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.whiteboard-controls button:hover {
    background-color: #5a6268;
}

/* ===== Feedback ===== */
.feedback {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ===== Search Bar ===== */
.gcse-search {
    padding: 10px 15px;
    max-width: 600px;
    margin: 30px auto;
}

.gsc-control-cse {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.gsc-input-box {
    border-radius: 20px !important;
    border: 1px solid #3498db !important;
}

.gsc-search-button {
    display: none !important;
}

.gsc-input {
    font-size: 14px !important;
    padding-left: 10px !important;
}

.search-container {
    margin-left: auto;
}

/* ===== Resource Cards ===== */
.resource-link h3 {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-link p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.resource-link:hover h3 {
    color: #2ecc71;
}

/* ===== Unit List ===== */
.units {
    list-style-type: none;
    padding: 0;
}

.units li {
    font-size: 1.2em;
    font-weight: bold;
    margin: 10px 0;
}

.units li a {
    text-decoration: none;
    color: #4caf50;
    transition: color 0.3s, text-shadow 0.3s;
}

.units li a:hover {
    color: #388e3c;
    text-shadow: 1px 1px 5px #555;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    nav ul li a {
        font-size: 0.9em;
        padding: 8px 12px;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .whiteboard {
        height: 300px;
    }

    main {
        margin: 10px;
        padding: 15px;
    }

    footer {
        font-size: 0.9em;
        padding: 10px;
    }
}

.collapsible .content {
    display: none;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.collapsible .content.visible {
    display: block;
    max-height: 500px; /* Adjust as needed */
    opacity: 1;
}

/* Styling for Collapsible Green Box */
.section.collapsible {
    background-color: #e8f5e9; /* Light green background */
    border: 2px solid #4caf50; /* Darker green border */
    border-radius: 8px; /* Rounded corners */
    margin: 20px 0; /* Space between sections */
    padding: 10px; /* Inner padding */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: transform 0.3s ease-in-out; /* Add subtle animation */
}

.section.collapsible:hover {
    transform: scale(1.02); /* Slight zoom on hover */
}

.section.collapsible h3 {
    cursor: pointer; /* Indicate interactivity */
    color: #2e7d32; /* Dark green text for headers */
    margin: 0;
    font-size: 1.5em;
    display: flex;
    justify-content: space-between; /* Space for expand/collapse icons */
    align-items: center;
}

.section.collapsible h3::after {
    content: "▼"; /* Down arrow icon */
    font-size: 0.8em;
    color: #2e7d32;
    transition: transform 0.3s ease-in-out;
}

.section.collapsible h3.expanded::after {
    transform: rotate(180deg); /* Rotate arrow when expanded */
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em; /* Smaller font size for mobile */
    }

    nav ul {
        flex-direction: column; /* Stack the navigation items */
        align-items: center;
    }

    nav ul li {
        margin: 5px 0; /* Add spacing between items */
    }

    nav ul li a {
        font-size: 0.9em; /* Smaller font size for links */
        padding: 8px 12px; /* Adjust padding for smaller screens */
    }

    main {
        margin: 10px; /* Reduce margin for mobile */
        padding: 15px; /* Adjust padding */
    }

    footer {
        font-size: 0.9em; /* Smaller font for the footer */
        padding: 10px;
    }
}

/* Styling for Collapsible Green Box */
.section.collapsible {
    background-color: #e8f5e9; /* Light green background */
    border: 2px solid #4caf50; /* Darker green border */
    border-radius: 8px; /* Rounded corners */
    margin: 20px 0; /* Space between sections */
    padding: 10px; /* Inner padding */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: transform 0.3s ease-in-out; /* Add subtle animation */
}

.section.collapsible:hover {
    transform: scale(1.02); /* Slight zoom on hover */
}

.section.collapsible h3 {
    cursor: pointer; /* Indicate interactivity with hand cursor */
    color: #2e7d32; /* Dark green text for headers */
    margin: 0;
    font-size: 1.5em;
    display: flex;
    justify-content: space-between; /* Space for expand/collapse icons */
    align-items: center;
    padding: 10px; /* Add padding around the text */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.section.collapsible h3:hover {
    background-color: #4caf50; /* Dark green background on hover */
    color: #fff; /* White text on hover */
    border-radius: 8px; /* Consistent with the section box */
}

.section.collapsible h3::after {
    content: "▼"; /* Down arrow as an HTML entity */
    font-size: 0.8em;
    color: #2e7d32;
    transition: transform 0.3s ease-in-out;
}

.section.collapsible h3.expanded::after {
    transform: rotate(180deg); /* Rotate arrow when expanded */
}
form label {
    font-size: 1.1em;
    margin: 10px 0;
    display: block;
    cursor: pointer;
}

form input[type="checkbox"] {
    margin-right: 10px;
}

.collapsible .content {
    display: none;
    max-height: 300px; /* Set maximum height for scrollable area */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 10px; /* Add padding for better readability */
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    background-color: #ffffff; /* Ensure readability */
    border-radius: 8px; /* Match the collapsible box design */
    max-height: 0;
    opacity: 0;
}

.collapsible .content.visible {
    display: block;
    max-height: 300px; /* Matches the scrollable area height */
    overflow-y: auto; /* Allows scrolling */
    opacity: 1;
}

form label small {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #555; /* Subtle gray color */
    font-style: italic;
}
