/* ==========================================================================
   AVL 3D PRINTING - SHARED STYLES
   Shared across: home.html, about.html, gallery.html, pricing.html
   ========================================================================== */

/* CSS VARIABLES - Used by all pages */
:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --text: #2c3e50;
  --text-muted: #6c757d;
  --bg: #f8fafc;
  --surface: #fff;
  --border: #e2e8f0;
  --shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* DARK THEME VARIABLES - Used by all pages */
[data-theme="dark"] {
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --shadow: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}

/* BASE STYLES - Used by all pages */
* { 
  box-sizing: border-box; 
}

html, *, *::before, *::after {
  transition: all 2s ease;
}

body { 
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
  padding: 40px;
  line-height: 1.7;
  color: var(--text);
  background: 
    radial-gradient(circle at 20% 50%, rgba(120,119,198,0.3), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,119,198,0.3), transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(120,219,255,0.3), transparent 50%),
    linear-gradient(135deg, var(--bg), var(--border));
  min-height: 100vh;
}

/* DARK THEME BACKGROUNDS - Used by all pages */
[data-theme="dark"] body {
  background: 
    radial-gradient(circle at 20% 50%, rgba(120,119,198,0.2), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,119,198,0.2), transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(120,219,255,0.2), transparent 50%),
    linear-gradient(135deg, #0f172a, #334155);
}

/* GLASS MORPHISM SURFACES - Used by all pages */
.topnav, header, .hero, .card-section, footer, .copyright,
.glass, .faq-item, .note, .gallery-grid, .pricing-card { 
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.2);
}

[data-theme="dark"] .topnav, 
[data-theme="dark"] header, 
[data-theme="dark"] .hero, 
[data-theme="dark"] .card-section, 
[data-theme="dark"] footer, 
[data-theme="dark"] .copyright,
[data-theme="dark"] .glass,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .note,
[data-theme="dark"] .gallery-grid,
[data-theme="dark"] .pricing-card {
  background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(51,65,85,0.9));
  border: 1px solid rgba(51,65,85,0.3);
}

/* BUTTONS - Used by all pages */
.button { 
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gradient);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  margin: 0 8px 8px 0;
  font-weight: 600;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.button:hover { 
  transform: translateY(-2px); 
}

.button.alt { 
  background: linear-gradient(135deg, #64748b, #475569); 
}

/* NAVIGATION - Used by all pages */
.topnav { 
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  margin-bottom: 32px;
}

.topnav.bottom { 
  margin-top: 48px; 
  margin-bottom: 0; 
}

.nav-links { 
  display: flex; 
  gap: 4px; 
  align-items: center; 
}

.topnav a { 
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.topnav a:hover { 
  background: rgba(241,245,249,0.5); 
  color: var(--primary); 
}

.topnav a.active { 
  background: var(--gradient); 
  color: white; 
}

/* THEME TOGGLE - Used by all pages */
.theme-toggle {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 1.2em;
  min-width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover { 
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

[data-theme="dark"] .theme-toggle .sun-icon,
[data-theme="light"] .theme-toggle .moon-icon {
  opacity: 0;
  position: absolute;
}

/* MOBILE NAVIGATION - Used by all pages */
.mobile-nav { 
  display: none;
  margin-bottom: 24px;
  gap: 16px;
  align-items: center;
}

.mobile-nav select { 
  flex: 1;
  padding: 16px 20px;
  font: inherit;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

/* HEADERS - Used by all pages */
header { 
  text-align: center;
  padding: 48px;
  margin-bottom: 32px;
}

header h1 { 
  margin: 0 0 16px 0;
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  padding-bottom: 4px;
}

header p { 
  margin: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto;
}

/* FOOTER - Used by all pages */
footer { 
  margin-top: 64px;
  color: var(--text-muted);
  padding: 40px;
}

footer hr { 
  border: none; 
  height: 1px; 
  background: var(--border); 
  margin: 0 0 32px 0; 
}

footer strong { 
  color: var(--text); 
}

.copyright {
  text-align: center;
  margin: 32px 0 0 0;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.9em;
}

/* RESPONSIVE BASE - Used by all pages */
@media (max-width: 768px) {
  body { 
    padding: 20px; 
  }
  
  .topnav { 
    display: none !important; 
  }
  
  .mobile-nav { 
    display: flex; 
  }
  
  header h1 { 
    font-size: 2.5rem; 
  }
  
  header p { 
    font-size: 1.125rem; 
  }
  
  footer { 
    padding: 24px; 
    margin-bottom: 48px; 
  }
}

/* SHARED: Scroll arrow - Used by all pages */
.scroll-arrow { 
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.arrow-down { 
  font-size: 24px;
  color: white;
  background: var(--gradient);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  animation: bounce 2s infinite;
}

@keyframes bounce { 
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 
  40% { transform: translateY(-10px); } 
  60% { transform: translateY(-5px); } 
}

.scroll-arrow.hidden { 
  opacity: 0; 
  pointer-events: none; 
}

/* ==========================================================================
   HOME PAGE SPECIFIC STYLES
   Only used by: home.html
   ========================================================================== */

/* HOME: Hero section */
.hero { 
  display: flex;
  gap: 32px;
  align-items: center;
  margin: 48px 0;
  padding: 48px;
}

.hero .hero-content { 
  flex: 1; 
}

.hero h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--text);
  line-height: 1.2;
}

.hero p { 
  font-size: 1.125rem; 
  margin-bottom: 24px; 
  color: var(--text-muted); 
}

.hero ul { 
  margin: 32px 0; 
  padding-left: 0; 
  list-style: none; 
}

.hero li {
  padding: 8px 0 8px 32px;
  position: relative;
  color: var(--text);
}

.hero li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.hero-image { 
  width: 320px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.hero-image img { 
  width: 100%; 
  height: auto; 
  display: block; 
}

/* HOME: Card sections */
.card-section { 
  margin-top: 48px;
  padding: 40px;
}

.card-section h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 24px 0;
  color: var(--text);
}

.card-section ol { 
  font-size: 1.125rem; 
  color: var(--text-muted); 
}

.card-section li { 
  margin-bottom: 12px; 
  padding-left: 8px; 
}

/* HOME: Responsive */
@media (max-width: 768px) {
  .hero { 
    flex-direction: column; 
    padding: 32px 24px; 
    gap: 24px; 
  }
  
  .hero-image { 
    width: 100%; 
    max-width: 320px; 
  }
  
  .hero h2 { 
    font-size: 1.875rem; 
  }
  
  .card-section { 
    padding: 24px; 
  }
}

/* ==========================================================================
   ABOUT PAGE SPECIFIC STYLES
   Only used by: about.html
   ========================================================================== */

/* ABOUT: FAQ items */
.faq-item {
  margin-bottom: 16px;
  padding: 24px;
  border-radius: 16px;
}

.faq-item h3 {
  margin: 0 0 12px 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
}

.faq-item p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   GALLERY PAGE SPECIFIC STYLES
   Only used by: gallery.html
   ========================================================================== */

/* GALLERY: Grid layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
  padding: 12px;
  margin: 20px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
}

.gallery-grid img:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.1);
}

/* GALLERY: Lightbox */
.lightbox { 
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  background: rgba(0,0,0,0.9); 
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.lightbox.open { 
  display: flex; 
}

.lightbox img { 
  max-width: 90%; 
  max-height: 90%; 
  border-radius: 16px; 
  box-shadow: var(--shadow);
}

.lightbox .close { 
  position: absolute; 
  top: 32px; 
  right: 32px; 
  color: white; 
  font-size: 32px; 
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox .close:hover {
  background: rgba(0,0,0,0.8);
}

/* GALLERY: Lightbox navigation arrows */
.lightbox .nav { 
  position: absolute; 
  inset: 0; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  pointer-events: none; 
}

.lightbox .nav button { 
  color: white; 
  font-size: 48px; 
  background: rgba(0,0,0,0.5); 
  border: none; 
  border-radius: 50%; 
  width: 64px; 
  height: 64px; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  pointer-events: auto; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  margin: 0 32px;
}

.lightbox .nav button:hover { 
  background: rgba(0,0,0,0.8); 
  transform: scale(1.1);
}

/* ==========================================================================
   PRICING PAGE SPECIFIC STYLES
   Only used by: pricing.html
   ========================================================================== */

/* PRICING: Cards */
.pricing-card {
  margin-bottom: 32px;
  padding: 32px;
  border-radius: 20px;
}

.pricing-card h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.pricing-card .price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.pricing-card li {
  padding: 8px 0;
  color: var(--text-muted);
}

/* PRICING: Notes */
.note {
  padding: 20px;
  margin: 24px 0;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}