/* ===== BASE STYLES ===== */
html,
body,
div,
span,
h1,
h2,
h3,
p,
a,
nav,
header,
section,
ul,
li,
footer {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light Mode */
  --bg-light: #ffffff;
  --text-light: #2d2d2d;
  --accent-light: #8e24aa;
  --hero-overlay-light: rgba(255, 255, 255, 0.1);

  /* Dark Mode */
  --bg-dark: #121212;
  --text-dark: #f0f0f0;
  --accent-dark: #ab47bc;
  --hero-overlay-dark: rgba(0, 0, 0, 0.5);

  /* Active Theme */
  --current-bg: var(--bg-light);
  --current-text: var(--text-light);
  --current-accent: var(--accent-light);
  --current-hero-overlay: var(--hero-overlay-light);
}

body {
  font-family: "Montserrat", "Open Sans", sans-serif;
  background: var(--current-bg);
  color: var(--current-text);
  transition: background 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

button,
[class*="btn"] {
  font-family: sans-serif;
}

.dark-mode {
  --current-bg: var(--bg-dark);
  --current-text: var(--text-dark);
  --current-accent: var(--accent-dark);
  --current-hero-overlay: var(--hero-overlay-dark);
}

@keyframes animate-gradient-border {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== HEADER ===== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-bottom: 3px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
}

.main-header.scrolled {
    background-color: rgba(26, 26, 26, 0.85); /* Dark mode bg */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body:not(.dark-mode) .main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.main-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ab47bc, #8e24aa, #7147BB, #ab47bc);
  background-size: 200% 100%;
  animation: animate-gradient-border 8s linear infinite;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-links-left {
    position: absolute;
    left: 2rem;
    display: flex;
    gap: 40px;
}

.nav-links-right {
    position: absolute;
    right: 2rem;
    display: flex;
    gap: 40px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--current-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link {
  color: var(--current-text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  opacity: 0.9;
  transition: opacity 0.3s ease, color 0.3s ease;
  font-size: 16px;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--current-accent);
  transition: width 0.3s ease;
}

.nav-link:hover {
  opacity: 1;
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== GLOBAL BUTTON STYLES ===== */
.btn-primary {
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    background: #6a3ab2;
    color: white;
    cursor: pointer;
    display: inline-block;
}
.btn-primary:hover {
    background: #7b47d1;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(123, 71, 209, 0.3);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 55px;
  height: 55px;
  background: var(--current-accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  font-size: 1.4em;
  z-index: 1001;
}

.dark-mode .theme-toggle {
  background: var(--current-accent);
}

.theme-toggle:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.theme-tooltip {
  position: absolute;
  right: 70px;
  background: var(--current-accent);
  color: white;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.9em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  transform: none;
  z-index: 1001;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover .theme-tooltip {
  opacity: 1;
}


/* ===== FOOTER ===== */
.main-footer-bottom {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 30px 5%;
    border-top: 1px solid #dee2e6;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--current-accent);
}

/* Dark Mode Footer */
.dark-mode .main-footer-bottom {
    background-color: #1c1529;
    color: #a0a0a0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .footer-links a {
    color: #a0a0a0;
}


/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        height: 60px;
    }
    .nav-links-left {
        left: 1rem;
        gap: 20px;
    }
    .nav-links-right {
        right: 1rem;
        gap: 20px;
    }
    .logo {
        font-size: 24px;
    }
    .navbar .nav-link {
        display: none;
    }
    .nav-links-left a:first-child,
    .nav-links-right a:last-child {
        display: block;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        margin-top: 10px;
    }
    .footer-links a {
        margin: 0 10px;
    }
}
@media (max-width: 480px) {
    .theme-toggle {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}