/* Stile di base e reset */
:root {
  --primary-color: #00aaff;
  --secondary-color: #ff00ff;
  --dark-bg: #050816;
  --light-text: #f0f0f0;
  --card-bg: rgba(255, 255, 255, 0.05);
  --danger-color: #e74c3c;
  --success-color: #2ecc71;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--dark-bg);
  color: var(--light-text);
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================= */
/* STILI HEADER E NAVIGAZIONE PRINCIPALE         */
/* ============================================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
  animation: slideDown 0.8s ease-out;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-img {
  height: 150px; /* Dimensione aumentata come da richiesta precedente */
  width: auto;
}

.user-profile-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  padding: 8px 15px;
  border-radius: 50px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
}

.user-profile-box:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
  font-weight: 600;
  color: var(--light-text);
  white-space: nowrap;
}

.arrow-icon {
  margin-left: 15px;
  transition: transform 0.3s ease-in-out;
}

.user-profile-box.open .arrow-icon {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: 120%;
  right: 0;
  background-color: #1a1f36;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  width: 220px;
  z-index: 1000;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
}

.profile-dropdown a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--light-text);
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.profile-dropdown a:hover {
  background-color: rgba(0, 170, 255, 0.2);
}

.profile-dropdown a i {
  margin-right: 15px;
  width: 20px;
  text-align: center;
  color: var(--primary-color);
}

/* ============================================= */
/* STILI CONTENUTO HOMEPAGE                      */
/* ============================================= */

.hero-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0;
}

.hero-section h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}

.hero-section p {
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.btn, button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  font-family: 'Poppins', sans-serif;
}

.btn-primary, button {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
}

.btn-primary:hover, button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

.how-it-works {
  display: flex;
  justify-content: space-around;
  gap: 2rem;
  padding: 4rem 0;
  flex-wrap: wrap;
}

.feature-card {
  background-color: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  width: 300px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: popIn 0.5s ease-out backwards;
}

.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.4s; }

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================= */
/* POPUP MODALE LOGIN / REGISTRAZIONE (CON FIX)  */
/* ============================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  z-index: 101;
  transition: transform 0.2s;
}

.modal-close-btn:hover {
  transform: scale(1.2);
  color: var(--secondary-color);
}

.container {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
  width: 768px;
  max-width: 90%;
  min-height: 480px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

form {
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 50px;
  height: 100%;
  text-align: center;
}

h1 {
  font-weight: bold;
  margin: 0;
  color: var(--light-text);
}

.input-group {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  margin: 8px 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.input-group i {
  color: rgba(255, 255, 255, 0.7);
}

input {
  background: transparent;
  border: none;
  padding: 12px 15px;
  width: 100%;
  color: var(--light-text);
  font-family: 'Poppins', sans-serif;
}

input:focus {
  outline: none;
}

/* FIX PER L'AUTOFILL DEL BROWSER CHE CAUSA SFONDO BIANCO */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--light-text) !important; /* Mantiene il colore del testo corretto */
    caret-color: var(--light-text) !important; /* Mantiene il colore del cursore di testo */
    transition: background-color 5000s ease-in-out 0s; /* Trucco per evitare che il browser cambi lo sfondo */
}

.terms-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
  width: 100%;
  font-size: 14px;
}

.terms-container input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.terms-container label {
  color: #ccc;
}

.terms-container a {
  color: var(--primary-color);
  text-decoration: none;
}

.terms-container a:hover {
  text-decoration: underline;
}

.forgot-password {
  color: #ccc;
  font-size: 14px;
  text-decoration: none;
  margin: 15px 0;
}

button.ghost {
  background-color: transparent;
  border-color: #FFFFFF;
  border-width: 2px;
  border-style: solid;
}

/* Logica di animazione e fix per il popup */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0; /* FIX per nascondere il pannello */
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: var(--primary-color);
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}


/* ============================================= */
/* STILI AREA PERSONALE (ACCOUNT.PHP) - VERSIONE MODERNA E ANIMATA */
/* ============================================= */

.account-body {
    overflow: hidden;
    background-color: var(--dark-bg); /* Sfondo di base */
}

.account-grid-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* --- Sidebar Moderna --- */
.account-sidebar {
    background: rgba(10, 15, 30, 0.5); /* Sfondo semi-trasparente */
    border-right: 1px solid rgba(0, 170, 255, 0.2);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    backdrop-filter: blur(12px); /* Effetto vetro più pronunciato */
    transition: all 0.4s ease;
}

.sidebar-header {
    padding-bottom: 2rem;
    text-align: center;
}

.sidebar-header img {
    height: 60px;
    width: auto;
    transition: transform 0.4s ease;
}
.sidebar-header img:hover {
    transform: scale(1.05);
}

.account-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Aumentato spazio */
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: #aeb9e1;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background-color: rgba(0, 170, 255, 0.1);
    color: #fff;
    border-color: rgba(0, 170, 255, 0.3);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.nav-item i {
    width: 25px;
    margin-right: 15px;
    font-size: 1.2rem; /* Icone più grandi */
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-item.active i {
    transform: scale(1.1);
}

.sidebar-footer .btn-back-home {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 0.8rem;
    background-color: rgba(255, 255, 255, 0.05);
    color: #aeb9e1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-footer .btn-back-home:hover {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.4);
}


/* --- Main Content Moderno --- */
.account-main {
    padding: 3rem 4rem;
    overflow-y: auto;
    /* Sfondo a gradiente per dare profondità */
    background: radial-gradient(circle at 100% 0%, rgba(13, 18, 38, 1), var(--dark-bg) 50%);
}

.account-header h1 {
    font-size: 2.8rem; /* Titolo più grande */
    font-weight: 700;
}

.account-header .header-username {
    /* Testo a gradiente */
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.account-header p {
    font-size: 1.1rem;
    color: #aeb9e1;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.account-section {
    display: none;
    animation: fadeInScaleUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.account-section.active {
    display: block;
}

.account-section.exiting {
    animation: fadeOutScaleDown 0.5s cubic-bezier(0.755, 0.05, 0.855, 0.06);
}

.account-section h2 {
    font-size: 2rem;
    padding-bottom: 0.8rem;
    margin-bottom: 2.5rem; /* Aumentato spazio */
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    color: #fff;
}

.account-section h2 i {
    margin-right: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color); /* Effetto glow */
}

/* Stile per i form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #aeb9e1;
}

.form-group input {
    width: 100%;
    padding: 1rem; /* Padding aumentato */
    background-color: rgba(0, 0, 0, 0.3); /* Sfondo più scuro per contrasto */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; /* Bordi più arrotondati */
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.4);
}

.section-content-split {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* Pannello Avatar con animazione */
.avatar-panel, .info-panel {
  flex: 1;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-panel h3, .info-panel h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.avatar-upload-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
}

#avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.3);
  transition: transform 0.4s ease, opacity 0.4s ease;
  /* Animazione "breathing" */
  animation: avatarGlow 4s ease-in-out infinite;
}

#avatar-input {
  display: none;
}

.avatar-change-button {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 45px;
    height: 45px;
    background-color: var(--dark-bg);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: 2px solid #fff;
    transition: all 0.3s ease;
}

.avatar-change-button:hover {
  background-color: var(--primary-color);
  transform: scale(1.1) rotate(10deg);
}

/* Sezioni con card singola */
.password-form, .stories-grid {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.password-form {
  max-width: 600px;
}

/* Sezione Storie con Card Animate */

.story-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}
.story-card p {
  color: #aeb9e1;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}
.story-card-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  background-color: rgba(0, 170, 255, 0.2);
  padding: 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: all 0.3s ease;
}
.story-card:hover .story-card-link {
    background-color: var(--primary-color);
}

.no-stories-card {
  text-align: center;
  padding: 3rem 1.5rem;
}
.no-stories-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  animation: sadIconBounce 2s ease-in-out infinite;
}

/* Feedback Banner */
.feedback-banner {
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDownFadeIn 0.5s ease-out;
    border: 1px solid transparent;
}
.feedback-banner.success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #c8f5de;
    border-color: var(--success-color);
}
.feedback-banner.error {
    background-color: rgba(231, 76, 60, 0.15);
    color: #f5c8c8;
    border-color: var(--danger-color);
}

/* ============================================= */
/* NUOVE ANIMAZIONI PER AREA PERSONALE           */
/* ============================================= */
@keyframes fadeInScaleUp {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes fadeOutScaleDown {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

@keyframes avatarGlow {
    0% { box-shadow: 0 0 25px rgba(0, 170, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 170, 255, 0.6), 0 0 15px rgba(255, 0, 255, 0.4); }
    100% { box-shadow: 0 0 25px rgba(0, 170, 255, 0.3); }
}

@keyframes sadIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* ============================================= */
/* STILI PANNELLO ADMIN                          */
/* ============================================= */
.admin-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.admin-login-box {
  width: 100%;
  max-width: 450px;
  padding: 3rem 2.5rem;
  background-color: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.admin-login-box h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.admin-login-box p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.admin-form .input-group {
  margin-bottom: 1.5rem;
}

.admin-form button {
  width: 100%;
  margin-top: 1rem;
}

.error-banner {
  background-color: rgba(255, 0, 0, 0.2);
  color: #ffcccc;
  border: 1px solid rgba(255, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.admin-dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: var(--card-bg);
  border-radius: 15px;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.admin-info span {
  margin-right: 1.5rem;
  font-weight: 500;
}

.admin-content {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-content h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.admin-content p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  color: var(--light-text);
}

.admin-table th, .admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table thead th {
  background-color: rgba(0, 170, 255, 0.1);
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.admin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.admin-table td {
  font-size: 0.95rem;
}

.status-active {
  color: var(--success-color);
  font-weight: bold;
}

.status-inactive {
  color: var(--danger-color);
  font-weight: bold;
}

.admin-footer-link {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-block;
  margin-top: 10px;
}

.admin-footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.feedback-banner, .admin-feedback {
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  font-weight: 500;
  animation: slideDownFadeIn 0.5s ease-out;
  border: 1px solid transparent;
}

.feedback-banner.success, .admin-feedback.success {
  background-color: rgba(46, 204, 113, 0.15);
  color: #c8f5de;
  border-color: var(--success-color);
}

.feedback-banner.error, .admin-feedback.error {
  background-color: rgba(231, 76, 60, 0.15);
  color: #f5c8c8;
  border-color: var(--danger-color);
}

.admin-feedback.info {
  background-color: rgba(52, 152, 219, 0.15);
  border-color: #3498db;
  color: #d1e8f7;
}

.modal-admin {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-admin.active {
  display: flex;
  opacity: 1;
}

.modal-admin-content {
  background-color: #0d1226;
  padding: 30px 35px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 90%;
  max-width: 500px;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-admin.active .modal-admin-content {
  transform: scale(1);
}

.modal-admin .modal-close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2.5rem;
  font-weight: bold;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
}

.modal-admin .modal-close-btn:hover {
  color: white;
  transform: rotate(90deg);
}

#ban-modal-title {
  margin-bottom: 1.5rem;
  color: white;
}

#ban-form p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
}

#ban-form p strong {
  color: var(--primary-color);
  font-weight: 700;
}

#ban-form .form-group {
  margin-bottom: 1.5rem;
}

#ban-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--primary-color);
}

#ban-form select {
  width: 100%;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
}

#ban-form select:focus {
  outline: none;
  border-color: var(--primary-color);
}

#ban-form .unban-option {
  color: #2ecc71;
  font-weight: bold;
}

#ban-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-danger {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(231, 76, 60, 0.6);
}

/* ============================================= */
/* ANIMAZIONI GLOBALI                            */
/* ============================================= */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes show {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }
    100% {
        opacity: 1;
        z-index: 5;
    }
}

@keyframes slideUpFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutToLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: calc(var(--delay-index, 0) * 50ms);
}

/* ============================================= */
/* STILI PAGINA CREAZIONE STORIA (SPETTACOLARE)  */
/* ============================================= */
.story-creation-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.creation-header {
    position: absolute;
    top: 1rem;
    left: 2rem;
    width: auto;
    padding: 0;
    animation: none; /* Sovrascrive l'animazione di default */
}

.genre-slider-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1500px; /* Attiva la prospettiva 3D */
    position: relative;
    height: 80vh;
}

.genre-slider-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.genre-slider-title h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.genre-slider-title p {
    font-size: 1.2rem;
    color: #aeb9e1;
}

.genre-slider {
    position: relative;
    width: 350px; /* Larghezza della card principale */
    height: 500px; /* Altezza della card principale */
    transform-style: preserve-3d;
}

.genre-card-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-image: var(--bg-image);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.7s ease, filter 0.7s ease;
    will-change: transform, opacity;
    cursor: pointer;
}

.genre-card-slider::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-shadow: 0 2px 5px rgba(0,0,0,0.7);
}

.card-content i { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary-color); }
.card-content h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-content p { font-size: 1rem; line-height: 1.5; opacity: 0.8; }
.btn-select-genre {
    margin-top: 1.5rem;
    width: 100%;
    padding: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s; /* Aggiunto ritardo */
}

/* Posizionamento delle card nel carosello */
.genre-card-slider.active {
    transform: translateX(0) translateZ(0) rotateY(0);
    opacity: 1;
    z-index: 5;
    cursor: default;
}
.genre-card-slider.active .btn-select-genre {
    opacity: 1;
    transform: translateY(0);
}

.genre-card-slider.next {
    transform: translateX(60%) translateZ(-300px) rotateY(-45deg);
    opacity: 0.5;
    z-index: 1;
    filter: brightness(0.5);
}
.genre-card-slider.prev {
    transform: translateX(-60%) translateZ(-300px) rotateY(45deg);
    opacity: 0.5;
    z-index: 1;
    filter: brightness(0.5);
}

/* Stili default per le altre card (nascoste) */
.genre-card-slider:not(.active):not(.prev):not(.next) {
    transform: scale(0.8) translateX(0) rotateY(0);
    opacity: 0;
    z-index: 0;
}

/* Navigazione */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, rgba(0, 170, 255, 0.2), rgba(255, 0, 255, 0.2));
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 55px; /* Leggermente più grandi */
    height: 55px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}
.slider-nav:hover {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 25px rgba(0, 170, 255, 0.5);
}
.prev-btn { left: 15%; }
.next-btn { right: 15%; }

/* Modal per il Titolo */
.modal-story-title {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.modal-story-title.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.modal-story-title .modal-content {
    background: #0d1226;
    padding: 2.5rem 3rem;
    border-radius: 15px;
    border: 1px solid rgba(0,170,255,0.3);
    text-align: center;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-story-title.active .modal-content {
    transform: scale(1);
}

.modal-story-title .close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}
.modal-story-title .close-modal-btn:hover {
    color: white;
    transform: rotate(90deg);
}
.modal-story-title h2 { font-size: 2rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.modal-story-title p { color: #aeb9e1; margin-bottom: 2rem; }
.modal-story-title .form-group input { text-align: center; }
.modal-story-title button[type="submit"] { width: 100%; }

@media (max-width: 768px) {
    .slider-nav.prev-btn { left: 5%; }
    .slider-nav.next-btn { right: 5%; }
    .genre-card-slider.next { transform: translateX(45%) translateZ(-200px) rotateY(-35deg); }
    .genre-card-slider.prev { transform: translateX(-45%) translateZ(-200px) rotateY(35deg); }
    .genre-slider { width: 300px; height: 420px; }
    .genre-slider-title h1 { font-size: 2.5rem; }
}

/* ============================================= */
/* AGGIUNTE PER NUOVA INTERFACCIA BAN
/* ============================================= */

/* Griglia per le opzioni di ban */
.ban-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

/* Stile base di ogni opzione (etichetta) */
.ban-option {
    display: block;
    padding: 12px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Nasconde il vero input radio */
.ban-option input[type="radio"] {
    display: none;
}

/* Stile al passaggio del mouse */
.ban-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* Stile quando l'opzione è selezionata */
.ban-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 700;
}

.ban-option input[type="radio"]:checked {
    /* Applica lo stile direttamente alla label quando il radio è checkato */
    background-color: rgba(0, 170, 255, 0.15);
    border-color: var(--primary-color);
}

/* Stile specifico per l'opzione "Rimuovi Ban" */
.unban-option {
    border-color: rgba(46, 204, 113, 0.4);
}
.unban-option:hover {
    border-color: #2ecc71;
}
.unban-option input[type="radio"]:checked {
    background-color: rgba(46, 204, 113, 0.15);
    border-color: #2ecc71;
}
.unban-option input[type="radio"]:checked + span {
    color: #2ecc71;
}

/* Stile per il campo data/ora personalizzato */
.custom-date-input {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color-scheme: dark; /* Suggerisce al browser di usare un calendario scuro */
}
.custom-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================= */
/* AGGIUNTE PER PAGINA STORIE UTENTE
/* ============================================= */

/* Cella azioni nella tabella */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pulsante "Vedi Storie" */
.btn-view-stories {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.btn-view-stories:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* Griglia per le card delle storie */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Stile della singola card */
.story-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Titolo della storia */
.story-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0;
}

/* Metadati (genere, data) */
.story-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
.story-card-meta strong {
    color: white;
    font-weight: 600;
}
.story-card-meta .fas {
    margin-right: 8px;
    color: var(--primary-color);
}

/* Status della storia (badge) */
.story-card-status {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Spinge i badge in fondo alla card */
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.status-in_progress { background-color: rgba(243, 156, 18, 0.2); color: #f39c12; }
.status-badge.status-completed { background-color: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.status-badge.status-abandoned { background-color: rgba(127, 140, 141, 0.2); color: #7f8c8d; }
.status-badge.status-public { background-color: rgba(52, 152, 219, 0.2); color: #3498db; }
.status-badge.status-private { background-color: rgba(149, 165, 166, 0.2); color: #95a5a6; }

/* ============================================= */
/* AGGIUNTA PER PAGINA LOGIN ADMIN
/* ============================================= */

/* Stile per il link "Torna alla Home" */
.back-to-home-link {
    display: inline-block;
    margin-top: 25px; /* Aumenta lo spazio dal pulsante Accedi */
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-to-home-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 170, 255, 0.1);
}

/* ============================================= */
/* AGGIUNTE PER FILTRI E CONTATORE STORIE
/* ============================================= */

/* Contatore storie sotto il titolo della pagina */
.story-count {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* Contenitore per tutti i filtri */
.story-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 12px;
}

/* Gruppo singolo di filtro (icona + input/select) */
.filter-group {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 15px;
    flex-grow: 1;
}

.filter-group i {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 10px;
}

/* Stile per gli input e i select dei filtri */
.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    background-color: transparent;
    border: none;
    color: white;
    padding: 12px 0;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
}

.filter-group select option {
    background-color: #0d1226; /* Sfondo scuro per le opzioni */
    color: white;
}

/* Stili per la nuova sezione Featured Stories */
.featured-stories-section {
    padding: 80px 5%;
    text-align: center;
    background-color: rgba(10, 10, 20, 0.5); /* Sfondo semi-trasparente per coerenza */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

.featured-stories-section h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: #fff;
    font-weight: 700;
}

.featured-stories-section .section-subtitle {
    max-width: 600px;
    margin: 0 auto 50px auto;
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.6;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.story-card-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 400px;
}

.story-card-preview:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(9, 132, 227, 0.5);
}

.story-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-card-preview:hover .story-card-img {
    transform: scale(1.05);
}

.story-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 20%, rgba(0, 0, 0, 0) 60%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-sizing: border-box;
}

.story-card-content {
    text-align: left;
}

.story-card-title {
    font-size: 1.5rem;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.story-card-author {
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    color: #ddd;
}

.story-card-genre {
    background-color: #0984e3; /* Colore primario, o quello che preferisci */
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.hub-link-container {
    margin-top: 60px;
}

/* Aggiunta Stile per icona nel menu dropdown */
.profile-dropdown a i {
    margin-right: 12px;
    width: 20px; /* Assicura allineamento icone */
    text-align: center;
}

/* ============================================= */
/* AGGIUNTE PER AVATAR AUTORE IN HOMEPAGE        */
/* ============================================= */

.story-card-author-info {
    display: flex;
    align-items: center;
    gap: 8px; /* Spazio tra avatar e nome */
    margin: 0 0 10px 0;
}

.story-card-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #1a1f36;
}

.story-card-author {
    margin: 0 !important; /* Sovrascrive stili precedenti */
    font-size: 0.9rem;
    color: #ddd;
    line-height: 1;
}

/* ============================================= */
/* NUOVA ANIMAZIONE TITOLO 'PLOTWHIZ' (COSMIC APOCALYPSE) */
/* ============================================= */

.hero-section .hero-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900; /* Ancora più audace */
    font-size: clamp(3rem, 12vw, 10rem); /* Ancora più grande */
    text-align: center;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 2.5rem;
    perspective: 800px;
}

.hero-title span {
    display: inline-block;
    position: relative;
    cursor: default; /* Cursore normale, dato che l'interazione è rimossa */
    color: transparent;
    
    /* Il testo ha un gradiente di energia instabile */
    background: linear-gradient(125deg, #ff00ff, #00aaff, #ffffff, #ff00ff, #00aaff);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    
    /* Mix di animazioni con la nuova entrata fluida e senza glitch */
    animation: 
        /* 1. Apparizione fluida e accogliente */
        fluid-entrance 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        /* 2. Flusso di energia interna */
        cosmic-energy-flow 12s ease-in-out infinite alternate,
        /* 3. Leggero tremore magnetico */
        magnetic-wobble 6s ease-in-out infinite alternate;
    
    animation-delay: calc(0.08s * var(--i));
    
    transition: transform 0.2s cubic-bezier(0, 1.3, 0.8, 1);
}

/* PRIMO LIVELLO: Bagliore profondo e diffuso */
.hero-title span::before {
    content: attr(data-char);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    color: transparent;
    background: inherit; /* Eredita il gradiente del testo */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* Effetto 'Anima della Nebulosa' */
    filter: blur(20px) brightness(1.5);
    opacity: 0; /* Appare con l'animazione */
    
    animation:
        fluid-entrance 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        cosmic-energy-flow 12s ease-in-out infinite alternate;
    animation-delay: calc(0.08s * var(--i));
}

/* SECONDO LIVELLO: Particelle che si staccano */
.hero-title span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 5px white, 0 0 20px 10px var(--primary-color), 0 0 30px 15px var(--secondary-color);
    opacity: 0;
    /* Animazione per le particelle energetiche casuali */
    animation: particle-flare 5s ease-out infinite;
    animation-delay: calc(Math.random() * 5s);
}

/* --- INTERAZIONE AL PASSAGGIO DEL MOUSE RIMOSSA --- */


/* ============================================= */
/* KEYFRAMES PER L'APOCALISSE COSMICA            */
/* ============================================= */

/* NUOVA Animazione di entrata: le lettere appaiono fluidamente dal basso */
@keyframes fluid-entrance {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95) rotateX(-20deg);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0);
    }
}

/* Animazione per il flusso di energia nel testo */
@keyframes cosmic-energy-flow {
    from { background-position: 0% 50%; }
    to { background-position: 400% 50%; }
}

/* Animazione per il tremore magnetico delle lettere */
@keyframes magnetic-wobble {
    0%, 100% { transform: rotate(-0.5deg) translateX(-1px); }
    50% { transform: rotate(0.5deg) translateX(1px); }
}

/* Animazione per le particelle che si staccano dal testo */
@keyframes particle-flare {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    20% {
        opacity: 1;
        transform: scale(1) translate(calc(Math.random() * 60 - 30px), calc(Math.random() * 60 - 30px));
    }
    60% {
        opacity: 0;
        transform: scale(0.5) translate(calc(Math.random() * 120 - 60px), calc(Math.random() * 120 - 60px));
    }
}


/* Sottotitolo con animazione di fade-in ritardata e VELOCIZZATA */
.hero-section .hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInFromBottom 0.8s ease-out 0.7s forwards; /* Ritardo e durata ridotti per comparsa rapida */
}

@keyframes fadeInFromBottom {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





