/* ===== RESET E COMPORTAMENTI BASE ===== */
html {
    scroll-behavior: smooth; /* Scorrimento fluido */
}

body {
    background-color: rosybrown;
    font-family: Arial, sans-serif; 
    padding-top: 70px; /* Spazio per l'header fisso */
    margin: 0;
}

/* FIX PER HEADER FISSO */
section {
    scroll-margin-top: 70px; 
}

/* ===== CONTENITORI IMMAGINI E GALLERIE ===== */
.image-container {
    position: relative;
    text-align: center;
    width: 100%;
    height: auto;
}

.responsive-img {
    width: 50%;
    height: auto;
    display: inline-block;
    position: relative;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gallery img {
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ===== FORM REGISTRAZIONE E LOGIN ===== */
.container {
    width: 100%;
    max-width: 450px; 
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 12px;
    box-sizing: border-box;
}

.container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.container form {
    display: flex;
    flex-direction: column;
}

.container label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
    text-align: left;
}

.container form input, 
.container select {
    padding: 12px;
    margin-bottom: 15px; 
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

/* FIX ZOOM E BORDI ERRORE */
.input-error {
    border: 2px solid #e74c3c !important;
    background-color: #fdf2f2 !important;
}

.container form input:focus, 
.container select:focus {
    border-color: #4CAF50;
    outline: none;
}

.container form button {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; 
}

.container form button:hover {
    background-color: #45a049;
}

/* ===== TABELLE E BOTTONI GENERALI ===== */
.table-container { 
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
}

.table-container table {
    width: 80%;
    border-collapse: collapse;
    margin: 0 auto;
    background-color: #f9f9f9; 
}

button {
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    width: 180px;
    box-sizing: border-box;
}

button:active { transform: scale(0.95); }

/* Classi Colore Bottoni */
.blue { background-color: #3498db; }
.blue:hover { background-color: #2980b9; }
.red { background-color: #e74c3c; }
.red:hover { background-color: #c0392b; }
.yellow { background-color: #f1c40f; }
.yellow:hover { background-color: #f39c12; }
.green { background-color: #2ecc71; }
.green:hover { background-color: #27ae60; }
.black { background-color: #000000; }
.black:hover { background-color: #333333; }
.purple { background-color: #800080; }
.purple:hover { background-color: #4B0082; }
.grey { background-color: #A9A9A9; }
.grey:hover { background-color: #808080; }
.darkpink { background-color: #611A35; color: white; }
.darkpink:hover { background-color: #4E182C; }
.pink { background-color: #A31A58; color: white; }
.pink:hover { background-color: #841B48; }
.gray { background-color: #E7DDD8; color: #3E2723; }
.gray:hover { background-color: #D8CCC6; }
.nunzione { background-color: #7A3B5A; color: white; }
.nunzione:hover { background-color: #642F49; }

/* ===== ARCHIVIO MUSICALE ===== */
#lista-musica details {
    background-color: #f0f0f0;   
    margin: 10px 40px;            
    padding: 10px;                
    border-radius: 8px;          
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

#lista-musica details summary {
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
}

/* ===== UTRENSILI E CARD UTENTI ===== */
.user-card {
    display: flex;
    align-items: center;
    background: white;
    width: 100%;
    max-width: 450px;
    margin: 15px auto; 
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #3E2723;
    transition: transform 0.2s ease;
}

.user-card:hover { transform: scale(1.02); }

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #bc948c;
    margin-right: 20px;
}

.user-name { font-size: 1.2rem; font-weight: bold; }

.centerT_I {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* ===== EFFETTI SCROLL (TORNA SU) ===== */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 45px;
  font-size: 20px;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}

.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: scale(1.08); }

/* ===== LAYOUT HOME (EFFETTO APPLE & RESPONSIVE) ===== */

/* Versione Standard (Mobile first) */
.home-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.home-text { text-align: center; }

.home-img-container {
    width: 100%;
    text-align: center;
}

.home-img-container img {
    max-width: 100%;
    height: auto; 
}

/* Versione Desktop */
@media (min-width: 768px) {
    .home-layout {
        flex-direction: row;
        align-items: center; 
    }
    .home-text {
        flex: 1;
        text-align: left;
        padding-left: 30px;
    }
    .home-img-container { flex: 1; }
}

/* --- EFFETTO STICKY (LO SCAVALLAMENTO) --- */
.home-layout_01 {
    position: sticky;
    top: 100px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 60px 0;
    transition: opacity 0.5s, transform 0.5s;
}

.home-layout_01 img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
}

.next-section_01 {
    position: relative;
    z-index: 2;
    background: #ffffff;
    margin-top: 50px;
    padding: 80px 40px;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -20px 40px rgba(0,0,0,0.15);
    min-height: 600px;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #888;
    transition: transform 0.2s ease;
}

.like-btn:active {
    transform: scale(1.2); /* Effetto pulsazione al click */
}

.like-btn.is-liked {
    color: #e74c3c; /* Rosso Nunzionegram */
}

.like-count {
    font-size: 0.9rem;
    margin-left: 5px;
    color: #555;
}

/* NUOVO */
.username {
    display: flex;
    align-items: center; /* allineamento verticale perfetto */
    justify-content: center;
    gap: 5px;

    font-size: 12px;
    line-height: 1.3; /* IMPORTANTISSIMO per allineamento */
    padding: 2px 0;
    
    color: white;
    font-weight: bold;

    margin-top: 6px;
    max-width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.verified-icon .fa-circle {
    position: absolute;
    font-size: 13px;
    color: #1DA1F2;
}

.verified-icon .fa-check {
    position: relative; /* NON absolute */
    font-size: 7px;
    color: white;

    transform: translateY(0.5px); 
}