/* ===================================
   AFFIDE FOUNDATION - THEME SYSTEM
   =================================== */

/* 1. VARIABILI DEL TEMA - Modifica solo questi valori per cambiare tutto il tema */
:root {
  /* Colori principali del brand */
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --secondary-color: #2c3e50;
  --secondary-light: #34495e;
  
  /* Colori di accento */
  --accent-color: #f1c40f;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  
  /* Colori di testo */
  --text-primary: #2c3e50;
  --text-secondary: #555;
  --text-light: #777;
  --text-white: #ffffff;
  
  /* Colori di sfondo */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #2c3e50;
  --bg-light: #ecf0f1;
  
  /* Ombre */
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  
  /* Spaziature */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1.25rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Font */
  --font-primary: 'Arial', sans-serif;
  --font-secondary: 'Georgia', serif;

  /* Dimensioni font */
  --font-size-xs: 0.5rem;
  --font-size-sm: 0.6rem;
  --font-size-base: 0.65rem;
  --font-size-md: 0.7rem;
  --font-size-lg: 0.8rem;
  --font-size-xl: 1.05rem;
  --font-size-2xl: 1.2rem;
  --font-size-3xl: 1.4rem;
  
  /* Border radius */
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-full: 50%;
  
  /* Transizioni */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

/* TEMA SCURO - Attiva decommentando la classe sul body */
body.dark-theme {
  --primary-color: #5dade2;
  --primary-hover: #7ec8ed;
  --secondary-color: #2c3e50;
  --secondary-light: #34495e;

  --text-primary: #e8eaed;
  --text-secondary: #b0b8c1;
  --text-light: #8a9199;

  --bg-primary: #1a1d23;
  --bg-secondary: #242831;
  --bg-dark: #0d0f12;
  --bg-light: #2f3542;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);

  --success-color: #4ecdc4;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
}

/* 2. RESET E STILI BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  zoom: 1.0;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: 10px;
  line-height: 1.25;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition-normal);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 3. NAVIGAZIONE */
nav {
  background: var(--secondary-color);
  box-shadow: var(--shadow-md);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition-normal);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem var(--spacing-md);
  gap: 1rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: nowrap;
}

@media (max-width: 1024px) {
  .nav-menu {
    gap: 1.5rem;
  }
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  font-size: 15px;
  padding: 0.2rem 0;
  transition: var(--transition-fast);
  position: relative;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

/* Dropdown menu */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  min-width: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: 1000;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  margin-top: 10px;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: var(--bg-primary);
}

.dropdown-link {
  display: block;
  padding: 15px 25px;
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--bg-secondary);
}

.dropdown-link:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-link:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-link:hover {
  background: var(--bg-secondary);
  padding-left: 30px;
  color: var(--primary-color);
}

/* 4. HEADER DELLE PAGINE */
.page-header {
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-white);
  padding: 6rem 0 4rem;
  text-align: center;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

/* Default background for pages without specific background */
.page-header {
  background-image: url('../immagini/business-handshake-skyscrapers.jpg');
}

/* Page-specific parallax backgrounds */
.page-header.about {
  background-image: url('../immagini/BackgroundTeams.png');
}

.page-header.clients {
  background-image: url('../immagini/BackgrounCity.png');
}

.page-header.projects {
  background-image: url('../immagini/BackgroundPort2.png');
  background-position: center center;
}

.page-header.news {
  background-image: url('../immagini/BackgroundNews.png');
}

.page-header.contact {
  background-image: url('../immagini/BackgrounLondon.png');
}

.page-header.philosophy {
  background-image: url('../immagini/BackgroundStudio.png');
  background-position: center center;
}

.page-header.financial-services {
  background-image: url('../immagini/sustainability-background.png');
  background-position: center center;
}

.page-header.methodology {
  background-image: url('../immagini/BackgroundStudio.png');
  background-position: center center;
}

.page-header.education {
  background-image: url('../immagini/BackgroundEducation.png');
  background-position: center 92%;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-title {
  font-size: var(--font-size-3xl);
  font-weight: bold;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
  font-size: var(--font-size-md);
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
}

/* 5. HEADER HERO (Homepage) */
header.hero {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-white);
  padding: 2rem 0 1.5rem;
  text-align: center;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

header.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: 300;
  line-height: 1.1;
  color: var(--text-white);
  margin-bottom: 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 8px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

/* 6. CONTENUTO PRINCIPALE */
.main-content {
  padding: var(--spacing-lg) 0;
  background: var(--bg-primary);
}

/* 7. CARDS E COMPONENTI */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  transition: var(--transition-normal);
}

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

/* 8. BOTTONI */
.btn {
  display: inline-block;
  padding: 14px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 16px;
}

.btn-primary {
  background: #5dade2;
  color: #ffffff;
  border: 2px solid #5dade2;
}

.btn-primary:hover {
  background: #4a9fd5;
  border-color: #4a9fd5;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(93, 173, 226, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #5dade2;
  color: #5dade2;
}

.btn-secondary:hover {
  background: rgba(93, 173, 226, 0.1);
  border-color: #4a9fd5;
  color: #4a9fd5;
  transform: translateY(-2px);
}

/* 9. FOOTER */
footer {
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary-color) 100%);
  color: var(--text-white);
  padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.footer-section p,
.footer-section a {
  color: #bdc3c7;
  text-decoration: none;
  line-height: 1.6;
}

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

.footer-bottom {
  border-top: 1px solid var(--secondary-light);
  padding-top: var(--spacing-md);
  text-align: center;
  color: #95a5a6;
}

/* 10. UTILITY CLASSES */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

/* 11. GRIDS */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Theme Toggle & Mobile Menu */
.theme-toggle {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--primary-color);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* 12. RESPONSIVE */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
  }

  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--secondary-color);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  
  .page-title {
    font-size: var(--font-size-xl);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}