/* ================================
   🎀 THEME VARIABLES
================================ */
:root {
  /* Light theme (default) */
  --bg-main: linear-gradient(180deg, #fff0f6, #ffe6f0);
  --bg-card: #ffffff;
  --bg-header: rgba(248, 242, 244, 0.75);

  --pink-accent: #f4a6c1;
  --pink-dark: #e88aaa;
  --pink-hot: #ff4d88;

  --text-main: #2b2b2b;
  --text-muted: rgba(0, 0, 0, 0.7);

  --shadow-soft: 0 8px 25px rgba(0, 0, 0, 0.06);
}

/* 🌙 Dark theme */
body.dark {
  --bg-card: linear-gradient(180deg, #19000d, #0e0e0e);
  --bg-main: #000000;
  --bg-header: rgba(20, 0, 10, 0.8);

  --text-main: #ffd6e6;
  --text-muted: rgba(255, 214, 230, 0.75);
  
  --pink-accent: #b8527b;
  --pink-dark: #ffd6e6;
}

/* ================================
   🌸 RESET & BASE
================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background 0.6s ease, color 0.6s ease;
  overflow-x: hidden;
}

/* Link styling for light mode */
a {
  color: var(--pink-dark);
  text-decoration: underline;
}

a:hover {
  color: var(--pink-hot);
  text-decoration: underline;
}

/* Link styling for dark mode */
body.dark a {
  color: var(--text-main); /* Light pink text color */
  text-decoration: underline;
}

body.dark a:hover {
  color: var(--pink-accent);
  text-decoration: underline;
}

section {
  padding: 80px 8%;
}

/* ================================
   ✨ TYPOGRAPHY
================================ */
h1 {
  font-size: 3rem;
  font-family: 'Baloo 2';
  font-weight: 100;
}

h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 40px;
}

h3 {
  font-family: 'Playfair Display', serif;
}

p {
  color: var(--text-muted);
}

/* Decorative cursive */
.bow,
.divider,
.logo-text {
  font-family: 'Allura', cursive;
}

/* ================================
   🎀 HEADER
================================ */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 14px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;

  backdrop-filter: blur(10px);
  background: var(--bg-header);
  transition: background 0.4s ease;
  
  /* Ensure navbar is always visible */
  visibility: visible;
  opacity: 1;
}

.logo {
  display: flex;
  align-items: center;
  /* Position logo in top-left corner for desktop */
  top: 10px;
  left: 20px;
}

.logo-emoji {
  font-size: 2rem;
  margin-left: 10px;
}

.logo-text {
  font-size: 1.8rem;
  color: var(--pink-hot);
}

/* Hamburger Menu Button (Hidden on Desktop) */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  z-index: 1050;
}

.hamburger:hover {
  background-color: rgba(244, 166, 193, 0.2);
}

/* Navigation - Desktop */
.nav-links {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 30px;
  transition: transform 0.3s ease;
}

/* Hide theme toggle container on desktop */
.theme-toggle-container {
  display: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: inherit;
  position: relative;
  transition: color 0.3s ease;
}

/* Remove underlines from desktop navbar links in dark mode */
body.dark .nav-links a {
  text-decoration: none;
}

body.dark .nav-links a:hover {
  text-decoration: none;
}

/* Close button (Hidden on Desktop) */
.close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  align-self: flex-end;
  margin-bottom: 20px;
  z-index: 1002;
  position: relative;
}

/* Overlay (Hidden on Desktop) */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
}

/* Cute underline */
.nav-links a::after {
  content: "♡";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  font-size: 0.8rem;
  color: var(--pink-hot);
  transition: 0.3s;
}

.nav-links a:hover::after {
  opacity: 1;
}

/* ================================
   🌷 HERO
================================ */
.hero {
  min-height: 100vh;
  padding-top: 120px; /* header offset */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-card {
  background: var(--bg-card);
  padding: 60px;
  border-radius: 30px;
  max-width: 700px;
  box-shadow: var(--shadow-soft);
  transition: background 0.5s;
}

.hero p {
  margin: 20px 0;
  font-size: 1.1rem;
}

/* ================================
   🌸 CTA BUTTONS
================================ */
.cta {
  margin-top: 30px;
}

.cta a {
  display: inline-block;
  margin: 10px;
  padding: 12px 28px;
  background: var(--pink-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: 0.3s;
}

.cta a:hover {
  background: var(--pink-dark);
  transform: translateY(-2px);
}

/* Remove underlines from CTA buttons in dark theme */
body.dark .cta a {
  text-decoration: none;
}

body.dark .cta a:hover {
  text-decoration: none;
}

/* ================================
   🩰 GRID & CARDS
================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.card,
.project-card {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 25px;
  box-shadow: var(--shadow-soft);
  transition: 0.3s;
}

.card:hover,
.project-card:hover {
  transform: translateY(-6px);
}

/* ================================
   🎀 DIVIDERS
================================ */
.bow {
  color: var(--pink-dark);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.divider {
  text-align: center;
  font-size: 2.8rem;
  color: var(--pink-dark);
  margin: 40px 0;
}

/* ================================
   💗 CONTACT
================================ */
#contact {
  text-align: center;
}

.contact-icons {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.contact-item {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: 0.3s;
}

.contact-item .icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
  transition: 0.3s;
}

.contact-item p {
  font-size: 0.9rem;
  letter-spacing: 1px;
  opacity: 0.85;
  text-decoration: none; /* Remove underline from text by default */
  transition: 0.3s;
}

.contact-item:hover .icon {
  transform: scale(1.3) rotate(-6deg);
  text-shadow: 0 0 12px rgba(255, 77, 136, 0.6);
}

/* Enhanced glow effect for dark mode */
body.dark .contact-item:hover .icon {
  text-shadow: 
    0 0 12px rgba(255, 77, 136, 0.8),
    0 0 24px rgba(255, 77, 136, 0.4),
    0 0 36px rgba(255, 77, 136, 0.2);
}

.contact-item:hover p {
  color: var(--pink-hot);
  text-decoration: underline; /* Add underline only to text on hover */
}

/* Remove underlines from contact items completely */
.contact-item,
.contact-item:hover {
  text-decoration: none;
}

/* Dark theme contact item styling */
body.dark .contact-item {
  text-decoration: none;
}

body.dark .contact-item:hover {
  text-decoration: none;
}

body.dark .contact-item p {
  text-decoration: none; /* Remove underline from text by default in dark theme */
}

body.dark .contact-item:hover p {
  color: var(--pink-hot);
  text-decoration: underline; /* Add underline only to text on hover in dark theme */
}

/* ================================
   🌙 THEME TOGGLE SLIDER (IN SIDEBAR)
================================ */
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 40px);
  margin: 20px 20px;
  padding: 15px 20px;
  background: rgba(244, 166, 193, 0.1);
  border-radius: 25px;
  border: 1px solid rgba(244, 166, 193, 0.2);
}

.theme-icon {
  font-size: 1.5rem;
  margin-right: 15px;
  transition: all 0.3s ease;
}

.theme-slider {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.theme-slider input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--pink-accent); /* Light pink for light theme */
  transition: 0.4s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--pink-hot); /* Brighter pink when toggled in light theme */
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* Dark mode slider colors */
body.dark .slider {
  background-color: var(--pink-dark); /* Dark pink for dark theme */
}

body.dark input:checked + .slider {
  background-color: var(--pink-accent); /* Lighter pink when toggled in dark theme */
}

/* Desktop Theme Toggle */
.desktop-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  border: none;
  background: var(--pink-dark);
  color: #fff;
  border-radius: 50%;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 1100;
  display: block;
}

/* Hide desktop theme toggle on mobile */
@media (max-width: 768px) {
  .desktop-theme-toggle {
    display: none;
  }
}

/* ================================
   📱 RESPONSIVE
================================ */
@media (max-width: 768px) {
  /* Header adjustments */
  .site-header {
    padding: 14px 20px;
    justify-content: flex-start;
    position: fixed; /* Ensure it stays fixed */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Lower than sidebar */
    background: var(--bg-header);
    backdrop-filter: blur(10px);
  }

  /* Show hamburger menu on the left */
  .hamburger {
    display: block;
    position: relative;
    margin-right: auto;
  }

  /* Center the logo on mobile only */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010; /* Ensure it's clickable above other elements */
  }

  .logo a {
    display: block;
    padding: 5px; /* Add some padding for easier clicking */
  }

  /* Hide desktop navigation and transform to mobile sidebar - LEFT SIDE */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0; /* Changed from right: 0 to left: 0 */
    height: 100vh;
    width: 50vw; /* Changed from 280px to 50% of viewport width */
    max-width: 300px; /* Maximum width limit */
    min-width: 250px; /* Minimum width for usability */
    background: var(--bg-card);
    flex-direction: column;
    justify-content: flex-start;
    padding: 0; /* Remove padding to control spacing better */
    transform: translateX(-100%); /* Changed from translateX(100%) to translateX(-100%) */
    transition: transform 0.3s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1); /* Changed shadow direction */
    z-index: 1100; /* Higher than header - sidebar overlaps everything */
    overflow-y: auto;
  }

  /* Sidebar content wrapper */
  .nav-links > * {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Show sidebar when active */
  .nav-links.show {
    transform: translateX(0);
  }

  /* Show close button in mobile - positioned at top right of sidebar */
  .close-btn {
    display: block;
    position: sticky; /* Changed from absolute to sticky */
    top: 15px; /* Back to original position since sidebar overlaps header */
    right: 15px;
    margin-bottom: 20px;
    margin-left: auto; /* Push to right side */
    background-color: rgba(244, 166, 193, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1101; /* Higher than sidebar */
  }

  .close-btn:hover {
    background-color: rgba(244, 166, 193, 0.3);
  }

  /* Show theme toggle in mobile sidebar */
  .theme-toggle-container {
    display: flex;
  }

  .close-btn:hover {
    background-color: rgba(244, 166, 193, 0.3);
  }

  /* Show overlay in mobile */
  .overlay {
    display: block;
  }

  /* Mobile navigation links styling */
  .nav-links a {
    margin: 0;
    margin-bottom: 20px;
    padding: 12px 20px; /* Added left and right padding */
    font-size: 1.1rem;
    width: calc(100% - 40px); /* Adjust width to account for padding */
    border-bottom: 1px solid rgba(244, 166, 193, 0.2);
    transition: color 0.3s ease, padding-left 0.3s ease;
    margin-left: 20px; /* Add left margin for spacing from edge */
  }

  .nav-links a:first-of-type {
    margin-top: 10px; /* Small space after theme toggle */
  }

  .nav-links a:hover {
    color: var(--pink-hot);
    padding-left: 30px; /* Increase left padding on hover for nice effect */
  }

  /* Remove cute underline on mobile */
  .nav-links a::after {
    display: none;
  }

  /* Remove underlines from sidebar navigation in dark theme */
  body.dark .nav-links a {
    text-decoration: none;
  }

  body.dark .nav-links a:hover {
    text-decoration: none;
  }

  /* Hero section adjustments */
  h1 {
    font-size: 2.3rem;
  }

  .hero-card {
    padding: 40px 30px;
    margin: 0 20px;
  }

  /* Contact icons responsive */
  .contact-icons {
    gap: 40px;
  }

  /* Grid adjustments */
  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Section padding adjustments */
  section {
    padding: 60px 5%;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 12px 15px;
  }

  /* Ensure hamburger button is visible on small screens */
  .hamburger {
    display: block;
    position: relative;
    margin-right: auto;
  }

  /* Center the logo on mobile only */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;
    margin-left: 0; /* Reset margin for mobile */
  }

  .logo a {
    display: block;
    padding: 5px;
  }

  /* Keep sidebar responsive - don't override the mobile navigation */
  .nav-links {
    width: 60vw; /* Slightly wider on very small screens */
    max-width: 280px; /* Smaller max width for tiny screens */
    min-width: 200px; /* Smaller min width for tiny screens */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    overflow-y: auto;
  }

  /* Show sidebar when active */
  .nav-links.show {
    transform: translateX(0);
  }

  /* Show close button in mobile */
  .close-btn {
    display: block;
    position: sticky;
    top: 15px;
    right: 15px;
    margin-bottom: 20px;
    margin-left: auto;
    background-color: rgba(244, 166, 193, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1101;
  }

  .close-btn:hover {
    background-color: rgba(244, 166, 193, 0.3);
  }

  /* Show overlay in mobile */
  .overlay {
    display: block;
  }

  /* Mobile navigation links styling */
  .nav-links a {
    margin: 0;
    margin-bottom: 20px;
    padding: 12px 20px;
    font-size: 1.1rem;
    width: calc(100% - 40px);
    border-bottom: 1px solid rgba(244, 166, 193, 0.2);
    transition: color 0.3s ease, padding-left 0.3s ease;
    margin-left: 20px;
  }

  .nav-links a:first-of-type {
    margin-top: 10px; /* Small space after theme toggle */
  }

  .nav-links a:hover {
    color: var(--pink-hot);
    padding-left: 30px;
  }

  /* Remove cute underline on mobile */
  .nav-links a::after {
    display: none;
  }

  /* Remove underlines from sidebar navigation in dark theme */
  body.dark .nav-links a {
    text-decoration: none;
  }

  body.dark .nav-links a:hover {
    text-decoration: none;
  }

  .hero-card {
    padding: 30px 20px;
    margin: 0 10px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .contact-icons {
    gap: 30px;
  }

  .contact-item .icon {
    font-size: 2rem;
  }
}

/* ================================
   ✨ ANIMATED CURSIVE
================================ */
.bow,
.divider {
  animation: cursiveFloat 4s ease-in-out infinite,
             cursiveGlow 3s ease-in-out infinite alternate;
}

@keyframes cursiveFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes cursiveGlow {
  from { text-shadow: 0 0 6px rgba(255, 77, 136, 0.3); }
  to   { text-shadow: 0 0 14px rgba(255, 77, 136, 0.7); }
}

/* ================================
   ✨ FOOTER
================================ */    
footer {
      text-align: center;
      padding: 40px;
      font-size: 0.9rem;
      opacity: 0.8;
    }

/* ================================
   📱 Collapsible Navbar (Mobile)
================================ */

/* Accessibility improvements */
.hamburger:focus,
.close-btn:focus {
  outline: 2px solid var(--pink-hot);
  outline-offset: 2px;
}

/* Smooth transitions for better UX */
.nav-links a {
  transition: all 0.3s ease;
}

/* Focus states for mobile navigation */
@media (max-width: 768px) {
  .nav-links a:focus {
    outline: 2px solid var(--pink-hot);
    outline-offset: 2px;
    background-color: rgba(244, 166, 193, 0.1);
    border-radius: 4px;
  }
}

/* ---------------------------
   Desktop-only layout tweaks
   - hide mobile slider on desktop
   - pin swan logo top-left on desktop
   - pin desktop theme button top-right
---------------------------- */

/* Apply only for desktop widths */
@media (min-width: 769px) {
  /* Ensure the mobile slider container (in sidebar) is hidden on desktop */
  .theme-toggle-container {
    display: none !important;
  }

  /* Position logo at top-left (desktop) */
  .logo {
    position: fixed;
    top: 18px;
    left: 20px;
    transform: none; /* remove any centering transform */
    z-index: 1200;
  }

  /* Move desktop theme button to top-right */
  .desktop-theme-toggle {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 1250;
    display: block; /* ensure visible on desktop */
  }

  /* Hide the hamburger on desktop (safety) */
  .hamburger {
    display: none !important;
  }

  /* Ensure the nav stays centered/inline on desktop */
  .nav-links {
    transform: none !important;
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  /* If your .logo was centered on mobile via absolute centering, remove those transforms for desktop */
  .logo a {
    display: inline-block;
  }
}

/* For mobile (keep slider visible in the sidebar) */
@media (max-width: 768px) {
  .theme-toggle-container {
    display: flex !important;
  }

  /* center logo on small screens (existing rules preserved) */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;
  }

  /* hide desktop-themed button on mobile (if not already) */
  .desktop-theme-toggle {
    display: none !important;
  }
}

@media (min-width: 769px) {
  body.dark .nav-links a::after {
    opacity: 0 !important;
  }
}
