/**
 * ZX Levitator - Main Stylesheet
 * Unified CSS for all pages
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  /* Compatibility box colors (changeable) */
  --compat-box-color-rgb: 0, 153, 255;
  --compat-box-color: #0099ff;
  --compat-box-color-light: #33b3ff;
  
  /* Brand colors */
  --color-black: #000000;
  --color-red: #ff0033;
  --color-yellow: #ffcc00;
  --color-green: #00cc66;
  --color-blue: #0099ff;
  --color-magenta: #ff2e9f;
  --color-gold: #f4c542;
  
  /* Backgrounds */
  --bg-dark: #111;
  --bg-card: #1c1c1c;
  --bg-card-alt: #252525;
  --border-color: #2a2a2a;
  --border-color-light: #333;
  
  /* Text colors */
  --text-primary: #eee;
  --text-secondary: #ccc;
  --text-muted: #aaa;
  --text-footer: #777;
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
}

/* ========================================
   LANGUAGE SWITCHER (inside nav bar)
   ======================================== */
.lang-switch {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  z-index: 1001;
  display: block;
  gap: 8px;
}

button.img-btn {
  all: unset;
  color: #ffffff;
  background: none;
  border: outset;
  cursor: pointer;
  display: inline-flex;
  justify-self: center;
  align-items: center;
  padding: 0.3rem 0.8rem;
  margin: 0;
  width: auto;
  height: auto;
  transition: opacity 0.3s;
}

button.img-btn:hover {
  opacity: 0.8;
}

/* ========================================
   NAVIGATION MENU
   ======================================== */
nav {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border-color);
}

nav ul {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

nav li {
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li::before {
  content: none !important;
  display: none !important;
}

nav a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

/* Effetto sottofondo che si espande dal basso */
nav a::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, 
    rgba(0, 204, 255, 0.15) 0%, 
    rgba(0, 204, 255, 0.05) 100%
  );
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

/* Barra colorata a sinistra che appare */
nav a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(
    180deg,
    #00ccff,
    #0099ff
  );
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

nav a:hover {
  color: #00ccff;
  transform: translateX(8px);
  text-shadow: 0 0 20px rgba(0, 204, 255, 0.3);
}

nav a:hover::before {
  height: 100%;
}

nav a:hover::after {
  height: 100%;
}

nav a.active {
  color: var(--color-green);
  font-weight: 600;
}

nav a.active::before {
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(0, 204, 102, 0.2) 0%, 
    rgba(0, 204, 102, 0.1) 100%
  );
}

nav a.active::after {
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--color-green),
    #00ff88
  );
  box-shadow: 0 0 10px rgba(0, 204, 102, 0.5);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  /* Aumenta l'altezza minima della barra nav su mobile */
  nav {
    min-height: 3.5rem;
    background: rgba(0, 0, 0, 1);
  }
  
  nav ul {
    flex-direction: column;
    gap: 0;
    display: none;
    width: 100%;
    background: rgba(0, 0, 0, 0.98);
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  }
  
  nav ul.show {
    display: flex;
  }
  
  nav a {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }
  
  nav a:hover {
    transform: translateX(0); /* Rimuovi lo spostamento orizzontale su mobile */
  }
}

/* ========================================
   HEADER
   ======================================== */
header {
  background: linear-gradient(135deg, #000 0%, #1a1a1a 50%, #000 100%);
  padding: 3rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 50%, 
    rgba(255, 46, 159, 0.15) 0%, 
    transparent 50%
  ),
  radial-gradient(
    circle at 70% 50%, 
    rgba(0, 153, 255, 0.15) 0%, 
    transparent 50%
  );
  animation: gradientShift 15s ease infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10%, -10%);
  }
}

header h1 {
  margin: 0;
  font-size: 3rem;
  color: #fff;
}

header p {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.brand-stripe {
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--color-red),
    var(--color-yellow),
    var(--color-green),
    var(--color-blue)
  );
}

/* Hero logo animation */
.hero-logo {
  display: block;
  margin: 0 auto;
  max-width: 320px;
  filter: drop-shadow(0 10px 30px rgba(255, 46, 159, 0.35));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(0, -20px);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* ========================================
   SECTIONS & LAYOUT
   ======================================== */
section {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 0 1rem;
  animation: fadeIn 0.6s ease-in;
}

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

/* ========================================
   TYPOGRAPHY
   ======================================== */
h2 {
  color: var(--color-gold);
  font-size: 2rem;
  margin: 2rem 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h3 {
  color: var(--color-blue);
  font-size: 1.4rem;
  margin: 1.5rem 0 0.8rem;
}

h4 {
  color: var(--color-green);
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
  font-weight: bold;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========================================
   HIGHLIGHT BOX (Compatibility section)
   ======================================== */
.highlight-box {
  background: radial-gradient(
    circle,
    rgba(var(--compat-box-color-rgb), 0.2),
    rgba(0, 0, 0, 0.5)
  );
  border: 1px solid var(--compat-box-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: 0 0 25px rgba(var(--compat-box-color-rgb), 0.3);
}

.highlight-box h3 {
  color: var(--compat-box-color-light);
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.highlight-box p {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.8;
}

.highlight-box strong {
  color: var(--color-gold);
}

/* Images inside highlight box - with hover effect */
.highlight-box img {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.highlight-box img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(var(--compat-box-color-rgb), 0.6);
}

/* ========================================
   LISTS
   ======================================== */
/* Unordered lists */
ul {
  list-style: none;
  padding: 0;
}

ul li {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
}

ul li::before {
  content: "✓ ";
  color: var(--color-gold);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Ordered lists */
ol {
  counter-reset: item;
  list-style: none;
  padding-left: 2rem;
}

ol li {
  counter-increment: item;
  margin-bottom: 0.8rem;
  position: relative;
}

ol li::before {
  content: counter(item) ".";
  color: var(--color-gold);
  font-weight: bold;
  position: absolute;
  left: -2rem;
  width: 1.5rem;
  text-align: right;
}

/* ========================================
   IMAGES & FIGURES
   ======================================== */
img {
  max-width: 100%;
  border-radius: 8px;
}

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-style: italic;
}

/* All content images - unified style with hover effect */
.feature-img,
.guide-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin: 1rem 0 0.2rem 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.feature-img:hover,
.guide-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* Image captions (unified) */
.caption,
figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.5rem 0 1rem;
  text-align: center;
}

/* ========================================
   IMAGE GALLERY GRIDS
   ======================================== */
.image-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* 2 columns grid */
.image-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 columns grid */
.image-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Featured layout: 1 large + 2 small */
.image-grid-featured {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
}

.image-grid-featured figure:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

/* Responsive grids */
@media (max-width: 768px) {
  .image-grid-2,
  .image-grid-3,
  .image-grid-featured {
    grid-template-columns: 1fr;
  }
  
  .image-grid-featured figure:first-child {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ========================================
   TWO COLUMN LAYOUT (Responsive)
   ======================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}

.two-col > div {
  background: var(--bg-card-alt);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color-light);
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   NOTES & ALERTS
   ======================================== */
.note {
  background: rgba(255, 204, 0, 0.1);
  border-left: 4px solid var(--color-yellow);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 0.95rem;
}

.note::before {
  content: "ℹ️ ";
  font-weight: bold;
}

/* ========================================
   LINKS
   ======================================== */
a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
  color: var(--compat-box-color-light);
  text-decoration: underline;
}

/* Special link colors (maintain specificity) */
a[style*="color: #ff2e9f"]:hover {
  color: #ff66b2 !important;
}

a[style*="color: #f4c542"]:hover {
  color: #ffcc00 !important;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.magenta {
  color: var(--color-magenta);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-footer);
  margin-top: 3rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-color);
}

footer a {
  color: var(--color-gold);
}

footer a:hover {
  color: var(--color-yellow);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  section {
    padding: 0 1.5rem;
  }
}