/* ===== ITALIAN THEME VARIABLES ===== */
:root {
  /* Italian Colors */
  --italy-green: #008C45;
  --italy-white: #F4F5F0;
  --italy-red: #CD212A;
  
  /* Background Colors */
  --bg-dark: #0A0A0A;
  --bg-card: #1A1A1C;
  
  /* Course Field Colors */
  --field-stem-cs: #34C759;
  --field-stem-eng: #0A84FF;
  --field-business: #FF9F0A;
  --field-health: #AF52DE;
  --field-humanities: #FF453A;
  --field-science: #30D158;
  --field-env: #32D74B;
  --field-law: #5E5CE6;
  --field-tourism: #64D2FF;
  
  /* Bachelor Specific Colors */
  --field-bachelor-stem: #5AC8FA;
  --field-bachelor-business: #FF9500;
  --field-bachelor-humanities: #FF2D55;
  
  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
  
  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-tertiary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  /* University Types */
  --type-university: #34C759;
  --type-polytechnic: #0A84FF;
  --type-special: #FF9F0A;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Focus styles for accessibility */
:focus {
  outline: 2px solid var(--italy-green);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--italy-green);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--italy-green);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 1001;
}

.skip-link:focus {
  top: 0;
}

/* ===== STICKY NAV CONTAINER ===== */
.sticky-nav-container {
  position: sticky;
  top: 0;
  z-index: 1001;
  width: 100%;
  height: 0;
  pointer-events: none;
  transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
              bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticky-nav-container .view-toggle {
  pointer-events: auto;
}

.sticky-nav-container.scrolled {
  top: auto;
  bottom: 0;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  position: fixed;
  top: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 1001;
  background: rgba(30, 30, 32, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: var(--spacing-xs);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(255, 255, 255, 0.05) inset,
    0 -1px 2px rgba(0, 0, 0, 0.1) inset;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: auto;
  pointer-events: auto;
  will-change: transform;
}

.sticky-nav-container.scrolled .view-toggle {
  top: auto;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%) translateY(0);
}

.view-toggle:hover {
  background: rgba(35, 35, 37, 0.75);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(255, 255, 255, 0.08) inset,
    0 -1px 2px rgba(0, 0, 0, 0.15) inset;
}

.toggle-container {
  display: flex;
  gap: var(--spacing-xs);
  position: relative;
}

.toggle-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
  border-radius: var(--radius-full);
  pointer-events: none;
}

.view-option {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.view-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius-full);
}

.view-option:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.view-option:hover::before {
  opacity: 1;
}

.view-option.active {
  background: linear-gradient(
    135deg,
    rgba(0, 140, 69, 0.25) 0%,
    rgba(0, 107, 54, 0.25) 100%
  );
  color: white;
  box-shadow: 
    0 4px 12px rgba(0, 140, 69, 0.25),
    0 1px 2px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  border: 1px solid rgba(0, 140, 69, 0.3);
}

.view-option.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 140, 69, 0.15) 0%,
    rgba(0, 107, 54, 0.15) 100%
  );
  border-radius: var(--radius-full);
  z-index: -1;
}

.view-option i {
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}

.view-option:hover i {
  transform: scale(1.1);
}

.view-option.active i {
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 
      0 4px 12px rgba(0, 140, 69, 0.25),
      0 1px 2px rgba(255, 255, 255, 0.1) inset;
  }
  50% {
    box-shadow: 
      0 6px 16px rgba(0, 140, 69, 0.35),
      0 1px 2px rgba(255, 255, 255, 0.12) inset;
  }
}

.view-option.active {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* ===== LOADING SCREEN ===== */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--transition-normal);
}

#loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  padding: var(--spacing-xl);
  max-width: 400px;
}

.loading-logo {
  margin-bottom: var(--spacing-xl);
}

.flag-stripes {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.flag-stripes .stripe {
  flex: 1;
}

.stripe.green { background: var(--italy-green); }
.stripe.white { background: var(--italy-white); }
.stripe.red { background: var(--italy-red); }

.loading-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--italy-green);
  border-radius: 50%;
  margin: 0 auto var(--spacing-lg);
  animation: spin 1s linear infinite;
}

.loading-text {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== HERO SECTION ===== */
.hero-section {
  height: 100vh;
  min-height: 700px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background: 
     linear-gradient(rgba(15, 15, 15, 0.75), rgba(15, 15, 15, 0.85)),
    linear-gradient(135deg, var(--italy-green) 0%, transparent 30%, transparent 70%, var(--italy-red) 100%),
    url('https://images.unsplash.com/photo-1515542622106-78bda8ba0e5b?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover no-repeat;
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  padding: var(--spacing-xl);
  z-index: 1;
}

.hero-title h1 {
  font-family: 'Cinzel', 'Times New Roman', Times, serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(
    135deg,
    #FFFFFF  0%,
    #F5F3E9 50%,
    #E8E6DF 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.hero-title h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0, 140, 69, 0.3) 20%,
    rgba(244, 245, 240, 0.5) 50%,
    rgba(205, 33, 42, 0.3) 80%,
    transparent 100%
  );
  border-radius: 1px;
  opacity: 0.4;
}

.hero-subtitle p {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 600px;
  margin: 0 auto var(--spacing-xl);
  letter-spacing: 0.15px;
  position: relative;
  padding: 0 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-xl);
}

.hero-stats span {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.hero-stats i {
  color: var(--italy-green);
  font-size: 1rem;
}

.btn-explore {
  background: linear-gradient(135deg, 
    var(--italy-green) 0%, 
    color-mix(in srgb, var(--italy-green) 60%, var(--italy-white) 40%) 33%,
    color-mix(in srgb, var(--italy-white) 60%, var(--italy-red) 40%) 66%,
    var(--italy-red) 100%
  );
  color: var(--bg-dark);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-full);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  min-width: 180px;
  text-transform: uppercase;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(255, 255, 255, 0.1) inset;
  background-size: 200% 200%;
}

.btn-explore:hover {
  transform: translateY(-3px);
  background-position: 100% 100%;
  box-shadow: 
    0 12px 30px rgba(0, 140, 69, 0.4),
    0 8px 20px rgba(205, 33, 42, 0.3),
    0 2px 8px rgba(255, 255, 255, 0.1) inset;
  letter-spacing: 1px;
}

.btn-explore:active {
  transform: translateY(-1px);
  transition: transform 0.1s ease;
}

.btn-explore i {
  font-size: 1.1rem;
  transition: transform var(--transition-normal);
}

.btn-explore:hover i {
  transform: translateX(4px);
}

.scroll-indicator {
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.mouse {
  width: 28px;
  height: 46px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.wheel {
  width: 4px;
  height: 8px;
  background: linear-gradient(
    to bottom,
    var(--italy-green) 0%,
    var(--italy-green) 33%,
    var(--italy-white) 33%,
    var(--italy-white) 66%,
    var(--italy-red) 66%,
    var(--italy-red) 100%
  );
  border-radius: 2px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% { top: 10px; opacity: 1; }
  100% { top: 26px; opacity: 0; }
}

/* ===== MAIN CONTENT ===== */
.main-content {
  position: relative;
  min-height: 100vh;
  padding-bottom: 150px;
}

/* ===== MAP CONTROLS ===== */
.map-controls {
  position: sticky;
  top: var(--spacing-md);
  background: rgba(20, 20, 22, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  z-index: 1000;
  max-width: 850px;
  width: calc(100% - var(--spacing-xl));
  margin: 0 auto var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Control buttons */
.control-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--italy-green);
  color: var(--italy-green);
}

/* ===== CONTROL GROUP ===== */
.control-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-sm);
  width: 100%;
}

/* Desktop override */
@media (min-width: 769px) {
  .control-group {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-md);
    justify-content: center;
  }
}

.btn-text {
  display: inline;
}

.search-container {
  flex: 1;
  position: relative;
  min-width: 180px;
  max-width: 350px;
}

#search-input, #masters-search, #bachelors-search {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

#search-input:focus, #masters-search:focus, #bachelors-search:focus {
  outline: none;
  border-color: var(--italy-green);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(0, 140, 69, 0.2);
}

#search-input::placeholder, #masters-search::placeholder, #bachelors-search::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.clear-btn:hover {
  color: var(--italy-red);
}

/* ===== COURSES BREADCRUMB ===== */
.courses-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  min-width: 200px;
}

.breadcrumb-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.breadcrumb-item:hover:not(:disabled) {
  color: var(--italy-green);
  background: rgba(255, 255, 255, 0.05);
}

.breadcrumb-item:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== MAP SECTION ===== */
.map-section {
  height: 65vh;
  min-height: 450px;
  max-height: 700px;
  width: calc(100% - var(--spacing-xl));
  margin: 0 auto var(--spacing-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
}

.leaflet-container {
  background: var(--bg-card) !important;
  font-family: 'Inter', sans-serif !important;
}

/* ===== MAP LEGEND ===== */
.map-legend {
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  z-index: 1000;
  min-width: 160px;
}

.legend-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-color.university { background: var(--type-university); }
.legend-color.polytechnic { background: var(--type-polytechnic); }
.legend-color.special { background: var(--type-special); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: rgba(20, 20, 22, 0.98);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-color);
  z-index: 1001;
  transition: right var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.4);
}

.sidebar.open {
  right: 0;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--italy-green) 33%, 
    var(--italy-white) 33% 66%, 
    var(--italy-red) 66%
  );
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sidebar-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.sidebar-close:hover {
  background: var(--italy-red);
  border-color: var(--italy-red);
  color: white;
  transform: rotate(90deg);
}

.sidebar-filters {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: var(--spacing-sm);
}

.filter-select {
  flex: 1;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px;
  padding-right: 2rem;
}

.filter-select:hover {
  border-color: var(--italy-green);
}

.filter-select:focus {
  outline: none;
  border-color: var(--italy-green);
  box-shadow: 0 0 0 2px rgba(0, 140, 69, 0.2);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

#reset-filters, #reset-courses-filters {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  transition: color var(--transition-fast);
}

#reset-filters:hover, #reset-courses-filters:hover {
  color: var(--italy-green);
}

/* ===== FIELDS LIST ===== */
.fields-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
}

.field-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.field-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--field-stem-cs);
  opacity: 0.7;
  transition: opacity var(--transition-normal);
}

.field-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--italy-green);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.field-card:hover::before {
  opacity: 1;
}

.field-card .field-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  font-size: 1.2rem;
}

.field-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.field-card p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.field-card .field-stats {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.field-stat {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ===== SUBFIELDS LIST ===== */
.subfields-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
}

.subfield-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.subfield-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--italy-green);
  transform: translateX(4px);
}

.subfield-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.subfield-card .course-count {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* ===== COURSES LIST ===== */
.courses-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
}

.course-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.course-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--italy-green);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.course-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  line-height: 1.3;
}

.course-card .university-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.course-card .course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-xs);
}

.course-card .course-duration {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.course-card .course-language {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.language-english {
  background: rgba(52, 199, 89, 0.15);
  color: rgba(52, 199, 89, 0.9);
  border: 1px solid rgba(52, 199, 89, 0.25);
}

.language-italian {
  background: rgba(255, 159, 10, 0.15);
  color: rgba(255, 159, 10, 0.9);
  border: 1px solid rgba(255, 159, 10, 0.25);
}

.language-both {
  background: rgba(10, 132, 255, 0.15);
  color: rgba(10, 132, 255, 0.9);
  border: 1px solid rgba(10, 132, 255, 0.25);
}

/* ===== UNIVERSITY LIST ===== */
.university-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.university-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.3s ease backwards;
}

.university-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--italy-green), var(--italy-red));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.university-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--italy-green);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.university-card:hover::before {
  opacity: 1;
}

.university-card h3,
.university-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  line-height: 1.3;
}

.university-card .location {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  margin-bottom: var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.university-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-xs);
}

.university-card .year {
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.university-card .type {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-university {
  background: rgba(0, 140, 69, 0.15);
  color: rgba(0, 140, 69, 0.9);
  border: 1px solid rgba(0, 140, 69, 0.25);
}

.type-polytechnic {
  background: rgba(244, 245, 240, 0.15);
  color: rgba(244, 245, 240, 0.9);
  border: 1px solid rgba(244, 245, 240, 0.25);
}

.type-special {
  background: rgba(205, 33, 42, 0.15);
  color: rgba(205, 33, 42, 0.9);
  border: 1px solid rgba(205, 33, 42, 0.25);
}

/* Region Groups */
.region-group {
  margin-bottom: var(--spacing-lg);
}

.region-header {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.region-count {
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Course Counts */
.course-counts {
  margin-top: 5px;
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--text-tertiary);
  display: none;
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.empty-state p {
  font-family: 'Inter', sans-serif;
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

#reset-filters-empty, #reset-courses-filters-empty {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

#reset-filters-empty:hover, #reset-courses-filters-empty:hover {
  color: var(--italy-green);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  z-index: 999;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 0.9;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: var(--italy-green);
  border-color: var(--italy-green);
  transform: translateY(-3px);
}

/* ===== FOOTER ===== */
.footer {
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg) var(--spacing-md);
  position: relative;
  margin-top: var(--spacing-xl);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--italy-green) 33%, 
    var(--italy-white) 33% 66%, 
    var(--italy-red) 66%
  );
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  text-align: center;
}

.footer-brand h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: #F5F3E9;
}

.footer-brand p {
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.footer-info p {
  color: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
  margin-bottom: var(--spacing-xs);
  font-size: 0.9rem;
}

.footer-credit {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin-top: var(--spacing-sm);
}

.footer-heart {
  color: var(--italy-red);
  margin: 0 var(--spacing-xs);
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.footer-signature {
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-left: var(--spacing-xs);
}

.footer-flag {
  display: flex;
  height: 3px;
  border-radius: 1.5px;
  overflow: hidden;
  margin-top: var(--spacing-md);
}

.footer-flag .flag-stripe {
  flex: 1;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(15px);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.3s ease;
  margin: 0 auto;
}

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

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--italy-green) 33%, 
    var(--italy-white) 33% 66%, 
    var(--italy-red) 66%
  );
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  z-index: 1;
  backdrop-filter: blur(4px);
}

.modal-close:hover {
  background: rgba(205, 33, 42, 0.8);
  border-color: rgba(205, 33, 42, 0.8);
  color: white;
  transform: rotate(90deg);
}

.modal-header {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
}

.university-type, .course-field {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.university-year, .course-language {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.modal-body {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  background: rgba(255, 255, 255, 0.02);
}

.modal-body h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-location {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  margin-bottom: var(--spacing-lg);
}

.location-separator {
  color: var(--text-muted);
  margin: 0 var(--spacing-xs);
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== MODAL COURSES ===== */
.modal-courses {
  margin: var(--spacing-lg) 0;
}

.modal-courses h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.course-category {
  margin-bottom: var(--spacing-lg);
}

.course-category h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.modal-courses-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.modal-course-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.modal-course-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--italy-green);
  transform: translateY(-1px);
}

.modal-course-item h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  line-height: 1.3;
}

.modal-course-item .course-meta {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-wrap: wrap;
}

.course-field-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-course-item .course-duration {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.show-more {
  text-align: center;
  padding: var(--spacing-sm);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-style: italic;
  border-top: 1px dashed var(--border-color);
  margin-top: var(--spacing-sm);
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--italy-green);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 1px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-description {
  margin: var(--spacing-lg) 0;
}

.modal-description h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.modal-description p {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
}

.btn-primary {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, 
    rgba(0, 140, 69, 0.9), 
    rgba(0, 107, 54, 0.9)
  );
  color: white;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 140, 69, 0.5);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--italy-green);
}

.modal-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.italian-flag {
  display: flex;
  height: 3px;
  border-radius: 1.5px;
  overflow: hidden;
}

.italian-flag .flag-stripe {
  flex: 1;
}

/* ===== COURSE MARKERS ===== */
.course-marker {
  background: transparent;
  border: none;
}

.course-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid white;
  transition: all var(--transition-normal);
}

.course-icon:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.course-card {
  animation: slideInRight 0.3s ease backwards;
}

.field-card {
  animation: slideInRight 0.4s ease backwards;
}
/* ===== ENHANCED LOADING SCREEN ===== */
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  opacity: 0.5;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.loading-step.active {
  color: var(--italy-green);
  opacity: 1;
  background: rgba(0, 140, 69, 0.05);
  border-left: 3px solid var(--italy-green);
}

.loading-step.completed {
  color: var(--text-tertiary);
  opacity: 0.8;
}

.loading-step.completed i {
  color: var(--italy-green);
}

.loading-step i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.loading-progress {
  width: 100%;
  max-width: 250px;
  margin: var(--spacing-lg) auto;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
  position: relative;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    var(--italy-green) 0%,
    var(--italy-white) 50%,
    var(--italy-red) 100%
  );
  border-radius: 3px;
  transition: width 0.5s ease;
  position: relative;
  z-index: 1;
}

.progress-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-family: 'Inter', monospace;
  font-weight: 600;
  letter-spacing: 1px;
}

.loading-error {
  background: rgba(205, 33, 42, 0.1);
  border: 1px solid rgba(205, 33, 42, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  text-align: left;
  max-width: 400px;
}

.loading-error i {
  color: var(--italy-red);
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  display: block;
}

.loading-error h3 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.1rem;
}

.loading-error p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
}

.loading-error ul {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.loading-error li {
  margin-bottom: var(--spacing-xs);
}

.reload-btn {
  background: linear-gradient(135deg, var(--italy-green), var(--italy-red));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

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

.reload-btn:active {
  transform: translateY(0);
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

/* Smooth transitions for loading screen */
#loading {
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loading screen content animation */
.loading-content {
  animation: fadeInUp 0.6s ease;
}

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

/* ===== MOBILE RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
  /* VIEW TOGGLE - Mobile improvements */
  .view-toggle {
    top: var(--spacing-sm);
    width: calc(100% - var(--spacing-md));
    max-width: 400px;
    margin-top: env(safe-area-inset-top, 0px);
  }
  
  .view-option {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
    min-height: 44px;
  }
  
  .view-option span {
    display: none;
  }
  
  .view-option i {
    margin: 0;
    font-size: 1.1rem;
  }
  
  /* HERO SECTION - Better mobile spacing */
  .hero-section {
    min-height: 600px;
    min-height: -webkit-fill-available;
    padding-top: env(safe-area-inset-top, 0px);
  }
  
  .hero-title h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin-bottom: var(--spacing-md);
    padding: 0 var(--spacing-sm);
  }
  
  .hero-subtitle p {
    font-size: 1rem;
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
  }
  
  .hero-stats {
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero-stats span {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
  }
  
  /* MAP CONTROLS - Stack vertically on mobile */
  .map-controls {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    width: calc(100% - var(--spacing-md));
    margin: var(--spacing-sm) auto var(--spacing-md);
    position: relative;
    top: 0;
    background: rgba(20, 20, 22, 0.95);
  }
  
  .control-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .control-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem var(--spacing-md);
    font-size: 0.95rem;
  }
  
  .btn-text {
    display: inline !important;
  }
  
  .search-container {
    width: 100%;
    max-width: none;
  }
  
  /* MAP SECTION */
  .map-section {
    height: 60vh;
    min-height: 450px;
    width: calc(100% - var(--spacing-md));
    margin-bottom: var(--spacing-lg);
  }
  
  .map-legend {
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    min-width: 140px;
    font-size: 0.8rem;
  }
  
  /* SIDEBAR FIXES - Works in both portrait & landscape */
  .sidebar {
    max-width: 100%;
    transition: right 0.3s ease;
  }
  
  #courses-panel {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: -webkit-fill-available !important;
  }
  
  .sidebar-filters {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  /* Touch feedback */
  .university-card:active,
  .course-card:active,
  .field-card:active,
  .subfield-card:active {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(1px);
  }
  
  /* Tap targets */
  .sidebar-close,
  .modal-close,
  .clear-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* iOS fixes */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  
  .leaflet-container {
    -webkit-tap-highlight-color: transparent;
  }
  
  .sidebar-content,
  .modal-content {
    -webkit-overflow-scrolling: touch;
  }
  
  /* BREADCRUMB */
  .courses-breadcrumb {
    min-width: auto;
    width: 100%;
    padding: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .breadcrumb-item {
    max-width: 100px;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* FIELDS LIST */
  .fields-list {
    grid-template-columns: 1fr;
  }
  
  /* MODAL */
  .modal-content {
    max-width: 95%;
    background: rgba(20, 20, 22, 0.98);
    margin: var(--spacing-sm);
  }
  
  .modal-stats {
    grid-template-columns: 1fr;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  /* EXTRA SMALL PHONES */
  @media (max-width: 480px) {
    .control-btn {
      padding: 0.875rem;
      justify-content: center;
      font-size: 0.9rem;
    }
    
    .map-controls {
      flex-direction: column;
      width: calc(100% - var(--spacing-sm));
      padding: var(--spacing-xs);
    }
    
    .control-group {
      flex-direction: column;
      gap: var(--spacing-xs);
    }
    
    .search-container {
      margin-top: 0;
      order: 0;
    }
    
    .back-to-top {
      bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px));
      right: var(--spacing-md);
      width: 44px;
      height: 44px;
    }
    
    .hero-title h1 {
      font-size: clamp(1.8rem, 4vw, 2.5rem);
      padding: 0 var(--spacing-xs);
    }
    
    .hero-subtitle p {
      font-size: 0.95rem;
      padding: 0 var(--spacing-sm);
    }
    
    .courses-breadcrumb {
      min-width: 120px;
      padding: 0.375rem;
    }
    
    .breadcrumb-item {
      max-width: 80px;
      font-size: 0.8rem;
      padding: 0.3rem 0.5rem;
    }
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .view-toggle,
  .map-controls,
  .back-to-top,
  .sidebar,
  #courses-panel {
    display: none !important;
  }
  
  .hero-section {
    height: auto;
    min-height: auto;
  }
  
  .hero-background {
    background: white !important;
  }
  
  .hero-title h1 {
    -webkit-text-fill-color: black !important;
    color: black !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .map-section {
    height: 500px;
    page-break-inside: avoid;
  }
  /* ===== ROADMAP LINK IN HERO SECTION ===== */
.hero-subtitle .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 25px 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, 
        rgba(0, 140, 69, 0.2) 0%, 
        rgba(244, 245, 240, 0.1) 50%,
        rgba(205, 33, 42, 0.2) 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(255, 255, 255, 0.1) inset,
        0 -1px 2px rgba(0, 0, 0, 0.1) inset;
    animation: pulseGlow 3s infinite ease-in-out;
}

.hero-subtitle .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        transparent 0%,
        rgba(0, 140, 69, 0.1) 20%,
        rgba(244, 245, 240, 0.1) 50%,
        rgba(205, 33, 42, 0.1) 80%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-subtitle .nav-link:hover {
    background: linear-gradient(135deg, 
        rgba(0, 140, 69, 0.3) 0%, 
        rgba(244, 245, 240, 0.2) 50%,
        rgba(205, 33, 42, 0.3) 100%
    );
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(0, 140, 69, 0.4),
        0 8px 20px rgba(205, 33, 42, 0.3),
        0 2px 8px rgba(255, 255, 255, 0.12) inset,
        0 -1px 2px rgba(0, 0, 0, 0.15) inset;
    letter-spacing: 0.8px;
}

.hero-subtitle .nav-link:hover::before {
    opacity: 1;
}

.hero-subtitle .nav-link i {
    font-size: 1.1rem;
    color: var(--italy-green);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hero-subtitle .nav-link:hover i {
    color: white;
    transform: rotate(-15deg) scale(1.2);
    text-shadow: 0 0 10px rgba(0, 140, 69, 0.7);
}
   @keyframes pulseGlow {
        0%, 100% { 
            box-shadow: 
                0 4px 15px rgba(0, 0, 0, 0.2),
                0 1px 3px rgba(255, 255, 255, 0.1) inset;
        }
        50% { 
            box-shadow: 
                0 6px 20px rgba(0, 140, 69, 0.4),
                0 8px 25px rgba(205, 33, 42, 0.3),
                0 2px 8px rgba(255, 255, 255, 0.12) inset;
        }
    }
    
    @keyframes roadMove {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-2px); }
        75% { transform: translateX(2px); }
    }
/* Animated road icon */
@keyframes roadMove {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.hero-subtitle .nav-link i {
    animation: roadMove 2s infinite ease-in-out;
}

/* Glowing pulse animation */
@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.2),
            0 1px 3px rgba(255, 255, 255, 0.1) inset;
    }
    50% { 
        box-shadow: 
            0 6px 20px rgba(0, 140, 69, 0.4),
            0 8px 25px rgba(205, 33, 42, 0.3),
            0 2px 8px rgba(255, 255, 255, 0.12) inset;
    }
}

/* Flag stripes effect on hover */
.hero-subtitle .nav-link::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        var(--italy-green) 0%, 
        var(--italy-green) 33%, 
        transparent 33%, 
        transparent 66%, 
        var(--italy-red) 66%, 
        var(--italy-red) 100%
    );
    border-radius: 52px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-subtitle .nav-link:hover::after {
    opacity: 0.3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hero-subtitle .nav-link {
        margin: 15px 0 20px 0;
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .hero-subtitle .nav-link i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-subtitle .nav-link {
        display: flex;
        justify-content: center;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
}
}
/* Simple Centered YouTube Carousel with Side Buttons */
.youtube-carousel {
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-secondary);
  position: relative;
}

.youtube-carousel h2 {
  margin-bottom: 15px;
  font-size: 1.6rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.youtube-carousel h2 i {
  color: #FF0000;
}

.youtube-carousel p {
  color: var(--text-secondary);
  margin-bottom: 25px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
}

/* Carousel Container */
.carousel-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* Centered video */
.video-centered {
  flex: 1;
  max-width: 560px;
  min-width: 0; /* Important for flex shrink */
}

.video-centered iframe {
  width: 100%;
  height: 315px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Navigation Buttons - Sides */
.carousel-btn {
  background: var(--italy-green);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 140, 69, 0.2);
}

.carousel-btn:hover {
  background: var(--italy-red);
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(205, 33, 42, 0.3);
}

.carousel-btn:active {
  transform: scale(0.95);
}

/* Hide buttons when only one video */
.carousel-container:has(.video-centered:only-child) .carousel-btn {
  display: none;
}

/* Video info */
.video-info {
  margin-top: 15px;
  padding: 0 10px;
  text-align: center;
}

.video-info h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-weight: 600;
}

.video-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.video-info i {
  color: var(--italy-green);
  font-size: 0.8rem;
}

/* Dots indicator for multiple videos */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--italy-green);
  transform: scale(1.3);
}

.carousel-dot:hover {
  background: var(--italy-red);
}

/* Responsive */
@media (max-width: 768px) {
  .carousel-container {
    gap: 10px;
    max-width: 95%;
  }
  
  .video-centered iframe {
    height: 250px;
  }
  
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    gap: 5px;
  }
  
  .video-centered iframe {
    height: 200px;
  }
  
  .carousel-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    position: absolute;
    z-index: 10;
  }
  
  .carousel-btn.prev {
    left: 5px;
  }
  
  .carousel-btn.next {
    right: 5px;
  }
  
  .video-info h3 {
    font-size: 1rem;
  }
  
  .video-info p {
    font-size: 0.85rem;
  }
}

/* Hide dots on very small screens */
@media (max-width: 350px) {
  .carousel-dots {
    display: none;
  }
}