/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Public Sans', sans-serif;
}

/* 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 content */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  text-align: center;
  color: #007bff;
  margin-bottom: 1rem;
}

h2 {
  color: #0b3d91;
  margin-top: 1.5rem;
}

/* Problem section */
.problem-section {
  background-color: #f0f8ff;
  padding: 15px 20px;
  border-left: 5px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

/* Approach sections */
.approach-section {
  background-color: #fff4e6;
  padding: 15px 20px;
  border-left: 5px solid #ffa500;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.approach-section p {
  margin: 0.5rem 0;
}

/* Pseudo code */
.pseudo-code {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 12px 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-top: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}
/* Right side container (links + snake button) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* space between links and button */
}

/* View Flowchart Button */
.flowchart-btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #f5c686, #ffcc70, #ffd9a6);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  margin-bottom: 50px;
}

/* Hover effect */
.flowchart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  background: linear-gradient(90deg, #ffd9a6, #ffcc70, #ffb347);
}

/* Active/Focused */
.flowchart-btn:active,
.flowchart-btn:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}
.flowchart-img {
  max-width: 100%;
  height: 650px; /* adjust this value as needed */
  object-fit: contain; /* ensures the image scales without distortion */
  display: block;
  margin: 0px auto 40px auto;
  border-radius: 8px; /* optional, makes corners slightly rounded */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* optional, subtle shadow */
}

/* 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;
}
/* Dark Mode - All content boxes */
body.dark-mode .content-box,
body.dark-mode .info-box,
body.dark-mode .section-box {
  background-color: #2d2d44;
  color: #e0e0e0;
  border-color: rgba(187, 134, 252, 0.3);
}

/* Dark Mode - Input/Output examples */
body.dark-mode .input-output,
body.dark-mode .example-input,
body.dark-mode .example-output {
  background-color: #1f1f33;
  color: #e0e0e0;
  border-left: 3px solid #bb86fc;
}
/* Dark Mode - About Page Content */
body.dark-mode .about-container,
body.dark-mode .about-content {
  background-color: rgba(45, 45, 68, 0.6);
  color: #e0e0e0;
}

body.dark-mode .about-content h1,
body.dark-mode .about-content h2 {
  color: #bb86fc;
}

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

/* Dark Mode - Feature boxes with checkmarks */
body.dark-mode .feature-item {
  background-color: rgba(45, 45, 68, 0.4);
  color: #e0e0e0;
}


body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body.dark-mode .problem-container {
  color: #e0e0e0;
}


/* Dark Mode - Problem Statement box text color fix only */
body.dark-mode .problem-statement p,
body.dark-mode .problem-statement span,
body.dark-mode .problem-statement li {
  color: #000 !important;
}

body.dark-mode .problem-statement h2 {
  color: #0056b3 !important;
}

body.dark-mode .problem-statement strong,
body.dark-mode .problem-statement .example {
  color: #d32f2f !important;
}
/* Dark Mode - Problem Section (correct class name) */
body.dark-mode .problem-section {
  background-color: #f0f8ff;  /* keep white background */
  color: #000;  /* black text */
}

body.dark-mode .problem-section h2 {
  color: #0b3d91 !important;  /* keep original blue */
}

body.dark-mode .problem-section p,
body.dark-mode .problem-section span,
body.dark-mode .problem-section li {
  color: #000 !important;  /* black text */
}

body.dark-mode .problem-section strong {
  color: #d32f2f !important;  /* red for emphasis */
}
.flowchart-container {
  display: none;
  margin-top: 10px;
  padding: 15px;
  border: 1px solid #ccc;
  background: #f8f8f8;
}
.flowchart-container.active {
  display: block;
}
.toggle-btn {
  background: linear-gradient(90deg, #f5c686, #ffcc70, #ffd9a6);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
}

.copyToClipboard {
  background-color: #007bff;      
  color: #fff;                     
  border: none;                    
  border-radius: 6px;              
  padding: 8px 16px;              
  font-size: 14px;                 
  cursor: pointer;                 
  transition: background-color 0.3s, transform 0.1s;
  margin-top: 8px;                 
  display: inline-block;
}

.copyToClipboard:hover {
  background-color: #0056b3;      
  transform: scale(1.03);          
}

.copyToClipboard:active {
  transform: scale(0.97);         
}

.copyToClipboard:focus {
  outline: 2px solid #80bdff;      
  outline-offset: 2px;
}

body.dark-mode .copyToClipboard {
  background-color: #444;
  color: #fff;
}

body.dark-mode .copyToClipboard:hover {
  background-color: #666;
}
