/* ===================================
   ZoriaScan - Main Stylesheet
   Dark Theme, Glassmorphism, Modern
   =================================== */

/* CSS Variables */
:root {
  /* Colors */
  --primary: #6C63FF;
  --primary-dark: #9D4EDD;
  --secondary: #00D9FF;
  --accent: #FF6B6B;
  --success: #4CAF50;
  --warning: #FF9800;
  
  /* Dark Theme */
  --dark-bg: #0A0E14;
  --dark-surface: #1A1F2E;
  --dark-card: #242938;
  
  /* Text */
  --text: #EAF0FF;
  --muted: rgba(234, 240, 255, 0.72);
  
  /* Effects */
  --border: rgba(255, 255, 255, 0.10);
  --glass: rgba(26, 31, 46, 0.55);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glow: 0 0 20px rgba(108, 99, 255, 0.3);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --gradient-accent: linear-gradient(135deg, var(--primary), var(--secondary));
  
  /* Layout */
  --container-max: 1100px;
  --header-height: 72px;
  --radius: 12px;
  --radius-lg: 20px;
  
  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Transitions */
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--dark-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.5rem); }

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(108, 99, 255, 0.4);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--dark-surface);
  border-color: var(--primary);
  color: var(--text);
}

/* ===================================
   Header
   =================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.logo:hover {
  color: var(--text);
}

.logo img {
  width: 32px;
  height: 32px;
}

/* Navigation */
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--dark-surface);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.hamburger::before,
.hamburger::after {
  content: '';
  left: 0;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  
  .nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

/* ===================================
   Hero Section
   =================================== */
.hero {
  position: relative;
  padding: calc(var(--header-height) + 4rem) 0 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108, 99, 255, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(157, 78, 221, 0.1), transparent);
  pointer-events: none;
  z-index: -1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  max-width: 500px;
}

.hero-subtitle-tr {
  font-size: 0.95rem;
  color: rgba(234, 240, 255, 0.5);
  margin-bottom: 2rem;
  max-width: 500px;
  font-style: italic;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.gp-badge img {
  height: 60px;
  transition: transform var(--transition);
}

.gp-badge:hover img {
  transform: scale(1.05);
}

.app-id {
  font-size: 0.8rem;
  color: rgba(234, 240, 255, 0.4);
  font-family: monospace;
}

.hero-mockup {
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.mockup-img {
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-subtitle,
  .hero-subtitle-tr {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-mockup {
    order: -1;
  }
  
  .mockup-img {
    max-width: 200px;
  }
}

/* ===================================
   Features Section
   =================================== */
.features {
  padding: 5rem 0;
  background: var(--dark-surface);
}

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  color: white;
}

.feature-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ===================================
   Screenshots Carousel
   =================================== */
.screenshots {
  padding: 5rem 0;
}

.carousel {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1rem 0;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.carousel-slide:hover {
  transform: scale(1.02);
}

.carousel-slide img {
  width: 240px;
  height: 480px;
  object-fit: cover;
  background: var(--dark-card);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.carousel-btn-prev {
  left: 0.5rem;
}

.carousel-btn-next {
  right: 0.5rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dark-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.carousel-dot:hover,
.carousel-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .carousel-btn {
    display: none;
  }
  
  .carousel-slide img {
    width: 200px;
    height: 400px;
  }
}

/* ===================================
   Download CTA Section
   =================================== */
.download-cta {
  padding: 5rem 0;
  background: var(--dark-surface);
}

.download-card {
  padding: 4rem 2rem;
  text-align: center;
  background: 
    radial-gradient(ellipse at top, rgba(108, 99, 255, 0.1), transparent 50%),
    var(--glass);
}

.download-title {
  margin-bottom: 1rem;
}

.download-desc {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.download-badges {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.download-badges .gp-badge img {
  height: 70px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--success);
  margin-top: 1rem;
}

/* ===================================
   Footer
   =================================== */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  background: var(--dark-bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-contact a {
  font-size: 0.9rem;
  color: var(--muted);
}

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

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===================================
   Back to Top
   =================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===================================
   Legal Pages (Privacy, Terms)
   =================================== */
.legal-page {
  padding: calc(var(--header-height) + 3rem) 0 4rem;
  min-height: 100vh;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  margin-bottom: 0.25rem;
}

.legal-subtitle {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: 0.85rem;
  color: rgba(234, 240, 255, 0.5);
  margin-bottom: 2rem;
}

.summary-box {
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--success);
}

.summary-box h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--success);
}

.summary-box p {
  margin: 0;
  font-size: 0.95rem;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-section h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--primary);
}

.legal-section p {
  margin-bottom: 0.75rem;
}

.legal-section ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.legal-section li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  color: var(--muted);
}

.legal-section li::before {
  content: '•';
  position: absolute;
  left: -1rem;
  color: var(--primary);
}

/* ===================================
   Support Page
   =================================== */
.support-page {
  padding: calc(var(--header-height) + 3rem) 0 4rem;
  min-height: 100vh;
}

.support-page h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
}

.faq-section,
.troubleshooting-section,
.contact-section,
.app-info-section {
  margin-bottom: 3rem;
}

.faq-section h2,
.troubleshooting-section h2,
.contact-section h2 {
  margin-bottom: 1.5rem;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question span {
  flex: 1;
  padding-right: 1rem;
}

.faq-icon {
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.faq-answer li {
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.faq-answer li::marker {
  color: var(--primary);
}

/* Troubleshooting */
.troubleshooting-card {
  padding: 2rem;
}

.troubleshooting-card h3 {
  margin-bottom: 0.5rem;
}

.troubleshooting-card > p {
  margin-bottom: 1.25rem;
}

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

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--muted);
}

.checklist li svg {
  flex-shrink: 0;
  color: var(--success);
  margin-top: 2px;
}

/* Contact Card */
.contact-card {
  padding: 3rem 2rem;
  text-align: center;
}

.contact-icon {
  color: var(--primary);
  margin-bottom: 1rem;
}

.contact-card h3 {
  margin-bottom: 0.5rem;
}

.contact-card > p {
  margin-bottom: 1.5rem;
}

.contact-card .btn {
  font-size: 1rem;
}

/* App Info */
.app-info {
  padding: 1.5rem;
}

.app-info h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.app-info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.app-info-list > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-info-list dt {
  font-size: 0.8rem;
  color: rgba(234, 240, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-info-list dd {
  font-weight: 500;
  color: var(--text);
}

/* ===================================
   Utilities
   =================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for keyboard navigation */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: rgba(108, 99, 255, 0.3);
  color: var(--text);
}
