/* css/main.css – Final version with mobile theme toggle fix */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 10px 25px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --border: #334155;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.4s, color 0.4s;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(99,102,241,0.3);
}

/* ==================== HEADER ==================== */
.header {
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s;
}

.header.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(15,23,38,0.95);
}

.header .container {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
  height: 70px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 10;
}

/* Theme Toggle – Always visible, even on mobile */
.theme-toggle {
  cursor: pointer;
  font-size: 1.3rem;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s;
  z-index: 10;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
}

/* Mobile: place theme toggle between logo and hamburger */
@media (max-width: 768px) {
  .theme-toggle {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.45rem;
    padding: 10px;
  }
}

/* Desktop: keep it nicely spaced */
@media (min-width: 769px) {
  .theme-toggle {
    margin-left: 2rem;
  }
}

/* Navigation */
.nav {
  z-index: 9;
}

.nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-list a {
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: color 0.3s;
}

.nav-list a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--primary);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

/* Mobile Menu */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--bg);
    transition: left 0.4s ease;
    padding: 2rem 0;
    box-shadow: 5px 0 20px rgba(0,0,0,0.1);
  }

  .nav.active {
    left: 0;
  }

  .nav-list {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
    font-size: 1.4rem;
  }

  /* VERY IMPORTANT: hide theme toggle when it's inside mobile menu */
  .nav .theme-toggle {
    display: none !important;
  }
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--bg-secondary);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
    text-align: left;
  }
}

.footer-brand h3 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.social-links a {
  font-size: 1.5rem;
  margin: 0 10px;
  color: var(--text-light);
  transition: all 0.3s;
}

.social-links a:hover {
  color: var(--primary);
  transform: translateY(-5px);
}

.footer p:last-child {
  grid-column: 1 / -1;
  margin-top: 2rem;
  color: var(--text-light);
  font-size: 0.9rem;
}
