@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* Default to Dark Mode */
  --bg-primary: #020617;
  --bg-secondary: #0b1a2a;
  --bg-tertiary: #0d2235;

  --text-primary: #ffffff;
  --text-secondary: #f8fafc;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #0052ff;
  --accent-secondary: #00a3ff;
  --accent-tertiary: #00e5ff;

  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(11, 26, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);

  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 60px rgba(0, 0, 0, 0.6);
  --glow-blue: 0 0 30px rgba(0, 82, 255, 0.4);
  --glow-cyan: 0 0 50px rgba(0, 229, 255, 0.3);

  --nav-height: 80px;
  --container-width: 1400px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --text-primary: #0d2235;
  --text-secondary: #1e293b;
  --text-tertiary: #475569;
  --text-muted: #94a3b8;

  --accent-primary: #0052ff;
  --accent-secondary: #00a3ff;
  --accent-tertiary: #00e5ff;

  --border-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(248, 250, 252, 0.8);
  --glass-border: rgba(0, 82, 255, 0.1);

  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 60px rgba(0, 0, 0, 0.15);
  --glow-blue: 0 4px 20px rgba(0, 82, 255, 0.15);
  --glow-cyan: 0 6px 30px rgba(0, 163, 255, 0.2);
}

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

img,
svg,
input,
select,
textarea {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Nav Styles */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
  height: var(--nav-height);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo,
.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-text {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo-ai {
  color: var(--accent-primary);
  font-weight: 800;
}

.footer .logo-ai {
  color: inherit;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.mobile-menu-toggle {
  display: none;
}

/* Currency Toggle */
.currency-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 60px;
  justify-content: center;
  color: var(--text-primary);
}

.currency-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

.btn-primary:hover {
  background: var(--accent-secondary);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

/* Main Layout */
header {
  padding: 10rem 2rem 4rem;
  text-align: center;
}

@media (max-width: 768px) {
  header {
    padding: 6rem 1.25rem 3rem;
  }
}

h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-align: center;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

.stats-container {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 1rem;
}

.stats-container span {
  color: var(--accent-primary);
  font-weight: 700;
}

/* Controls */
.controls {
  max-width: 1000px;
  margin: 0 auto 5rem;
  background: var(--bg-secondary);
  padding: 2.5rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.search-container {
  position: relative;
  margin-bottom: 2rem;
}

.search-container input {
  width: 100%;
  padding: 1.25rem 1.5rem;
  padding-left: 3.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-blue);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.875rem;
}

.filter-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-blue);
}

.filter-count {
  opacity: 0.7;
  font-size: 0.85em;
  margin-left: 4px;
}

[data-theme="light"] .filter-count {
  opacity: 0.8;
  font-weight: 500;
}

/* Grid & Cards */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
  padding: 0 2rem 6rem;
}

.theme-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 2.5rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.theme-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.theme-badge {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  background: rgba(0, 82, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  width: fit-content;
}

.theme-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.theme-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.demo-link {
  width: 100%;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  text-decoration: none;
  border-radius: 50px;
  text-align: center;
  font-weight: 700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.demo-link:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 6rem;
}

.page-btn {
  padding: 0.75rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Consolidated Footer Styles */
.footer {
  background: var(--bg-secondary);
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-tertiary) !important;
}

.footer-content {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer .logo-text {
  color: var(--text-primary) !important;
  font-size: 1.5rem;
  font-weight: 800;
}

.footer .logo-ai {
  color: inherit !important;
  opacity: 0.8;
}

.footer-tagline {
  color: var(--text-tertiary) !important;
  margin-top: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-right-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 3rem !important;
}

.footer-links {
  display: flex !important;
  flex-direction: row !important;
  gap: 2rem !important;
}

.footer-links a,
.footer-legal a {
  color: var(--text-tertiary) !important;
  text-decoration: none !important;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.footer-links a:hover,
.footer-legal a:hover,
.footer-social-link:hover {
  color: var(--text-primary) !important;
}

.footer-social-link {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
}

.footer-bottom {
  padding-top: 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.separator {
  color: var(--text-muted);
  margin: 0 0.5rem;
  opacity: 0.5;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6rem;
  color: var(--text-muted);
  font-size: 1.25rem;
}

@media (max-width: 1200px) {
  .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 992px) {
  .footer-content {
    flex-direction: column;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }

  .subtitle {
    font-size: 1.125rem;
  }

  .nav-menu {
    display: none;
  }

  /* Mobile Menu Styles */
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: 1rem;
    visibility: visible !important;
  }

  .mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
  }

  /* Hamburger Animation */
  .mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Mobile Nav Overlay */
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    padding: 6rem 2rem;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-menu.active .nav-link,
  .nav-menu.active .theme-toggle {
    display: flex;
    font-size: 1.5rem;
  }

  .controls {
    padding: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
  }

  .theme-grid {
    grid-template-columns: 1fr;
    padding: 0 0 4rem;
    gap: 1.5rem;
  }

  .theme-card {
    padding: 1.5rem;
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    align-items: center !important;
  }

  .footer-brand {
    align-items: center !important;
  }

  .footer-logo-link {
    justify-content: center !important;
  }

  .footer-tagline {
    text-align: center !important;
    max-width: 100% !important;
  }

  .footer-right-group {
    width: 100% !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 2rem !important;
  }

  .footer-links {
    flex-direction: row !important;
    justify-content: center !important;
    width: auto !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
  }

  .footer-social-link {
    justify-content: center !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
  }

  .footer-legal {
    justify-content: center !important;
    width: 100% !important;
  }
}

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

  header {
    padding: 4rem 1rem 2rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  .controls {
    padding: 1rem;
    border-radius: 20px;
  }

  .search-container input {
    font-size: 0.9375rem;
    padding: 1rem 1rem 1rem 3rem;
  }

  .filter-btn {
    padding: 0.4rem 0.875rem;
    font-size: 0.75rem;
  }

  .pagination-container {
    gap: 0.25rem;
  }

  .page-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
}
