/* ===========================
    Root Variables
=========================== */
:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f8fafc;
  --accent: #facc15;
  --subtopic-bg: #334155;
  --hover: #facc15;
  --hover-text: #0f172a;
}

body.light-mode {
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #0f172a;
  --accent: #0ea5e9;
  --subtopic-bg: #cbd5e1;
  --hover: #0ea5e9;
  --hover-text: #ffffff;
}

/* ===========================
    Global Styles
=========================== */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

* {
  box-sizing: border-box;
}

/* ===========================
    Header (Hero Section in the original code, but applies to the overall page header structure)
=========================== */
header {
  background-color: var(--card-bg); /* This seems like a leftover from the original code that styled the hero as 'header' */
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 0 0 2rem 2rem;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  margin: 0;
}

header p {
  margin: 0.5rem 0 0;
}

.toggle-theme {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--accent);
}

.review-mode-toggle {
  position: absolute;
  left: 1rem;
  top: 1rem;
  background: var(--accent);
  color: var(--hover-text);
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 1rem;
  font-weight: bold;
  cursor: pointer;
}

/* ===========================
    Layout & Typography
=========================== */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

h2 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.search-box {
  text-align: center;
  margin-bottom: 2rem;
}

.search-box input {
  padding: 0.8rem 1.2rem;
  width: 80%;
  max-width: 500px;
  border-radius: 1rem;
  border: none;
  font-size: 1rem;
}

/* ===========================
    Form
=========================== */
form {
  max-width: 600px; /* Limit form width */
  margin: 0 auto; /* Center the form */
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

form input,
form textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--subtopic-bg);
  color: var(--text);
  margin-bottom: 1rem;
}

form button {
  background: var(--accent);
  color: var(--hover-text);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  font-weight: bold;
  cursor: pointer;
  display: block; /* Make button a block element to center it */
  margin: 1rem auto 0; /* Center the button */
}

/* ===========================
    Cards & Modules
=========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 1;
  cursor: pointer;
}

.card.zoomed {
  transform: scale(1.1);
  z-index: 10;
}

.card.dimmed {
  opacity: 0.4;
  transform: scale(0.95);
}

.review-mode .card {
  cursor: default;
  transform: none !important;
  opacity: 1 !important;
}

.card h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

/* ===========================
    Sub Topics
=========================== */
.sub-topics {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sub-topic {
  background-color: var(--subtopic-bg);
  padding: 0.4rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.sub-topic:hover {
  background-color: var(--hover);
  color: var(--hover-text);
}

.sub-topic-list {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 1rem;
}

.sub-topic-card {
  display: block;
  background-color: white;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.sub-topic-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ===========================
    Back to Top Button
=========================== */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--accent);
  color: var(--hover-text);
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 999;
}

#backToTop:hover {
  background-color: var(--hover);
}

/* ===========================
    Modal
=========================== */
#contactModal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  visibility: hidden;
}

.modal-content {
  background: white; /* This will be overridden by the more specific modal-content styles below */
  padding: 2rem;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.modal-content .close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===========================
    Main Header & Nav
=========================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #1e1e2f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
}

.main-header .logo {
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

.nav {
  flex-grow: 1; /* Allow nav to take available space */
  display: flex;
  justify-content: flex-end; /* Align nav items to the right */
  align-items: center;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem; /* Increased gap for better spacing */
  margin: 0; /* Remove default margin */
  padding: 0; /* Remove default padding */
}

.nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap; /* Prevent text wrapping */
}

.hamburger {
  display: none;
  cursor: pointer;
  margin-left: 1rem; /* Add some space between nav and hamburger */
}

.hamburger i {
  font-size: 1.5rem;
}

/* ===========================
    Hero Section (original .hero was unused, this refers to .hero-slider)
=========================== */
.hero-slider {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.hero-slider .slides {
  position: absolute;
  width: 100%;
  height: 100%;
}

.hero-slider .slide {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slider .slide.active {
  opacity: 1;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 2;
  width: 90%; /* Adjust width for better readability on smaller screens */
  max-width: 800px; /* Max width for hero text */
}

.hero-text h1 {
  font-size: 2.5rem; /* Adjusted from 3rem for better fit */
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #cbd5e1;
}

.cta-button {
  background-color: #facc15; /* Adjusted to your theme's accent color */
  color: #0f172a; /* Adjusted to text color that contrasts with accent */
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 8px;
  margin-top: 10px;
  display: inline-block;
  font-weight: bold; /* Added bold */
}

.cta-button:hover {
  background-color: #fde68a; /* Lighter hover color */
  color: #1e293b; /* Darker text on hover */
}

/* ===========================
    Footer
=========================== */
.footer {
  background: #1e1e2f;
  color: #ccc;
  padding: 2rem 1rem;
  text-align: center;
}

.footer .socials a {
  margin: 0 10px;
  color: #ccc;
  font-size: 1.2rem;
}

.footer .socials a:hover {
  color: #fff;
}

/* ===========================
    Responsive
=========================== */
@media (max-width: 768px) {
  .nav ul {
    display: none;
    flex-direction: column;
    background: #1e1e2f;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    padding: 1rem;
    align-items: flex-start; /* Align mobile nav items to start */
  }

  .nav.open ul {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  /* Adjust header padding for smaller screens */
  .main-header {
    padding: 0.8rem 1rem;
  }
}

/* Specific modal content styling */
#contactModal .modal-content {
  background: #0d1117;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 450px;
  width: 90%;
  margin: auto;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  color: var(--text); /* Ensure text color is set for modal content */
}

#contactModal .modal-content h2 {
  text-align: center;
  color: #facc15;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

#contactModal input,
#contactModal textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 10px;
  background: #2d3748;
  color: white;
  font-size: 1rem;
}

#contactModal input::placeholder,
#contactModal textarea::placeholder {
  color: #a0aec0;
}

#contactModal button[type="submit"] {
  display: block;
  width: fit-content;
  margin: auto;
  background-color: #facc15;
  color: #1a202c;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 9999px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#contactModal button[type="submit"]:hover {
  background-color: #fbbf24;
}

#contactModal .close { /* Changed from .close-btn to .close as in HTML */
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}

textarea {
    resize: none; /* Prevents both horizontal and vertical resizing */
}
/* --- Styles for Web Development Sub-Topic Links (e.g., Java Full Stack, Python Full Stack) --- */

.sub-topic a {
    color: #00E676; /* Vibrant Green for normal state */
    text-decoration: none; /* Removes the default underline */
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

.sub-topic a:visited {
    color: #00E676; /* Ensures the color stays vibrant green even after visiting */
}

.sub-topic a:hover {
    color: #64FFDA; /* A slightly lighter, more aqua green on hover */
    text-decoration: underline; /* Adds an underline on hover for clear feedback */
}


/* Scrolling Banner */
.scrolling-banner {
  background: #005392;
  color: #fff;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1000;
}

.scrolling-text {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 40s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}


/* --- End of Sub-Topic Link Styles --- *
