/* ==========================================
       HISTORIA CHRONOS - STYLING INTEGRATO
       ================================---------- */
    :root {
      --bg-dark: #121418;
      --bg-surface: #1a1d24;
      --bg-card: #222631;
      --gold-primary: #d4af37;
      --gold-light: #f3e5ab;
      --text-main: #f5f6f8;
      --text-muted: #9ba1a6;
      --border-gold: rgba(212, 175, 55, 0.3);
      --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    body {
      font-family: 'Inter', sans-serif;
      background-color: var(--bg-dark);
      color: var(--text-main);
      line-height: 1.6;
      overflow-x: hidden;
    }
    h1, h2, h3, .brand-text, .box-title {
      font-family: 'Cinzel', serif;
    }
    .gold-text {
      color: var(--gold-primary);
    }
    .gold-gradient {
      background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    /* HEADER & NAVBAR */
    .main-header {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      background-color: rgba(18, 20, 24, 0.95);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border-gold);
      z-index: 1000;
    }
    .header-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 15px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .brand-logo {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 1.2rem;
      font-weight: 700;
    }
    .desktop-nav {
      display: flex;
      gap: 30px;
    }
    .nav-link {
      color: var(--text-muted);
      text-decoration: none;
      font-weight: 500;
      transition: var(--transition-smooth);
    }
    .nav-link:hover, .nav-link.active {
      color: var(--gold-primary);
    }
    .mobile-menu-btn {
      display: none;
      background: none;
      border: none;
      cursor: pointer;
      flex-direction: column;
      gap: 5px;
    }
    .mobile-menu-btn span {
      width: 25px;
      height: 2px;
      background-color: var(--gold-primary);
    }

    /* MOBILE DRAWER */
    .mobile-drawer {
      position: fixed;
      top: 0;
      right: -100%;
      width: 280px;
      height: 100%;
      background-color: var(--bg-surface);
      border-left: 1px solid var(--border-gold);
      z-index: 1100;
      transition: var(--transition-smooth);
      padding: 20px;
    }
    .mobile-drawer.open {
      right: 0;
    }
    .drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 30px;
    }
    .close-drawer {
      background: none;
      border: none;
      color: var(--text-main);
      font-size: 2rem;
      cursor: pointer;
    }
    .mobile-nav {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    .mobile-link {
      color: var(--text-main);
      text-decoration: none;
      font-size: 1.1rem;
    }

    /* HERO SECTION */
    .hero-section {
      position: relative;
      min-height: 70vh;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 120px 20px 60px 20px;
      background: linear-gradient(rgba(18,20,24,0.85), rgba(18,20,24,0.95)), url('https://images.unsplash.com/photo-1552832230-c0197dd311b5?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
      border-bottom: 1px solid var(--border-gold);
    }
    .hero-content {
      max-width: 800px;
      z-index: 2;
    }
    .badge-gold {
      display: inline-block;
      padding: 6px 14px;
      background-color: rgba(212, 175, 55, 0.1);
      border: 1px solid var(--border-gold);
      color: var(--gold-primary);
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 600;
      margin-bottom: 20px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    .hero-title {
      font-size: clamp(2.2rem, 5vw, 3.5rem);
      line-height: 1.2;
      margin-bottom: 20px;
    }
    .hero-subtitle {
      color: var(--text-muted);
      font-size: 1.1rem;
      margin-bottom: 35px;
    }

    /* PATHWAY SWITCHER */
    .pathway-switcher {
      display: flex;
      gap: 15px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .path-btn {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-gold);
      color: var(--text-main);
      padding: 12px 24px;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: var(--transition-smooth);
    }
    .path-btn:hover, .path-btn.active {
      background-color: var(--gold-primary);
      color: var(--bg-dark);
      border-color: var(--gold-primary);
    }

    /* MAIN CONTAINER & VIEWS */
    .main-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 60px 20px;
    }
    .content-view {
      display: none;
    }
    .content-view.active {
      display: block;
    }
    .section-header {
      text-align: center;
      margin-bottom: 50px;
    }
    .section-title {
      font-size: 2rem;
      margin-bottom: 10px;
    }
    .section-desc {
      color: var(--text-muted);
    }

    /* CARD LEZIONI A RETTANGOLO */
    .lezioni-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 22px;
      margin-top: 25px;
    }
    .lezione-card-rect {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-gold);
      border-radius: 12px;
      padding: 24px;
      cursor: pointer;
      transition: var(--transition-smooth);
      display: flex;
      flex-direction: column;
    }
    .lezione-card-rect:hover {
      transform: translateY(-5px);
      border-color: var(--gold-primary);
      box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
    }
    .card-rect-badge {
      font-size: 0.75rem;
      color: var(--gold-primary);
      font-weight: 700;
      text-transform: uppercase;
      margin-bottom: 8px;
    }
    .lezione-card-rect h3 {
      font-size: 1.25rem;
      margin-bottom: 10px;
      color: var(--text-main);
    }
    .lezione-card-rect p {
      font-size: 0.9rem;
      color: var(--text-muted);
      flex-grow: 1;
      margin-bottom: 18px;
    }
    .card-rect-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-top: 1px solid rgba(255,255,255,0.05);
      padding-top: 14px;
    }
    .btn-apri {
      color: var(--gold-primary);
      font-weight: 600;
      font-size: 0.85rem;
    }
    .tag {
      font-size: 0.75rem;
      background-color: rgba(212, 175, 55, 0.1);
      color: var(--gold-light);
      padding: 3px 8px;
      border-radius: 4px;
    }

    /* STRUTTURA DETTAGLIO LEZIONE */
    .lezione-section-box {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-gold);
      border-radius: 12px;
      padding: 28px;
      margin-bottom: 30px;
    }
    .box-title {
      font-size: 1.3rem;
      color: var(--gold-primary);
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .back-to-grid-btn {
      background: none;
      border: 1px solid var(--border-gold);
      color: var(--gold-primary);
      padding: 10px 20px;
      border-radius: 8px;
      cursor: pointer;
      margin-bottom: 30px;
      font-weight: 600;
      transition: var(--transition-smooth);
    }
    .back-to-grid-btn:hover {
      background-color: var(--gold-primary);
      color: var(--bg-dark);
    }

    /* SPOTIFY EMBED */
    .spotify-embed-wrapper {
      background: rgba(0,0,0,0.3);
      padding: 15px;
      border-radius: 12px;
      border: 1px solid var(--border-gold);
    }

    /* QUIZ STILE */
    .quiz-options {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-top: 18px;
    }
    .quiz-opt-btn {
      background-color: var(--bg-card);
      border: 1px solid var(--border-gold);
      color: var(--text-main);
      padding: 16px 20px;
      border-radius: 8px;
      font-size: 0.95rem;
      text-align: left;
      cursor: pointer;
      transition: all 0.2s ease;
      font-weight: 500;
    }
    .quiz-opt-btn:hover {
      background-color: rgba(212, 175, 55, 0.15);
      border-color: var(--gold-primary);
    }
    .quiz-feedback {
      margin-top: 18px;
      padding: 18px;
      border-radius: 8px;
      font-size: 0.95rem;
      line-height: 1.6;
    }
    .quiz-feedback.correct {
      background-color: rgba(34, 197, 94, 0.15);
      border: 1px solid #22c55e;
      color: #4ade80;
    }
    .quiz-feedback.wrong {
      background-color: rgba(239, 68, 68, 0.15);
      border: 1px solid #ef4444;
      color: #f87171;
    }

    /* MEGA AREE GRID */
    .mega-aree-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
      gap: 25px;
    }
    .area-card {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-gold);
      border-radius: 12px;
      padding: 25px;
      position: relative;
      transition: var(--transition-smooth);
      display: flex;
      flex-direction: column;
    }
    .area-card:hover {
      transform: translateY(-5px);
      border-color: var(--gold-primary);
      box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
    }

    /* TUTOR AI */
    .ai-tutor-section {
      margin-top: 60px;
    }
    .tutor-card {
      background: linear-gradient(145deg, var(--bg-surface), var(--bg-card));
      border: 1px solid var(--gold-primary);
      border-radius: 16px;
      padding: 30px;
    }
    .tutor-header {
      display: flex;
      align-items: center;
      gap: 15px;
      margin-bottom: 20px;
    }
    .tutor-avatar {
      font-size: 2.5rem;
      background: rgba(212, 175, 55, 0.1);
      padding: 10px;
      border-radius: 12px;
    }
    .tutor-chat-body {
      background-color: var(--bg-dark);
      border-radius: 8px;
      padding: 20px;
      min-height: 120px;
      max-height: 250px;
      overflow-y: auto;
      margin-bottom: 20px;
      border: 1px solid rgba(255,255,255,0.05);
    }
    .chat-msg {
      font-size: 0.95rem;
      line-height: 1.5;
    }
    .tutor-quick-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .quick-btn {
      background-color: var(--bg-card);
      border: 1px solid var(--border-gold);
      color: var(--text-main);
      padding: 8px 16px;
      border-radius: 6px;
      font-size: 0.85rem;
      cursor: pointer;
      transition: var(--transition-smooth);
    }
    .quick-btn:hover {
      background-color: var(--gold-primary);
      color: var(--bg-dark);
    }

    @media (max-width: 768px) {
      .desktop-nav { display: none; }
      .mobile-menu-btn { display: flex; }
      .hero-section { min-height: 60vh; padding-top: 100px; }
      .mega-aree-grid { grid-template-columns: 1fr; }
    }