/* ============================================
   GRUPPI STUDIO — Redesign Grafico
   ============================================ */

/* --- Hero decorations --- */
.gs-hero {
  overflow: hidden;
  position: relative;
  padding-top: 80px !important;
  padding-bottom: 24px !important;
}

.gs-hero-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.gs-deco {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.18;
  animation: gsDeco 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
  color: white;
}
.gs-deco-1 { top: 15%; left: 5%;  animation-delay: 0s;   font-size: 2.8rem; }
.gs-deco-2 { top: 10%; right: 8%; animation-delay: 1.2s; font-size: 3.2rem; }
.gs-deco-3 { bottom: 20%; left: 12%; animation-delay: 0.6s; font-size: 2.2rem; }
.gs-deco-4 { bottom: 10%; right: 5%; animation-delay: 2s;  font-size: 2.5rem; }
.gs-deco-5 { top: 50%; left: 50%; animation-delay: 1.8s; font-size: 2rem; transform: translate(-50%,-50%); }

@keyframes gsDeco {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.18; }
  50% { transform: translateY(-12px) rotate(8deg); opacity: 0.28; }
}

/* --- Hero badge --- */
.gs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.gs-badge-dot {
  width: 8px;
  height: 8px;
  background: #34e89e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* --- Hero stats pills --- */
.gs-stats-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.gs-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
}

.gs-stat-icon { font-size: 1.1rem; }
.gs-stat-icon i { color: white; }
.gs-stat-num  { font-size: 1.1rem; font-weight: 700; }
.gs-stat-label { font-weight: 400; opacity: 0.9; font-size: 0.85rem; }

/* --- Section header --- */
.gs-section-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f3f4f6;
}

/* --- Testo SEO --- */
.gs-seo-intro {
  text-align: left;
  color: #555;
  font-size: 0.95rem;
  max-width: none;
  margin: 0;
  line-height: 1.7;
}

/* --- Search bar --- */
.gs-search-wrapper {
  position: relative;
  max-width: none;
  margin: 0;
}

.gs-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

.gs-search-input {
  width: 100%;
  padding: 14px 46px 14px 50px;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  color: #1f2937;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.gs-search-input:focus {
  border-color: #0fabbc;
  box-shadow: 0 2px 16px rgba(15,171,188,0.18);
}

.gs-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #9ca3af;
  font-size: 0.9rem;
  display: none;
  transition: color 0.2s;
}

.gs-search-clear:hover { color: #374151; }
.gs-search-clear.visible { display: block; }

.gs-search-spinner {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #0fabbc;
  border-radius: 50%;
  animation: gsSpinRot 0.6s linear infinite;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s;
  pointer-events: none;
  z-index: 5;
}
.gs-search-spinner.visible {
  opacity: 1;
  visibility: visible;
}
@keyframes gsSpinRot {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}

/* --- Corsi Grid --- */
.corsi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem 0;
  text-align: left;
}

.corso-link-card {
  background: white;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  display: block;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.4s ease forwards;
}

.corso-link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(15,171,188,0.18);
  border-color: #0fabbc;
}

/* Colored left accent bar */
.corso-card-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0fabbc, #43aaf3);
  border-radius: 14px 0 0 14px;
  transition: width 0.25s ease;
}

.corso-link-card:hover .corso-card-accent {
  width: 6px;
}

.corso-link-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem 1.5rem;
}

.corso-link-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.corso-card-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: #f0fafb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.corso-title-block {
  flex: 1;
  min-width: 0;
}

.corso-title-block h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.corso-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid #f3f4f6;
}

.corso-platform-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #e8f6f8;
  color: #0fabbc;
}

.corso-platform-badge.telegram,
.corso-platform-badge.telegramese {
  background: #e8f4fd;
  color: #35AAE6;
}

.corso-platform-badge.whatsapp {
  background: #e8f9ee;
  color: #128c7e;
}

.stats-number {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
}

.stats-arrow-wrap {
  width: 30px;
  height: 30px;
  background: #f9fafb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stats-arrow {
  font-size: 0.85rem;
  color: #9ca3af;
  transition: transform 0.2s ease, color 0.2s ease;
}

.corso-link-card:hover .stats-arrow-wrap {
  background: #0fabbc;
}

.corso-link-card:hover .stats-arrow {
  transform: translateX(3px);
  color: white;
}

@keyframes cardFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* --- No results --- */
.gs-no-results {
  text-align: center;
  padding: 4rem 2rem;
}
.gs-no-results-icon { font-size: 3rem; margin-bottom: 1rem; color: #9ca3af; }
.gs-no-results h3 { color: #1f2937; margin: 0 0 0.5rem 0; }
.gs-no-results p  { color: #6b7280; margin: 0; }

/* --- No corsi --- */
.no-corsi-message {
  text-align: center;
  padding: 3rem 2rem;
  background: #f9fafb;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  margin: 2rem 0;
}
.no-corsi-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.no-corsi-message h3 { margin: 0 0 0.5rem 0; color: #1f2937; }
.no-corsi-message p  { margin: 0; color: #6b7280; }

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  margin-top: 3rem;
}

.cta-inner {
  background: linear-gradient(135deg, #0fabbc 0%, #43aaf3 100%);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-inner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.cta-inner::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.cta-icon-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.cta-icon-row i { color: white; opacity: 0.9; }

.cta-inner h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

.cta-inner p {
  margin: 0 0 1.5rem 0;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.cta-inner .btn {
  position: relative;
  z-index: 1;
}

.section-description {
  text-align: center;
  color: #6b7280;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

/* ============================================
   NUOVO LAYOUT — AMBITO E PLATFORM
   ============================================ */

.gs-ambiti-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 2rem 0;
}

.gs-ambito-section {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  border: 1px solid #e5e7eb;
  margin-bottom: 1.25rem;
  position: relative;
}

.gs-ambito-header {
  position: absolute;
  top: -14px;
  left: 16px;
  z-index: 1;
}

.gs-ambito-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0fabbc, #43aaf3);
  color: white;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15,171,188,0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gs-ambito-title-pill .pill-icon {
  font-size: 0.75rem;
}

.gs-ambito-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.gs-ambito-row:last-child {
  margin-bottom: 0;
}

/* Platform-specific accent colors */
.corso-card-accent.platform-pegaso {
  background: linear-gradient(180deg, #1e3a8a, #3b82f6);
}

.corso-card-accent.platform-mercatorum {
  background: linear-gradient(180deg, #1d4ed8, #f59e0b);
}

.corso-card-accent.platform-san-raffaele {
  background: linear-gradient(180deg, #166534, #22c55e);
}

.corso-link-card:hover .corso-card-accent.platform-pegaso {
  background: linear-gradient(180deg, #2563eb, #60a5fa);
}

.corso-link-card:hover .corso-card-accent.platform-mercatorum {
  background: linear-gradient(180deg, #1d4ed8, #fbbf24);
}

.corso-link-card:hover .corso-card-accent.platform-san-raffaele {
  background: linear-gradient(180deg, #15803d, #4ade80);
}

/* Platform-specific card icon backgrounds */
.corso-card-icon.platform-icon-pegaso {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.corso-card-icon.platform-icon-mercatorum {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.corso-card-icon.platform-icon-san-raffaele {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

/* FA icon colors inside platform icons */
.corso-card-icon.platform-icon-pegaso i {
  color: #1e3a8a;
  font-size: 1.3rem;
}

.corso-card-icon.platform-icon-mercatorum i {
  color: #9A2F26;
  font-size: 1.3rem;
}

.corso-card-icon.platform-icon-san-raffaele i {
  color: #166534;
  font-size: 1.3rem;
}

/* FA icon in no-corsi and no-results */
.no-corsi-icon i {
  font-size: 2.5rem;
  color: #9ca3af;
}

/* Platform-specific badges */
.corso-platform-badge.platform-badge-pegaso {
  background: #e9e4fc;
  color: #5c24ce;
}

.corso-platform-badge.platform-badge-mercatorum {
  background: #fce8e6;
  color: #9A2F26;
}

.corso-platform-badge.platform-badge-san-raffaele {
  background: #e8ecf0;
  color: #18233E;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .gs-stats-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .gs-stat-pill {
    width: fit-content;
  }

  .corso-platform-badge {
    display: none;
  }

  .corso-card-meta {
    gap: 0.25rem;
  }

  .cta-inner {
    padding: 2rem 1.25rem;
  }

  .gs-ambiti-container {
    gap: 1.5rem;
  }

  .gs-ambito-section {
    padding: 1rem;
  }

  .gs-ambito-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .gs-ambito-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  .gs-ambito-row {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}
