@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   APP-LIKE LAYOUT
   ============================================ */

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

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -0.01em;
    /* Sfondo bianco pulito. Prima era un gradient viola/rosa: su mobile non
       si vedeva (il .app-container 500px occupa tutto il viewport e copre)
       ma su iPad/desktop ai lati del container apparivano due grosse fasce
       viola che facevano sembrare l'app incompleta. Il viola resta nell'header
       (.header-app) — il branding è preservato; il resto è una pagina bianca
       pulita su cui si "scrive sopra" il contenuto. */
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    /* Layout principale: container al centro, footer legale eventuale SOTTO.
       Uso column + align-items:center così il container resta centrato in larghezza
       (max-width 500px su desktop) e il footer .moody-legal-footer si dispone sotto,
       a tutta larghezza del viewport. */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    display: flex;
    flex-direction: column;
    /* min-height invece di height per permettere al footer legale di stare SOTTO
       senza essere coperto e senza forzare scroll interni. */
    min-height: 100vh;
    max-width: 500px;
    width: 100%;
    background: white;
    position: relative;
}

/* Footer legale (Iubenda + Termini) — disposto sotto la app-container,
   a tutta larghezza del viewport, sempre visibile in fondo alla pagina. */
.moody-legal-footer {
    width: 100%;
    text-align: center;
    padding: 18px 16px 24px;
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.92);
    background: transparent;
    box-sizing: border-box;
}
.moody-legal-footer a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    opacity: 0.92;
}
.moody-legal-footer a:hover { opacity: 1; text-decoration: underline; }
.moody-legal-footer .moody-legal-sep { margin: 0 6px; opacity: 0.5; }
.moody-legal-footer .moody-legal-copy { opacity: 0.7; }

@media (max-width: 600px) {
    .moody-legal-footer { padding: 14px 12px 20px; font-size: 0.78em; }
}

/* HEADER */
.header-app {
    background: linear-gradient(135deg, #6B35C8 0%, #E91E8C 100%);
    color: white;
    /* Padding-top dinamico: 26px standard + safe area del dispositivo
       (notch iPhone, Dynamic Island, status bar Android su PWA, ecc).
       Su browser desktop env() vale 0, quindi il padding resta 26px.
       Su PWA standalone con notch/island, il padding si auto-allarga
       e il logo "Moody" resta sempre visibile, mai coperto. */
    padding: 26px 20px;
    padding-top: calc(26px + env(safe-area-inset-top, 0px));
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* "Parete bianca" sopra il viewport: riempie di bianco la zona della
   status bar / notch / Dynamic Island per coerenza visiva con il theme-color.
   Su browser desktop env() = 0, quindi questo elemento è alto 0px e
   invisibile. Su PWA mobile installata, è alto quanto la safe area del
   dispositivo (~20-59px) e crea una transizione netta tra status bar di
   sistema e header viola dell'app. */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: #ffffff;
    z-index: 9999;
    pointer-events: none;
}

.header-app h1 {
    font-size: 2.6em;
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header-content h1 {
    margin: 0;
    flex: 1;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 900;
    font-size: 2.4em;
    letter-spacing: 2px;
}

.header-content h1 img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    vertical-align: middle;
    margin-right: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}

/* MENU DROPDOWN - HEADER */
.header-menu {
    position: relative;
    margin-left: auto;
}

.btn-menu-dots {
    background: rgba(255, 255, 255, 0.3);
    color: white !important;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5em;
    z-index: 50;
}

.btn-menu-dots:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.menu-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    min-width: 280px;
    max-width: 90vw;
    display: none;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.menu-dropdown.active {
    display: flex;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
    font-size: 0.96em;
    background: none;
    border-style: solid;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8f8f8;
    color: #6B35C8;
    padding-left: 26px;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.2em;
    color: #333;
}

/* CONTENT */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.questionario-content {
    padding-bottom: 120px !important;
}

/* BOTTOM NAVBAR */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: 70px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    gap: 5px;
}

.nav-item i {
    font-size: 1.5em;
}

.nav-item span {
    font-size: 0.75em;
    font-weight: 600;
}

.nav-item:hover {
    color: #6B35C8;
    background: #f5f5f5;
}

.nav-item.active {
    color: #6B35C8;
}

.nav-item.active i {
    font-size: 1.8em;
}

/* HOME PAGE STYLES */
.cta-section {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.btn-comincia {
    background: #6B35C8;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 53, 200, 0.4);
}

.btn-comincia:hover {
    background: #5568d3;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(107, 53, 200, 0.6);
}

.btn-comincia:active {
    transform: scale(0.98);
}

/* ===== TESTO ELEGANTE SOTTO PULSANTE ===== */
.mood-tagline {
    text-align: center;
    font-family: 'Georgia', 'Garamond', serif;
    font-size: 1.1em;
    color: #333;
    font-weight: 300;
    letter-spacing: 1px;
    margin-top: 25px;
    margin-bottom: 40px;
    font-style: italic;
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.empty-state p {
    color: #666;
    font-size: 1em;
    margin-bottom: 10px;
    line-height: 1.5;
}

.empty-state .btn-comincia {
    margin-top: 30px;
}

.consigliati-section {
    margin-top: 40px;
}

.consigliati-section h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

/* MOVIES GRID */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.movie-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1;
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 2;
}

.movie-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    border-radius: 10px;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== MENU A TRE PUNTINI NEI FILM (CERCHIO GRIGIO + PUNTINI BIANCHI) ===== */
.menu-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(100, 100, 100, 0.7);
    border: none;
    font-size: 20px;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 20;
}

.menu-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    transform: scale(1.1);
}

.menu-btn:active {
    transform: scale(0.95);
}

.movie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    text-align: center;
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.movie-overlay p {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.2;
}

.movie-overlay .voto {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.match-type {
    font-size: 0.75em;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    margin: 5px 0;
}

/* OVERLAY BUTTONS */
.overlay-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* WISHLIST BUTTON SMALL (per home) */
.btn-wishlist-small {
    background: #FFD700;
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
    margin-top: 10px;
}

.btn-wishlist-small:hover {
    background: #FFC700;
    transform: scale(1.15);
}

.btn-wishlist-small:active {
    transform: scale(0.95);
}

/* RESULT CARDS */
.result-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.btn-wishlist {
    background: #FFD700;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.btn-wishlist:hover {
    background: #FFC700;
    transform: scale(1.05);
}

/* SEARCH PAGE STYLES */
.search-container {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 10px 15px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.search-box:focus-within {
    border-color: #6B35C8;
    background: white;
    box-shadow: 0 2px 10px rgba(107, 53, 200, 0.2);
}

.search-box i {
    color: #999;
    font-size: 1.2em;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1em;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.btn-search {
    background: #6B35C8;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-search:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.search-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-btn {
    background: white;
    border: 2px solid #ddd;
    color: #666;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.9em;
}

.filter-btn:hover {
    border-color: #6B35C8;
    color: #6B35C8;
}

.filter-btn.active {
    background: #6B35C8;
    color: white;
    border-color: #6B35C8;
}

.search-results {
    min-height: 200px;
}

/* SEARCH RESULTS LIST */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.search-result-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-poster {
    width: 80px;
    min-width: 80px;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
}

.search-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-info h3 {
    color: #333;
    font-size: 1em;
    margin-bottom: 5px;
}

.search-result-info p {
    color: #666;
    font-size: 0.85em;
    margin: 3px 0;
    line-height: 1.3;
}

.search-result-info .match-type {
    background: #6B35C8;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.75em;
}

/* FILM ACTIONS */
.film-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.film-actions-big {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-action {
    background: white;
    color: #333;
    border: 2px solid #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-action:hover {
    border-color: #6B35C8;
    color: #6B35C8;
}

.btn-action.btn-wishlist:hover {
    border-color: #FFD700;
    color: #FFD700;
}

.btn-action.btn-piaciuto:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-action.btn-visto:hover {
    border-color: #6B35C8;
    color: #6B35C8;
}

.btn-action-big {
    background: white;
    color: #333;
    border: 2px solid #ddd;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action-big:hover {
    border-color: #6B35C8;
    color: #6B35C8;
}

.btn-action-big.btn-wishlist:hover {
    border-color: #FFD700;
    color: #FFD700;
}

.btn-action-big.btn-piaciuto:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-action-big.btn-visto:hover {
    border-color: #6B35C8;
    color: #6B35C8;
}

/* WISHLIST PAGE */
.wishlist-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.wishlist-item {
    background: #f9f9f9;
    border-left: 4px solid #6B35C8;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-item .item-info h3 {
    color: #333;
    font-size: 1em;
    margin: 0;
}

.btn-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-remove:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* PROFILO PAGE */
.profilo-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.profilo-card {
    background: linear-gradient(135deg, #6B35C8 0%, #E91E8C 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(107, 53, 200, 0.3);
}

.profilo-avatar {
    font-size: 3em;
    margin-bottom: 15px;
}

.profilo-card h2 {
    font-size: 1.5em;
    margin: 10px 0;
}

.profilo-card p {
    opacity: 0.9;
}

.profilo-stats {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profilo-stats h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    color: #666;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: #6B35C8;
    font-size: 1.2em;
}

.profilo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* CATEGORIE LIST - CON PRIORITÀ */
.categorie-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.categorie-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* CATEGORIA PRINCIPALE (WISHLIST) */
.categoria-item-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #333;
    padding: 30px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 2px solid #FFB700;
    cursor: pointer;
}

.categoria-item-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
}

.categoria-item-primary h3 {
    font-size: 1.4em;
    font-weight: 700;
}

.categoria-item-primary .categoria-count {
    font-size: 1.05em;
    margin-left: 32px;
}

/* CATEGORIE SECONDARIE (PIACIUTI E VISTI) */
.categoria-item-secondary {
    background: linear-gradient(135deg, #6B35C8 0%, #E91E8C 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 53, 200, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.categoria-item-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(107, 53, 200, 0.5);
}

.categoria-item-secondary h3 {
    font-size: 1.1em;
    font-weight: 600;
}

.categoria-item-secondary .categoria-count {
    font-size: 0.9em;
    margin-left: 32px;
}

/* STILI COMUNI */
.categoria-item h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.categoria-icon {
    font-size: 1.5em;
    display: inline-block;
}

.categoria-count {
    margin: 0;
    opacity: 0.9;
}

/* QUESTIONARIO STYLES */
.question-group {
    margin-bottom: 25px;
}

.question-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 1em;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.multiple-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.option-btn {
    padding: 12px 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
}

.option-btn:hover {
    border-color: #6B35C8;
    background: #f5f5f5;
}

.option-btn.selected {
    background: #6B35C8;
    color: white;
    border-color: #6B35C8;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #6B35C8;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background: #bbb;
}

/* PROGRESS BAR */
.progress-bar {
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #6B35C8;
    transition: width 0.3s ease;
}

/* RESULTS GRID - QUESTIONARIO */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.result-card-big {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.result-card-big:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.result-card-content {
    display: flex;
    gap: 15px;
    padding: 15px;
    position: relative;
}

.result-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6B35C8;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2em;
}

.result-card-content .movie-poster {
    width: 100px;
    min-width: 100px;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
}

.result-info-big {
    flex: 1;
}

.result-info-big h3 {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.result-info-big p {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
    line-height: 1.4;
}

.btn-add-wishlist {
    background: #FFD700;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.btn-add-wishlist:hover {
    background: #FFC700;
    transform: scale(1.05);
}

.btn-add-wishlist:active {
    transform: scale(0.95);
}

/* ===== MODALI GRANDI (VALUTAZIONI E RECENSIONI) ===== */
.modal-overlay-large {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2500;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay-large.active {
    display: flex;
}

.modal-content-large {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #333;
    flex: 1;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-close:hover {
    color: #333;
    transform: scale(1.2);
}

.modal-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===== STILE ITEMS CON TRE PUNTINI SIMMETRICI ===== */
.modal-list-item {
    background: white;
    border: 1px solid #eee;
    border-left: 4px solid #6B35C8;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    overflow: hidden;
}

.modal-list-item-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-list-item h4 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
}

.modal-list-item p {
    color: #666;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ===== BOTTONE TRE PUNTINI SIMMETRICO ===== */
.modal-list-item-menu {
    width: 50px;
    height: auto;
    min-height: 60px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    transition: all 0.2s ease;
    flex-shrink: 0;
    border-left: 1px solid #eee;
}

.modal-list-item-menu:hover {
    background: #f8f8f8;
    color: #6B35C8;
}

.modal-list-item-menu:active {
    transform: scale(0.95);
}

.no-items {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 1em;
}

/* UTILITY CLASSES */
.no-data {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 1.1em;
}

.placeholder-text {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 1em;
}

.loading {
    text-align: center;
    color: #6B35C8;
    padding: 30px;
    font-size: 1em;
}

.error {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c00;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════════
   TABLET / DESKTOP — container e card che riempiono lo spazio
   ═══════════════════════════════════════════════════════════════════
   Su mobile (<768px) tutto resta com'era: container fino a 500px e card
   da 130px. Su tablet/desktop, però, allargare solo il container lasciava
   le card piccole tutte ammassate a sinistra con un mare di bianco vuoto
   a destra (visivamente assurdo). Per riempire lo spazio in modo sensato
   il container si allarga MODERATAMENTE e contemporaneamente le card
   diventano più grandi:
   - 768px+  : container 700px, card 180px → ~3 card visibili belle grandi
   - 1024px+ : container 800px, card 200px → ~3.5 card visibili
   - 1280px+ : container 900px, card 220px → equilibrato anche su desktop
   In tutti i casi le card hanno aspect-ratio 2/3 (locandina film standard),
   quindi sull'iPad ognuna è ~270px di altezza, ben leggibile. */
@media (min-width: 768px) {
    .app-container {
        max-width: 700px;
    }
    .carousel-track > .movie-card {
        flex: 0 0 180px;
    }
}
@media (min-width: 1024px) {
    .app-container {
        max-width: 800px;
    }
    .carousel-track > .movie-card {
        flex: 0 0 200px;
    }
}
@media (min-width: 1280px) {
    .app-container {
        max-width: 900px;
    }
    .carousel-track > .movie-card {
        flex: 0 0 220px;
    }
}

/* ===== ANIMAZIONI ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
    .app-container {
        max-width: 100%;
    }

    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .option-btn {
        font-size: 0.9em;
        padding: 10px 12px;
    }

    .movie-overlay p {
        font-size: 0.8em;
    }

    .result-card-content {
        flex-direction: column;
    }

    .result-card-content .movie-poster {
        width: 100%;
        max-height: 200px;
    }

    .search-result-item {
        flex-direction: column;
    }

    .search-result-poster {
        width: 100%;
        max-height: 150px;
    }

    .categorie-secondary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .header-app h1 {
        font-size: 1.5em;
    }

    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .btn-comincia {
        padding: 12px 30px;
        font-size: 1em;
    }

    .categoria-item-primary {
        padding: 20px;
    }

    .categoria-item-primary h3 {
        font-size: 1.2em;
    }
}

/* ═════════════════════════════════════════════════════════════
   SKELETON LOADER (progressive loading)
   Usato da: piaciuti, visti, wishlist, valutazioni, recensioni, home
   ═════════════════════════════════════════════════════════════ */

@keyframes mShimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}

/* Variante "card poster" per movie-grid (piaciuti, visti, wishlist) */
.skeleton-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 10px;
    background: linear-gradient(90deg, #e9e1f4 0%, #f4eefb 50%, #e9e1f4 100%);
    background-size: 800px 100%;
    animation: mShimmer 1.4s infinite linear;
}

/* Variante "lista orizzontale" per recensioni/valutazioni */
.skeleton-list-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.skeleton-poster-sm {
    flex: 0 0 80px;
    width: 80px;
    height: 120px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e9e1f4 0%, #f4eefb 50%, #e9e1f4 100%);
    background-size: 800px 100%;
    animation: mShimmer 1.4s infinite linear;
}

.skeleton-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #ececec 0%, #f6f6f6 50%, #ececec 100%);
    background-size: 800px 100%;
    animation: mShimmer 1.4s infinite linear;
}

.skeleton-line.sk-short  { width: 40%; }
.skeleton-line.sk-medium { width: 70%; }
.skeleton-line.sk-long   { width: 90%; }