:root {
  --navbarbackground: #1a1a1a;
  --navbarcolor: #fff;
  --formcontainerbackground: #1a1a1a;
  --formcontainercolor: #fff;
  --h1backgroundcolor: #1a1a1a;
  --h1color: white;
  --thchildcolor: #666666;
  --tdcolor: #555555;
  --thcolor: white;
  --bodybackground: #1a1a1a;
  --sconosciutavar: #545454;
  --thtdcolor: white;
  --tdacolor: #B57EDC;
  --tdahover: #FFB6C1;
  --tdactive: #8E44AD;
  --text-color: #fff;
  --bg-color: #1a1a1a;
  --button-bg: #16ab63;
  --button-bg-hover: #0f7041;
  --highlight-color: #72008f;
  
  /* Variabili dinamiche - verranno sovrascritte da theme.js */
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --card-hover-border: #16ab63;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 15px 35px rgba(22, 171, 99, 0.2);
  --card-title-color: #ffffff;
  --card-meta-color: rgba(255, 255, 255, 0.6);
  --card-description-color: rgba(255, 255, 255, 0.8);
  --filter-placeholder-color: rgba(255, 255, 255, 0.5);
  --filter-text-color: #ffffff;
  --stats-text-color: #ffffff;
  --footer-text-color: #888888;
  --modal-text-color: #ffffff;
  --modal-meta-color: rgba(255, 255, 255, 0.7);
  --filter-bg: rgba(255, 255, 255, 0.08);
  --stats-bg: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: var(--bodybackground);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ========== SEZIONE INTRODUTTIVA ========== */
.intro-section {
  max-width: 900px;
  margin: 0 auto 30px auto;
  padding: 25px 30px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  border: 1px solid var(--card-border);
  text-align: center;
  animation: fadeInUp 0.6s ease forwards;
}

.intro-content p {
  color: var(--card-description-color);
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 16px;
}

.intro-callout {
  margin-top: 20px;
  padding: 20px;
  background: rgba(22, 171, 99, 0.1);
  border-radius: 20px;
  border-left: 4px solid var(--button-bg);
}

.intro-callout i {
  font-size: 28px;
  color: var(--button-bg);
  margin-bottom: 10px;
  display: inline-block;
}

.intro-callout span {
  display: block;
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--card-title-color);
}

.intro-callout p {
  font-size: 14px;
  margin-bottom: 15px;
}

.telegram-join-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--button-bg);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 5px;
}

.telegram-join-btn:hover {
  background: var(--button-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(22, 171, 99, 0.3);
}

.telegram-join-btn i {
  color: #26A5E4;
  transition: color 0.3s ease;
}

.telegram-join-btn:hover i {
  color: #26A5E4 !important;
}

/* ========== ANIMAZIONE STELLE ========== */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 5s infinite;
}

.star.green {
  background-color: #16ab63;
  box-shadow: 0 0 6px #16ab63;
}

.star.purple {
  background-color: #72008f;
  box-shadow: 0 0 6px #72008f;
}

@keyframes twinkle {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(20px);
  }
}

/* ========== HEADER ========== */
.stories-header {
  text-align: center;
  padding: 20px 0;
  position: relative;
  z-index: 10;
}

.main-content {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 800px);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 10px 20px;
}

.stories-header h1 {
  font-size: 42px;
  margin: 20px 0;
  background: linear-gradient(45deg, #16ab63, #72008f, #f9359d);
  background-size: 300% 300%;
  animation: gradientShift 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Sostituisci le regole per .back-button e .theme-toggle-container */

/* ========== BOTTONI DI NAVIGAZIONE ========== */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--button-bg);
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin: 20px 0 0 20px;
  width: fit-content;
}

.back-button:hover {
  background: var(--button-bg-hover);
  transform: translateX(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-button::before {
  content: "←";
  font-size: 20px;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle-container {
  display: flex;
  justify-content: flex-end;
  margin: 30px 20px 0 0;  /* 30px dall'alto, 20px a destra */
  position: relative;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--navbarbackground);
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  width: fit-content;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #16ab63;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

#theme-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--navbarcolor);
}

/* Aggiungi un container per i controlli in alto */
.top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ========== FILTRI ========== */
.filters-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px auto 0 auto;
  flex-wrap: wrap;
  padding: 0 20px;
  max-width: 1800px;
}

.filter-input, .filter-select {
  padding: 12px 20px;
  border-radius: 50px;
  border: 2px solid var(--card-border);
  background: var(--filter-bg);
  color: var(--filter-text-color);
  font-size: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  min-width: 250px;
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 10px rgba(22, 171, 99, 0.3);
}

.filter-input::placeholder {
  color: var(--filter-placeholder-color);
}

.filter-select option {
  background: var(--bg-color);
  color: var(--filter-text-color);
}

/* ========== STATS ========== */
.stats-container {
  text-align: center;
  margin: 20px auto;
  padding: 10px 20px;
  background: var(--stats-bg);
  border-radius: 50px;
  display: inline-block;
  width: auto;
  backdrop-filter: blur(10px);
}

.stats-container p {
  color: var(--stats-text-color);
  font-size: 14px;
}

/* ========== GRIGLIA STORIE ========== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ========== CARD STORIA ========== */
.story-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0.8;
}

.story-card:hover {
  transform: translateY(-10px);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

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

/* Copertina */
.card-cover {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #2c3e50, #1a1a2e);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.story-card:hover .card-cover img {
  transform: scale(1.05);
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #16ab63, #72008f);
}

/* Badge autore */
.author-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.story-card:hover .author-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Contenuto card */
.card-content {
  padding: 20px;
}

.card-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--card-title-color);
  line-height: 1.3;
}

.card-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 13px;
  color: var(--card-meta-color);
  flex-wrap: wrap;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--card-description-color);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link social nella card */
.card-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.card-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  opacity: 0.7;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.card-links a:hover {
  opacity: 1;
  transform: translateY(-3px);
  background: var(--button-bg);
}

/* ========== HINT PER UTENTI ========== */
/* Hint descrizione lunga */
.expand-hint {
  font-size: 11px;
  color: #16ab63;
  margin-top: 8px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px dashed rgba(22, 171, 99, 0.3);
}

.expand-hint i {
  font-size: 10px;
}

/* Hint clicca sulla card */
.click-hint {
  font-size: 11px;
  color: #72008f;
  margin-top: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(181, 16, 189, 0.1);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.click-hint i {
  font-size: 12px;
}

.story-card:hover .click-hint {
  background: rgba(181, 16, 189, 0.2);
  color: #c43ad4;
}

/* Tooltip per link social */
.card-links .social-link {
  position: relative;
}

.card-links .social-link:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  font-weight: normal;
}

/* ========== LOADING E STATI VUOTI ========== */
.loading-container, .error-container, .no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-color);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--button-bg);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.error-container button {
  margin-top: 20px;
  padding: 10px 25px;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.error-container button:hover {
  background: var(--button-bg-hover);
  transform: scale(1.05);
}

.no-results i {
  color: var(--button-bg);
  margin-bottom: 15px;
  opacity: 0.7;
}

.no-results h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-color);
  border-radius: 25px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.4s ease;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.3s ease;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-cover {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 25px 25px 0 0;
}

.modal-body {
  padding: 25px;
}

.modal-title {
  font-size: 28px;
  margin-bottom: 15px;
  background: linear-gradient(45deg, #16ab63, #72008f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
  color: var(--modal-meta-color);
  flex-wrap: wrap;
}

.modal-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-description {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--modal-text-color);
}

/* Social hint nel modal */
.social-hint {
  font-size: 13px;
  color: var(--modal-meta-color);
  margin-bottom: 15px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-hint i {
  font-size: 14px;
  color: var(--button-bg);
}

/* Pulsanti social nel modal */
.modal-social-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.modal-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.modal-social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-social-btn.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.modal-social-btn.telegram {
  background: #0088cc;
  color: white;
}

.modal-social-btn.patreon {
  background: #ff424d;
  color: white;
}

.modal-social-btn.youtube {
  background: #ff0000;
  color: white;
}

.modal-social-btn.twitter {
  background: #1da1f2;
  color: white;
}

.modal-social-btn.facebook {
  background: #4267b2;
  color: white;
}

.modal-social-btn.tiktok {
  background: #010101;
  color: white;
}

.modal-social-btn.discord {
  background: #5865f2;
  color: white;
}

.modal-social-btn.twitch {
  background: #9146ff;
  color: white;
}

.modal-social-btn.altro {
  background: #6c757d;
  color: white;
}

/* ========== FOOTER ========== */
.stories-footer {
  margin-top: 60px;
  text-align: center;
  font-size: 14px;
  color: var(--footer-text-color);
  padding: 20px;
  position: relative;
  z-index: 10;
}

.stories-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--button-bg), transparent);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .stories-header h1 {
    font-size: 28px;
  }
  
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }
  
  .filters-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 15px;
  }
  
  .filter-input, .filter-select {
    width: 100%;
    min-width: auto;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .back-button {
    top: 10px;
    left: 10px;
    padding: 8px 15px;
    font-size: 13px;
  }
  
  .theme-toggle-container {
    top: 70px;
    right: 10px;
  }
  
  .theme-toggle {
    padding: 5px 12px;
    gap: 8px;
  }
  
  .switch {
    width: 40px;
    height: 20px;
  }
  
  .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }
  
  input:checked + .slider:before {
    transform: translateX(20px);
  }
  
  #theme-label {
    font-size: 11px;
  }
  
  .modal-title {
    font-size: 22px;
  }
  
  .modal-meta {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
  }
  
  .main-content {
    padding: 0 15px;
  }
  
  .intro-section {
    margin: 15px;
    padding: 20px;
  }
  
  .intro-callout span {
    font-size: 16px;
  }
  
  .intro-callout p {
    font-size: 13px;
  }
  
  .telegram-join-btn {
    padding: 10px 18px;
    font-size: 14px;
  }
  
  .card-title {
    font-size: 18px;
  }
  
  .card-meta {
    font-size: 11px;
    gap: 10px;
  }
  
  .card-description {
    font-size: 13px;
  }
  
  .card-links a {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .click-hint {
    font-size: 10px;
    padding: 5px 8px;
  }
  
  .modal-social-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  .modal-social-buttons {
    gap: 8px;
  }
}

/* ========== TABLET ========== */
@media (min-width: 769px) and (max-width: 1024px) {
  .stories-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }
  
  .stories-header h1 {
    font-size: 36px;
  }
  
  .filter-input, .filter-select {
    min-width: 200px;
  }
}

/* ========== UTILITY ========== */
/* Scrollbar personalizzata */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--button-bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--button-bg-hover);
}

/* Selezione testo */
::selection {
  background: var(--button-bg);
  color: white;
}
/* ========== TOP CONTROLS RESPONSIVE ========== */
@media (max-width: 768px) {
  .top-controls {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    padding: 0 15px;
  }
  
  .back-button {
    margin: 15px 0 0 0;
    justify-content: center;
  }
  
  .theme-toggle-container {
    margin: 0;
    justify-content: center;
  }
  
  .theme-toggle {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .top-controls {
    padding: 0 20px;
  }
  
  .back-button {
    margin-left: 0;
  }
  
  .theme-toggle-container {
    margin-right: 0;
  }
}
/* ========== PULSANTE PREFERITI ========== */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: none;
    color: #ff6b6b;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
}

.story-card:hover .favorite-btn {
    opacity: 1;
    transform: scale(1);
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ff4757;
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
    transform: scale(1);
}

.favorite-btn.active i {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ========== BADGE AGGIORNAMENTO ========== */
.update-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 10px rgba(255, 71, 87, 0.3);
    z-index: 10;
}

.update-badge i {
    font-size: 10px;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* ========== FILTRO PREFERITI ========== */
.favorites-filter-btn {
    padding: 12px 20px;
    border-radius: 50px;
    border: 2px solid var(--card-border);
    background: var(--filter-bg);
    color: var(--filter-text-color);
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.favorites-filter-btn:hover {
    border-color: #ff4757;
    transform: translateY(-2px);
}

.favorites-filter-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    border-color: #ff4757;
    color: white;
}

.favorites-filter-btn i {
    transition: transform 0.3s ease;
}

.favorites-filter-btn.active i {
    animation: heartBeat 0.3s ease;
}

/* ========== MODAL HEADER CON PREFERITI ========== */
.modal-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.modal-favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.modal-favorite-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-favorite-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    border-color: #ff4757;
    color: white;
}

.modal-favorite-btn i {
    font-size: 14px;
}

/* ========== NOTIFICA AGGIORNAMENTO NEL MODAL ========== */
.update-notice {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 71, 87, 0.2));
    border-left: 4px solid #ff4757;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInLeft 0.3s ease;
}

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

.update-date {
    color: #ff6b6b;
    font-size: 11px;
}

/* ========== TOAST NOTIFICHE ========== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification i {
    font-size: 20px;
}

.toast-notification.toast-success i {
    color: #16ab63;
}

.toast-notification.toast-info i {
    color: #3498db;
}

.toast-notification span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

/* ========== RESPONSIVE AGGIUNTE ========== */
@media (max-width: 768px) {
    .favorites-filter-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .modal-header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-favorite-btn {
        justify-content: center;
    }
    
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        transform: translateY(100px);
        justify-content: center;
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
    
    .favorite-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .update-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
}

/* ========== ANIMAZIONI CARDS ========== */
.story-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.story-card:active {
    transform: scale(0.98);
}

/* ========== STATS CON PREFERITI ========== */
.stats-container p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== ICONE METEO NELLE CARD ========== */
.card-meta i {
    width: 16px;
    text-align: center;
}
