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

:root {
  --background: 32 60% 90%; /* sabbia chiara */
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 146 34% 45%;   /* verde cactus */
  --primary-foreground: 210 40% 98%;
  --secondary: 32 60% 70%;  /* sabbia intensa */
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 42 100% 70%;    /* giallo sole */
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.75rem;
}

body {
  font-family: 'Comfortaa', sans-serif;
  background-color: #d7efc7;
  color: #386641;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s, color 0.3s;
}

.navbar {
  background: linear-gradient(to right, #a8c375, #c4df8f);
  padding: 1rem 0;
}

.navbar-brand, .nav-link {
  color: white !important;
}

.nav-link:hover {
  opacity: 0.9;
}

.card-glass {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(209, 213, 219, 0.3);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: white;
  padding: 1rem;
  border-radius: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.badge-item.unlocked {
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-item.locked {
  opacity: 0.6;
  filter: grayscale(1);
  border: 1px dashed #e5e7eb;
}

.cactus-button {
  /* background: linear-gradient(to right,  #a8c375, #c4df8f); */
  background: #cdc9fd;
  color: #386641;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cactus-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-value {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(to right,  #a8c375, #c4df8f);
  color: #386641;
}

.exercise-card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-control {
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #4A5568;
  box-shadow: 0 0 0 2px rgba(74, 85, 104, 0.2);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #f8f9fa;
  }

  .card-glass {
    background-color: rgba(26, 26, 26, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .exercise-card {
    background-color: #2d2d2d;
  }

  .form-control {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
    color: #f8f9fa;
  }

  .form-control:focus {
    border-color: #6B7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
  }
}

.question-text {
  white-space: pre-wrap;
}

/* Stili specifici per la pagina progressi */
.progressi-stats .card-glass {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.progressi-stats .card-glass:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.progress-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.progress-custom {
  height: 25px;
  border-radius: 12px;
  background-color: #e9ecef;
  overflow: hidden;
  position: relative;
}

.progress-custom .progress-bar {
  height: 100%;
  border-radius: 12px;
  transition: width 0.8s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: white;
  font-weight: 600;
  font-size: 13px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  font-weight: 600;
  font-size: 13px;
  z-index: 10;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.table-progressi {
  border-radius: 15px;
  overflow: hidden;
}

.table-progressi th {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  font-weight: 600;
}

.table-progressi td {
  vertical-align: middle;
  border-color: rgba(0, 0, 0, 0.05);
  padding: 15px 12px;
}

.badge-custom {
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.competenze-badge {
  padding: 6px 12px;
  margin: 2px;
  font-size: 0.85em;
  border-radius: 15px;
  font-weight: 500;
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.obiettivo-card {
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.obiettivo-card:hover {
  border-color: #28a745;
  transform: scale(1.02);
}

.competenze-badge {
  transition: all 0.3s ease;
}

.competenze-badge:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .progressi-stats .col-lg-3 {
    margin-bottom: 1rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .h2 {
    font-size: 1.8rem;
  }
}

/* Correzione errori di linting - Barre di progresso senza Jinja2 inline */
.progress-table {
    width: 100px;
    height: 20px;
    margin-right: 8px;
}

.progress-inline {
    width: 80px;
    height: 15px;
    margin-right: 8px;
}

/* Classi helper per evitare stili inline problematici */
.w-80px { width: 80px !important; }
.w-100px { width: 100px !important; }
.h-15px { height: 15px !important; }
.h-20px { height: 20px !important; }
.me-2 { margin-right: 0.5rem !important; }