html,
body {
  background: #1e1e1e;
}

/* Navbar dropdown */
.nav-item.profile-dropdown {
  position: relative;
}
.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border-radius: 0.5rem;
  box-shadow: var(--card-shadow);
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  display: none;
  min-width: 8rem;
  z-index: 1000;
}
.dropdown.open {
  display: block;
}
.dropdown li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
}
.dropdown li a:hover {
  background: var(--surface-light);
}

/* styles.css - Dark Mode */
:root {
  --primary: #007bff;
  --primary-hover: #66b3ff;
  --accent: #f43f5e;
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-light: #2a2a2a;
  --text: #f3f4f6;
  --text-muted: #a1a1aa;
  --nav-bg: rgba(18, 18, 18, 0.85);
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg) !important;
  color: var(--text);
  line-height: 1.6;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.2s, transform 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  transform-origin: center;
}

.nav-links a:hover {
  color: var(--primary);
  transform: scale(1.05);
}

.nav-links a:hover::after {
  transform: scaleX(0.5);
}

.hero {
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=1950&q=80")
      center/cover no-repeat fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border-bottom: 5px solid var(--primary);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  color: #ffffff;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease;
  background: var(--primary);
  color: #fff;
}

.btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.ripple {
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.discover {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.discover h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.discover h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary);
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.category-card {
  background: var(--surface);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-align: left;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: var(--text);
  padding: 1rem;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

.category-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

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

.footer {
  background: var(--surface);
  color: var(--text-muted);
  padding: 4rem 2rem;
  border-top: 5px solid var(--primary);
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand h3 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  max-width: 300px;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  text-align: center;
  font-size: 0.875rem;
  padding-top: 2rem;
  border-top: 1px solid var(--surface-light);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom .legal {
  margin-bottom: 1rem;
}

.footer-bottom .legal a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  margin: 0 0.5rem;
}

.footer-bottom .legal a:hover {
  color: var(--primary);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--surface);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand p {
    margin: 0 auto;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Search bar styles */
.search-bar {
  max-width: 600px;
  margin: 2rem auto;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--surface-light);
  border-radius: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* --- Fade-in Animation for Page Load --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: opacity, transform;
}
body.loaded .fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* --- Spinner Loader --- */
#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #181825); /* fallback for dark bg */
  z-index: 10000;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #eee;
  border-top: 4px solid var(--primary, #89b4fa);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Button Glow & Ripple --- */
.btn {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary, #89b4fa33);
}
.btn:active {
  transform: scale(0.98);
}
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: var(--primary, #89b4fa);
  opacity: 0.2;
  animation: ripple 0.6s linear;
  z-index: 2;
}
@keyframes ripple {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* --- Image Optimization --- */
img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.7rem;
  background: #232634;
  transition: filter 0.3s;
}
img:not([src]) {
  visibility: hidden;
}
img[data-loading="true"] {
  filter: blur(5px) grayscale(0.8);
}

/* --- Subtle Card Shadow --- */
.category-card,
.contact-container {
  box-shadow: 0 4px 28px 0 rgba(0, 0, 0, 0.14), 0 1.5px 3px 0 rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  background: var(--surface, #181825);
  transition: box-shadow 0.25s;
}
.category-card:hover {
  box-shadow: 0 8px 40px 0 rgba(0, 0, 0, 0.22), 0 3px 8px 0 rgba(0, 0, 0, 0.16);
  transform: translateY(-2px) scale(1.02);
}

input,
textarea,
select {
  transition: border 0.2s, box-shadow 0.2s;
}

/* --- Smooth Scrolling --- */
html {
  scroll-behavior: smooth;
}
