body {
    margin:0;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #0a0f1f, #05060a);
    color:white;
    overflow-x:hidden;
}

/* GLASS ULTRA */
.glass {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* NAVBAR */
.navbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 25px;
    position:sticky;
    top:0;
    z-index:100;
}

.logo {
    font-size:22px;
    font-weight:700;
    letter-spacing:1px;
}

/* SEARCH */
.search input {
    padding:10px 14px;
    border-radius:14px;
    border:none;
    background: rgba(255,255,255,0.08);
    color:white;
}

/* GRID */
.grid {
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap:18px;
    padding:25px;
}

/* CARD 3D APPLE STYLE */
.card {
    position:relative;
    overflow:hidden;
    border-radius:20px;
    transition:0.35s;
    transform: perspective(800px) rotateX(0deg);
}

.card:hover {
    transform: perspective(800px) rotateX(6deg) scale(1.06);
}

.card img {
    width:100%;
    height:260px;
    object-fit:cover;
    transition:0.3s;
}

.card:hover img {
    transform: scale(1.08);
}

.title {
    position:absolute;
    bottom:0;
    width:100%;
    padding:10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    font-size:14px;
}

/* CATEGORY BADGE */
.category {
    position:absolute;
    top:10px;
    left:10px;
    background: rgba(255,255,255,0.15);
    padding:5px 10px;
    border-radius:12px;
    font-size:11px;
    backdrop-filter: blur(10px);
}
.card {
    transform: translateY(0);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
}

.card .title {
    font-size:13px;
}

a {
    transition:0.2s;
}

a:hover {
    opacity:0.8;
}
.actions {
    display:flex;
    gap:10px;
    padding:10px;
    margin-top:auto;
}

.btn {
    flex:1;
    text-align:center;
    padding:8px;
    border-radius:12px;
    text-decoration:none;
    font-size:13px;
    backdrop-filter: blur(10px);
    transition:0.2s;
}

.btn:hover {
    transform: scale(1.05);
}

.edit {
    background: rgba(45,108,223,0.8);
    color:white;
}

.delete {
    background: rgba(255,60,60,0.85);
    color:white;
}
a {
    color: inherit;
    text-decoration: none;
}

a:visited {
    color: inherit;
}

/* TITOLI SEMPRE LEGGIBILI */
.title {
    color: white;
}
.card .title {
    color: rgba(255,255,255,0.92);
    font-weight: 500;
}
.grid {
    padding-top:30px;
}

/* effetto “soft glow” sulle card */
.card {
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* miglior leggibilità titoli */
.card .title {
    padding:10px;
    font-size:14px;
    color:white;
}
.card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px; /* 👈 evita sovrapposizioni */
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    line-height: 1.2;
    word-break: break-word;
}

.card-category {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
}
.card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    will-change: transform;
}

/* 🚀 HOVER LIFT + GLOW */
.card:hover {
    transform: translateY(-10px) scale(1.04);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.6),
        0 0 25px rgba(120,120,255,0.25);
    filter: saturate(1.1);
}
.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(12px);
}

/* colori per genere */
.cat-Sci-Fi { background: rgba(0, 140, 255, 0.6); }
.cat-Drama  { background: rgba(255, 80, 120, 0.6); }
.cat-Action { background: rgba(255, 170, 0, 0.6); }
.cat-Horror { background: rgba(150, 0, 0, 0.6); }
.cat-Altro  { background: rgba(255,255,255,0.15); }
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeUp 0.4s ease both;
}
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 18px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
/* BACKGROUND LOGIN */
.login-body {
    margin:0;
    height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background: radial-gradient(circle at top, #0b1020, #05060a);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* BOX GLASS */
.login-box {
    width:320px;
    padding:30px;
    border-radius:20px;
    text-align:center;
    backdrop-filter: blur(25px);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: pop 0.5s ease;
}

/* ANIMAZIONE ENTRATA */
@keyframes pop {
    from {
        opacity:0;
        transform: scale(0.9);
    }
    to {
        opacity:1;
        transform: scale(1);
    }
}

/* INPUT MODERNI */
.input {
    width:100%;
    padding:12px;
    margin:8px 0;
    border:none;
    border-radius:12px;
    background: rgba(255,255,255,0.08);
    color:white;
    outline:none;
}

/* BUTTON */
.btn-login {
    width:100%;
    padding:12px;
    margin-top:10px;
    border:none;
    border-radius:12px;
    background: linear-gradient(135deg, #4a6cf7, #6a5cff);
    color:white;
    font-weight:bold;
    cursor:pointer;
    transition:0.2s;
}

.btn-login:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(80,100,255,0.4);
}
.login-box h2 {
    margin-bottom:5px;
    color:white;
}

.login-box p {
    font-size:12px;
    opacity:0.7;
    margin-bottom:20px;
}
.shake {
    animation: shake 0.4s ease;
    border: 1px solid rgba(255,0,0,0.5);
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}
/* evitare overflow su mobile */
* {
    box-sizing: border-box;
}

/* GRID RESPONSIVE */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
    padding: 20px;
}

/* TABLET */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* MOBILE */
@media (max-width: 600px) {

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

    .navbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .logo {
        font-size: 18px;
    }

    .card img {
        height: 180px;
    }

    .card {
        border-radius: 14px;
    }
}
@media (max-width: 600px) {

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .card {
        padding-bottom: 10px;
    }

    .card img {
        height: 160px;
    }
}
@media (max-width: 600px) {

    body {
        padding-bottom: 60px;
    }

    /* effetto app streaming */
    .card:hover {
        transform: none;
    }
}
.bottom-nav {
    display: none;
}

/* SOLO MOBILE */
@media (max-width: 600px) {

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(20,20,20,0.7);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.1);
        justify-content: space-around;
        align-items: center;
        z-index: 999;
    }

    .nav-item {
        color: white;
        font-size: 22px;
        text-decoration: none;
        transition: 0.2s;
    }

    .nav-item:active {
        transform: scale(0.85);
    }

    /* spazio per non coprire contenuto */
    body {
        padding-bottom: 70px;
    }
}
.search-box {
    display: block;
}

/* MOBILE */
@media (max-width: 600px) {

    .search-box {
        display: none;
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        z-index: 999;
        padding: 10px;
        background: rgba(20,20,20,0.8);
        backdrop-filter: blur(20px);
        border-radius: 12px;
    }

    .search-box.active {
        display: block;
        animation: fadeIn 0.25s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
.nav-item {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    font-size: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: 0.2s;
}

.nav-item:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: white;
    outline: none;
}

/* bottone nascosto su desktop */
.search-btn {
    display: none;
}

/* 📱 MOBILE */
@media (max-width: 600px) {

    .search-btn {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;

        border: none;
        border-radius: 12px;

        background: rgba(255,255,255,0.1);
        color: white;

        cursor: pointer;
        backdrop-filter: blur(10px);
    }

    .search-btn:active {
        transform: scale(0.9);
    }
}
#splash {
    position: fixed;
    inset: 0;
    background: #0b0f1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeOut 0.6s ease 1.2s forwards;
}

.splash-logo {
    font-size: 22px;
    color: white;
    font-weight: bold;
    animation: zoomIn 0.8s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}