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

/* Body Background */
body {
  background: #faf7f5;
  min-height: 100vh;
}


/* 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);
}
/* Main content sections */
/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: linear-gradient(90deg, #fbb69f, #f68c6e, #f16363);
  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 {
  display: inline-block;
  padding: 8px 20px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  border-radius: 5px;
  background: linear-gradient(90deg, #f5c686, #ffcc70, #ffd9a6);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s,
    background 0.3s;
}

.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);
}

.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;
}

/* Right side container (links + snake button) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Main Content */

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* Contact Section */
.contact-section {
  background: #ffffff;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbb69f, #f68c6e, #f16363);
  background-size: 300% 100%;
  animation: moveLine 3s linear infinite;
}

@keyframes moveLine {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 0%;
  }
}

/* Contact Header */
.contact-header {
  text-align: center;
  margin-bottom: 2rem;
}

.contact-header h1 {
  font-size: 2.8rem;
  color: #f16363;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.contact-header h1::after {
  content: '';
  display: block;
  height: 3px;
  width: 60%;
  border-radius: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, #ffb347, #ffcc70, #ffd9a6);
}

.contact-description {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Contact Container */
.contact-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* Contact Form */
.contact-form {
  background: #faf9f8;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(251, 182, 159, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #f16363;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e8e6e3;
  border-radius: 10px;
  font-size: 1rem;
  background: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #f68c6e;
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(246, 140, 110, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #aaa;
  font-style: italic;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Input Focus Border Animation */
.input-focus-border {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #f68c6e, #f16363);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.form-group input:focus + .input-focus-border,
.form-group textarea:focus + .input-focus-border {
  width: 100%;
}

/* Submit Button */
.form-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.submit-btn {
  background: linear-gradient(135deg, #f68c6e, #f16363);
  color: #ffffff;
  border: none;
  padding: 0.9rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 25px rgba(246, 140, 110, 0.3);
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(246, 140, 110, 0.4);
  background: linear-gradient(135deg, #f16363, #e55a5a);
}

.submit-btn:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
  transform: translateX(5px);
}

/* Contact Info */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: linear-gradient(135deg, #ffffff, #faf9f8);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(251, 182, 159, 0.2);
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  border-color: rgba(246, 140, 110, 0.3);
}

.info-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.info-card h3 {
  color: #f16363;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.info-card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, text-decoration 0.2s;
  padding: 0.5rem;
  border-radius: 4px;
}

.footer-links a:hover,
.footer-links a:focus {
  color: #ffe5d4;
  outline: 2px solid #ffe5d4;
  outline-offset: 2px;
}

.footer-links a:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-info {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .info-card {
    flex: 1;
    min-width: 250px;
  }
}

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

  main {
    padding: 0 1rem;
  }

  .contact-section {
    padding: 2rem;
  }

  .contact-header h1 {
    font-size: 2.2rem;
  }

  .contact-form {
    padding: 2rem;
  }

  .contact-info {
    flex-direction: column;
  }

  .submit-btn {
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .contact-section {
    padding: 1.5rem;
  }

  .contact-header h1 {
    font-size: 1.8rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.8rem 1rem;
  }

  .submit-btn {
    padding: 0.8rem 2rem;
    width: 100%;
  }
}

/* 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;
}