/* Variabili Globali */
:root {
      --bg-color: #0f172a;
      --bg-gradient: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
      --card-bg: rgba(30, 41, 59, 0.6);
      --card-border: rgba(255, 255, 255, 0.08);
      --text-main: #f1f5f9;
      --text-muted: #94a3b8;
      --accent: #8b5cf6;
      --accent-glow: rgba(139, 92, 246, 0.3);
      --radius: 20px;
}

/* Reset E Base */
* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
}

body {
      font-family: 'Inter', sans-serif;
      background: var(--bg-color);
      background: var(--bg-gradient);
      background-attachment: fixed;
      color: var(--text-main);
      min-height: 100vh;
      padding-top: 100px;
}

/* Struttura Navbar */
.navbar {
      position: fixed;
      top: 0;
      width: 100%;
      height: 70px;
      background: rgba(15, 23, 42, 0.8);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      border-bottom: 1px solid var(--card-border);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
}

.nav-container {
      width: 100%;
      max-width: 1200px;
      padding: 0 30px;
      display: flex;
      justify-content: space-between;
      align-items: center;
}

.nav-left {
      display: flex;
      align-items: center;
}

.brand {
      font-weight: 800;
      font-size: 1.4rem;
      background: linear-gradient(to right, #fff, var(--accent));
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
}

.clock {
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-left: 20px;
      font-weight: 500;
      letter-spacing: 0.5px;
      font-variant-numeric: tabular-nums;
}

/* Sezione Ricerca */
.searchBox {
      position: relative;
      display: flex;
      align-items: center;
}

.searchBox img {
      width: 20px;
      height: 20px;
      margin-right: 20px;
      pointer-events: none;
}

.searchBox input {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.1);
      padding: 15px;
      margin-left: 0;
      border-radius: 15px;
      color: white;
      outline: none;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      width: 240px;
      font-size: 0.9rem;
      line-height: 1.2;
}

.searchBox input::placeholder {
      color: var(--text-muted);
      opacity: 0.6;
      font-style: italic;
}

.searchBox input:focus {
      width: 300px;
      background: rgba(255, 255, 255, 0.08);
      border-color: var(--accent);
      box-shadow: 0 0 15px var(--accent-glow);
}

/* Container */
.container {
      width: 100%;
      max-width: 750px;
      margin: 0 auto;
      padding: 0 20px 60px 20px;
}

header h1 {
      font-size: 2rem;
      text-align: center;
      margin-bottom: 30px;
      color: var(--text-main);
}

/* Header E Bandiere */
.quiz-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 15px;
      margin-bottom: 30px;
}

.quiz-header h1 {
      font-size: 2rem;
      text-align: center;
      color: var(--text-main);
      margin-bottom: 0;
      line-height: 1;
}

.flagIT {
      width: 35px;
      height: 35px;
      display: block;
      flex-shrink: 0;
}

/* Card Quiz */
.quizList {
      display: flex;
      flex-direction: column;
      gap: 15px;
}

.quizItem {
      width: 100%;
      background: var(--card-bg);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid var(--card-border);
      border-radius: var(--radius);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: transform 0.3s ease, border-color 0.3s ease;
}

.quizItem:hover {
      transform: translateY(-3px);
      box-shadow: 0 0 20px var(--accent-glow);
      border-color: var(--accent);
}
.quizBox {
      display: flex;
      align-items: center;
}

/* Icone E Bottoni */
.quizIcon {
      width: 50px;
      height: 50px;
      background: rgba(255, 255, 255, 0.07); 
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 18px;
      flex-shrink: 0;
}

.quizIcon img {
      width: 32px; /* Dimensione ideale */
      height: 32px;
      object-fit: contain;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
      transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quizItem:hover .quizIcon img {
      transform: scale(1.2) rotate(-8deg);
}
.quizName {
      font-weight: 600;
      font-size: 1.1rem;
}

.btn-go {
      background: var(--accent);
      color: white;
      text-decoration: none;
      padding: 8px 20px;
      border-radius: 10px;
      font-size: 0.9rem;
      font-weight: 700;
      transition: all 0.3s ease;
}

.btn-go:hover {
      background: #7c3aed;
      transform: scale(1.05);
}

.quizItem:hover .quizIcon {
      transform: rotate(-10deg) scale(1.1);
      transition: transform 0.3s ease;
}

/* Dropdown Menu */
.btn-dropdown-toggle {
      cursor: pointer;
      border: none;
      font-family: inherit;
      display: flex;
      align-items: center;
      gap: 8px;
}

.icon-chevron {
      width: 16px;
      height: 16px;
      transition: transform 0.3s ease;
}

.btn-sub-go {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-main);
      text-decoration: none;
      padding: 6px 15px;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 600;
      border: 1px solid var(--card-border);
      transition: all 0.3s ease;
}

.btn-sub-go:hover {
      background: white;
      color: var(--bg-color);
      transform: translateY(-2px);
}

/* Gestione Dropdown */
.quizDropdown {
      display: none;
      flex-direction: column;
      gap: 8px;
      padding-left: 30px;
      margin: 10px 0;
}

.quizDropdown.show {
      display: flex;
      animation: fadeInDown 0.3s ease forwards;
}

.subQuizItem {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--card-border);
      border-radius: 15px;
      padding: 10px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
}

.subQuizName {
      font-size: 0.9rem;
      color: var(--text-muted);
}

.btn-dropdown-toggle.active .icon-chevron {
      transform: rotate(180deg);
}

.dropdown-info {
      padding: 12px 15px;
      font-size: 0.8rem;
      color: var(--text-muted);
      line-height: 1.5;
      background: rgba(255, 255, 255, 0.02);
      border-radius: 12px;
      border: 1px dashed rgba(255, 255, 255, 0.1);
      margin-top: 5px;
}

.dropdown-info code {
      display: inline-block;
      margin-top: 5px;
      color: var(--accent);
      background: rgba(139, 92, 246, 0.1);
      padding: 2px 8px;
      border-radius: 5px;
      font-family: monospace;
      font-weight: 600;
      letter-spacing: 0.5px;
      border: 1px solid var(--accent-glow);
}

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

/* Stato Giocato */
.played-mode {
      opacity: 0.6;
}
.played-mode .quizName, .played-mode .subQuizName {
      text-decoration: line-through;
      color: var(--text-muted);
}
.icon-chevron {
      transition: transform 0.3s ease;
}
.btn-dropdown-toggle.active .icon-chevron {
      transform: rotate(180deg);
}

/* Footer */
footer {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-muted);
      font-size: 0.9rem;
      border-top: 1px solid var(--card-border);
      margin-top: 20px;
}

/* Layout Responsive */
@media (max-width: 600px) {
      .nav-left .clock { 
            display: none; 
      }
      .searchBox input { 
            width: 140px; 
      }
      .searchBox input:focus { 
            width: 160px; 
      }
      header h1 { 
            font-size: 1.6rem; 
      }
}