/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Public Sans', sans-serif;
}
/* Anchor tag reset */
a,
a:link,
a:visited {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: linear-gradient(
    90deg,
    #fbb69f,
    #f68c6e,
    #f16363
  ); /* warm, soft professional gradient */
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px; /* space between logo and text */
}

.logo-img img {
  height: 50px;
  width: 50px;
}
.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.navbar .nav-links li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar .nav-links li a:hover {
  color: #ffe5d4; /* subtle highlight */
}

/* Navbar Buttons */
.navbar .nav-links li a {
  display: inline-block;
  padding: 8px 20px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  border-radius: 5px; /* rounded pill shape */
  background: linear-gradient(
    90deg,
    #f5c686,
    #ffcc70,
    #ffd9a6
  ); /* warm professional gradient */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s,
    background 0.3s;
}

/* Hover effect */
.navbar .nav-links li a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  background: linear-gradient(
    90deg,
    #ffd9a6,
    #ffcc70,
    #ffb347
  ); /* subtle gradient shift */
}

/* Optional active button style */
.navbar .nav-links li a.active {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  background: linear-gradient(90deg, #ffcc70, #ffb347, #ffd9a6);
}

.navbar .logo {
  font-size: 1.7rem;
  font-weight: bold;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  background: linear-gradient(90deg, #fbb69f, #f68c6e, #f16363);
  color: #fff;
  margin-top: 3rem;
  font-size: 0.95rem;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }
}

main {
  padding: 3rem 2rem;
  background: #faf7f5;
  text-align: center;
}

main h1 {
  color: #f16363;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

main .intro-text {
  color: #555;
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.topic-list {
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

.topic-list a {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #ffe6bf, #fff3ee);
  border-left: 5px solid #f7b259;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.topic-list a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  background: linear-gradient(90deg, #fcc688, #fff8f5);
}

.topic-number {
  font-weight: bold;
  color: #f68c6e;
  flex-shrink: 0;
}

.topic-completed {
  font-weight: bold;
  color: #f68c6e;
  min-width: 1.5ch;  
}

.topic-name {
  font-weight: 600;
  color: #f16363;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.topic-desc {
  color: #555;
  font-size: 0.95rem;
  margin-left: auto;
  text-align: right;
}

/* Progress bar container */
#topic-progress-bar {
  max-width: 800px;
  height: 50px;
  position: relative;
  padding: 0;
  margin: 0 auto 3rem auto;
  background: transparent;
  border: 5px solid #f7b259;
  border-radius: 10px;
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

/* Progress fill */
#topic-progress {
  display: flex;
  height: 100%; 
  width: 0%;
  background:#fcc688;
  /* border-radius: 5px; */
  font-weight: 600;
  font-size: 1.1rem;
  color: #f16363;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
}

/* Progress text */
#topic-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 1.1rem;
  color: #f16363;
  pointer-events: none;
  z-index: 2;
}

/* Style for the intro paragraph */
.intro-text {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1.5rem;
}

.pattern-coverage {
  background-color: #f0f8ff;
  border-left: 5px solid #007bff;
  padding: 15px 20px;
  margin: 2rem auto; /* auto left/right margin for horizontal centering */
  font-size: 1rem;
  line-height: 1.6;
  color: #0b3d91;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center; /* center the text inside */
  max-width: 800px; /* optional: prevent it from being too wide */
}

.pattern-coverage .pattern-name {
  font-weight: bold;
  color: #007bff;
}

.pattern-coverage .pattern-desc {
  font-style: italic;
  color: #0b3d91;
}

.pattern-coverage .highlight {
  font-weight: bold;
  color: #d63384; /* a contrasting color for emphasis */
}
/* Right side container (links + snake button) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* space between links and button */
}

/* Dark Mode Toggle Button */
.dark-mode-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.dark-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.dark-mode-btn.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Dark Mode Styles */
body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e0e0e0;
  transition: all 0.4s ease;
}

body.dark-mode main {
  background: transparent;
}

body.dark-mode main h1 {
  color: #bb86fc;
  text-shadow: 0 0 20px rgba(187, 134, 252, 0.3);
}

body.dark-mode main h1::after {
  background: linear-gradient(90deg, #bb86fc, #cf6679, #03dac6, #bb86fc);
  background-size: 300% 100%;
}

/* Dark Mode Navbar */
body.dark-mode .navbar {
  background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
  box-shadow: 0 4px 20px rgba(106, 17, 203, 0.4);
}

body.dark-mode .navbar .nav-links li a {
  background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
  background-size: 200% 100%;
}

body.dark-mode .navbar .nav-links li a:hover {
  background: linear-gradient(90deg, #764ba2, #667eea, #764ba2);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* Dark Mode Cards */
body.dark-mode .card {
  background: linear-gradient(145deg, #2d2d44, #1f1f33);
  color: #e0e0e0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(187, 134, 252, 0.2);
}

body.dark-mode .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(187, 134, 252, 0.4);
  border-color: rgba(187, 134, 252, 0.5);
}

body.dark-mode .card h3 {
  color: #bb86fc;
}

body.dark-mode .card p {
  color: #b0b0b0;
}

/* Dark Mode Footer */
body.dark-mode footer {
  background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
  box-shadow: 0 -4px 20px rgba(106, 17, 203, 0.3);
}

/* Dark Mode Recently Viewed Sidebar */
body.dark-mode .recently-viewed-sidebar {
  background-color: #2d2d44;
  border: 1px solid rgba(187, 134, 252, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

body.dark-mode .recently-viewed-sidebar h2 {
  color: #bb86fc;
}

body.dark-mode .recently-viewed-sidebar:hover h2 {
  border-bottom-color: #bb86fc;
}

body.dark-mode #recently-viewed-list a {
  color: #03dac6;
}

body.dark-mode #recently-viewed-list a:hover {
  color: #bb86fc;
}

body.dark-mode #clear-history-btn {
  border-color: #cf6679;
  color: #cf6679;
}

body.dark-mode #clear-history-btn:hover {
  background-color: #cf6679;
  color: white;
}
/* Dark Mode - Problem Statement Box */
body.dark-mode .problem-statement,
body.dark-mode .problem-box,
body.dark-mode .approach-box,
body.dark-mode .approach-section {
  background-color: #2d2d44;
  color: #e0e0e0;
  border: 1px solid rgba(187, 134, 252, 0.3);
}

body.dark-mode .problem-statement h2,
body.dark-mode .problem-statement h3,
body.dark-mode .approach-box h2,
body.dark-mode .approach-box h3 {
  color: #bb86fc;
}

body.dark-mode .problem-statement p,
body.dark-mode .approach-box p,
body.dark-mode .explanation,
body.dark-mode .time-complexity,
body.dark-mode .space-complexity {
  color: #b0b0b0;
}

/* Dark Mode - Code Blocks */
body.dark-mode pre,
body.dark-mode code {
  background-color: #1a1a2e;
  color: #03dac6;
  border: 1px solid rgba(187, 134, 252, 0.2);
}

/* Dark Mode - Breadcrumb Navigation */
body.dark-mode .breadcrumb,
body.dark-mode .breadcrumb a {
  color: #b0b0b0;
}

body.dark-mode .breadcrumb a:hover {
  color: #bb86fc;
}

/* Dark Mode - Example text */
body.dark-mode .example,
body.dark-mode .example-text {
  color: #e0e0e0;
}

/* Dark Mode - Highlighted text (like "structured learning path") */
body.dark-mode strong,
body.dark-mode b,
body.dark-mode .highlight {
  color: #cf6679;
}

/* Dark Mode - Lists */
body.dark-mode ul li,
body.dark-mode ol li {
  color: #b0b0b0;
}

/* Dark Mode - Checkmark icons in features */
body.dark-mode .features li::before,
body.dark-mode .key-features li::before {
  color: #03dac6;
}