@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;900&family=Inter:wght@400;700;900&display=swap');

:root {
  --primary: #fbbf24;
  --primary-glow: rgba(251, 191, 36, 0.3);
  --bg-deep: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-red: #ef4444;
  --accent-emerald: #10b981;
  --header-height: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, .font-outfit {
  font-family: 'Outfit', sans-serif;
}

/* Background Effects */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(80px);
  opacity: 0.4;
  border-radius: 50%;
}

.blob-1 { top: -100px; left: -100px; animation: move 20s infinite alternate; }
.blob-2 { bottom: -100px; right: -100px; animation: move 25s infinite alternate-reverse; }

@keyframes move {
  from { transform: translate(0, 0); }
  to { transform: translate(100px, 100px); }
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-red);
  border: 1px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: rotate(3deg);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo-text span {
  color: var(--primary);
}

/* Navigation */
nav.desktop-nav {
  display: flex;
  gap: 2rem;
}

nav.desktop-nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

nav.desktop-nav button:hover {
  color: var(--text-main);
}

nav.desktop-nav button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-shadow: 0 0 12px var(--primary-glow);
}

/* Main Content */
main {
  margin-top: calc(var(--header-height) + 2rem);
  padding: 0 2rem 5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.5s ease;
}

.view-section.active {
  display: block;
}

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

/* Glass UI Elements */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Declinazioni View */
.learning-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-btn.active {
  background: rgba(239, 68, 68, 0.3);
  border-color: var(--primary-glow);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.sidebar-btn span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-btn.active span {
  color: var(--primary);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
}

th, td {
  padding: 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

td {
  font-weight: 500;
}

.td-suffix {
  font-weight: 900;
  color: var(--primary);
}

/* Practice View */
.practice-container {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
}

.arena-badge {
  display: inline-block;
  background: rgba(251, 191, 36, 0.1);
  color: var(--primary);
  padding: 0.25rem 1rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  border: 1px solid var(--primary-glow);
}

.question-box {
  background: rgba(255, 255, 255, 0.02);
  padding: 2rem;
  border-radius: 32px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-glass);
}

.question-main {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.question-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 900;
}

.input-group {
  margin-bottom: 1.5rem;
}

.practice-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  border-radius: 24px;
  color: white;
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  transition: all 0.3s ease;
}

.practice-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.check-btn {
  width: 100%;
  background: var(--primary);
  color: black;
  border: none;
  padding: 1.5rem;
  border-radius: 24px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.check-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px var(--primary-glow);
}

.feedback-card {
  padding: 1.5rem;
  border-radius: 24px;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.feedback-correct {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--accent-emerald);
}

.feedback-wrong {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-red);
}

.feedback-title {
  font-weight: 900;
  font-size: 1.1rem;
}

.feedback-detail {
  font-size: 0.9rem;
  opacity: 0.8;
}

.next-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.next-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile Nav (Bottom Bar) */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  padding: 1rem;
  justify-content: space-around;
  z-index: 100;
}

.mobile-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.mobile-nav-btn.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Responsive */
@media (max-width: 992px) {
  .learning-grid {
    grid-template-columns: 1fr;
  }
  
  nav.desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: flex;
  }
  
  main {
    padding-bottom: 7rem;
  }
}

/* Utilities */
.text-amber-400 { color: var(--primary); }
.font-black { font-weight: 900; }
.tracking-widest { letter-spacing: 0.2em; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.italic { font-style: italic; }

.note-box {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(244, 63, 94, 0.2));
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  border-radius: 24px;
  margin-top: 1rem;
}
