/* ============================================
   FILE: style.css - VERSIONE COMPLETA CON ADMIN
   ============================================ */

:root {
    --primary-color: #e50914;
    --primary-hover: #b20710;
    --dark-bg: #141414;
    --dark-card: #1f1f1f;
    --dark-card-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-gold: #ffd700;
}

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

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* ========== NAVBAR ========== */
.navbar {
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.navbar-dark .nav-link {
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
}

.navbar-dark .nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* ========== BUTTONS ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff1744);
    border: none;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #d50000);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #00c853, #00e676);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    border: none;
}

/* ========== CARDS ========== */
.card {
    background-color: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    background-color: var(--dark-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ========== MOVIE CARDS ========== */
.movie-card {
    background-color: var(--dark-card);
    border: none;
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(255, 23, 68, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

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

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(229, 9, 20, 0.3),
                0 0 20px rgba(229, 9, 20, 0.2);
}

/* Wrapper per il poster */
.movie-poster-wrapper {
    position: relative;
    width: 100%;
    padding-top: 142.5%;
    overflow: hidden;
    background-color: #000;
}

.movie-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.4s ease;
}

.movie-card:hover .movie-poster {
    transform: scale(1.05);
}

/* Rating badge */
.movie-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.movie-card .card-body {
    background: linear-gradient(to top, var(--dark-card), transparent);
    position: relative;
    z-index: 2;
    flex-grow: 1;
}

.movie-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card .card-text {
    font-size: 0.75rem;
}

.movie-card .btn-sm {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
}

/* ========== MEDIA TYPE BADGE (Film/Serie) ========== */
.media-type-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
}

.media-type-badge .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== BACKDROP HEADER ========== */
.movie-backdrop {
    position: relative;
    height: 600px;
    background-size: cover;
    background-position: center top;
    margin-top: -76px;
    background-attachment: fixed;
}

.backdrop-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        rgba(20, 20, 20, 0.3) 0%,
        rgba(20, 20, 20, 0.7) 50%,
        rgba(20, 20, 20, 1) 100%);
}

/* ========== MOVIE DETAILS ========== */
.movie-details-container {
    position: relative;
    margin-top: -350px;
    z-index: 10;
}

.poster-image {
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.poster-image:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 70px rgba(229, 9, 20, 0.4);
}

.badge-info {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

/* ========== SEARCH RESULTS ========== */
.search-result-card {
    background-color: var(--dark-card);
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(229, 9, 20, 0.3);
}

.search-result-card img {
    height: 380px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-card:hover img {
    transform: scale(1.1);
}

/* ========== CAST & CREW CARDS ========== */
.cast-card {
    background-color: var(--dark-card);
    border-radius: 3px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cast-card:hover {
    background-color: var(--dark-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.2);
}

.cast-card img {
    border-radius: 3px;
    margin-bottom: 0.8rem;
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.cast-card h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.cast-card small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========== GALLERY ========== */
.gallery-image {
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-image::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image:hover::after {
    opacity: 1;
}

.gallery-image:hover {
    transform: scale(0.98);
    box-shadow: 0 10px 40px rgba(229, 9, 20, 0.3);
}

.gallery-image img {
    width: 100%;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.gallery-image:hover img {
    filter: brightness(0.7);
}

/* ========== BADGES ========== */
.badge {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--accent-gold), #ffeb3b) !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff1744) !important;
    border: none;
}

/* ========== FORMS ========== */
.form-control {
    background-color: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: var(--dark-card-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(229, 9, 20, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* ========== SEARCH FORM ========== */
.search-form .input-group {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.search-form .form-control {
    background-color: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
}

.search-form .form-control:focus {
    background-color: var(--dark-card-hover);
    border-color: var(--primary-color);
    box-shadow: none;
}

.search-form .btn-primary {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.search-form .btn-outline-secondary {
    background-color: var(--dark-card);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.search-form .btn-outline-secondary:hover {
    background-color: var(--dark-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ========== PAGINATION ========== */
.pagination {
    gap: 0.3rem;
}

.pagination .page-link {
    background-color: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 0.9rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: var(--dark-card-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), #ff1744);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.pagination .page-item.disabled .page-link {
    background-color: var(--dark-card);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

/* ========== ALERTS ========== */
.alert {
    border-radius: 3px;
    border: none;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.2), rgba(244, 67, 54, 0.2));
    color: #ff5252;
    border-left: 4px solid #d32f2f;
}

.alert-success {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.2), rgba(0, 230, 118, 0.2));
    color: #69f0ae;
    border-left: 4px solid #00c853;
}

.alert-info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(3, 169, 244, 0.2));
    color: #40c4ff;
    border-left: 4px solid #2196f3;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), #ff1744);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-hover), #d50000);
}

/* ========== SCROLL TO TOP BUTTON ========== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #ff1744);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, var(--primary-hover), #d50000);
    transform: translateY(0) scale(1.1);
    box-shadow: 0 6px 30px rgba(229, 9, 20, 0.6);
}

.scroll-to-top:active {
    transform: translateY(0) scale(0.95);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
    }
}

/* ========== LOADING SPINNER ========== */
.spinner-border {
    border-color: var(--primary-color);
    border-right-color: transparent;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast {
    min-width: 350px;
    font-size: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 3px;
}

.toast-body {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    font-weight: 500;
}

@media (max-width: 576px) {
    .toast {
        min-width: 280px;
        font-size: 0.9rem;
    }
    
    .toast-body {
        padding: 0.8rem 1rem;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .col-xl-2 {
        flex: 0 0 auto;
        width: 25%;
    }
}

@media (max-width: 992px) {
    .col-lg-3 {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

@media (max-width: 768px) {
    .movie-backdrop {
        height: 400px;
        background-attachment: scroll;
    }
    
    .movie-details-container {
        margin-top: -200px;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .cast-card img {
        height: 150px;
    }
    
    .col-md-4 {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (max-width: 576px) {
    .col-sm-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .movie-card {
    animation: fadeIn 0.5s ease forwards;
}

/* ========== HOVER EFFECTS ========== */
.text-hover-primary {
    transition: color 0.3s ease;
}

.text-hover-primary:hover {
    color: var(--primary-color) !important;
}

/* ========== VIDEO SECTION ========== */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== STATS BADGES ========== */
.stat-badge {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2), rgba(255, 23, 68, 0.2));
    border: 1px solid rgba(229, 9, 20, 0.3);
    padding: 1.5rem;
    border-radius: 3px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-badge h3 {
    color: var(--accent-gold);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-badge p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Fix per i titoli su sfondo scuro */
.card-title, h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

.text-muted {
    color: #b3b3b3 !important;
}

.table-dark {
    color: #ffffff !important;
}

.table-dark td, .table-dark th {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ========== ADMIN STATS CARDS ========== */
.admin-stat-card {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(255, 23, 68, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    min-height: 120px;
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(229, 9, 20, 0.3);
    border-color: rgba(229, 9, 20, 0.5);
}

.admin-stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.admin-stat-card .stat-icon.bg-primary {
    background: linear-gradient(135deg, #2196f3, #03a9f4);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.3);
}

.admin-stat-card .stat-icon.bg-danger {
    background: linear-gradient(135deg, #e50914, #ff1744);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.3);
}

.admin-stat-card .stat-icon.bg-warning {
    background: linear-gradient(135deg, #ffd700, #ffeb3b);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.admin-stat-card .stat-icon.bg-success {
    background: linear-gradient(135deg, #00c853, #00e676);
    box-shadow: 0 8px 20px rgba(0, 200, 83, 0.3);
}

.admin-stat-card .stat-info {
    width: 100%;
}

.admin-stat-card .stat-info h3 {
    color: #fff !important;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.admin-stat-card .stat-info p {
    color: #b3b3b3;
    font-size: 0.75rem;
    margin: 0;
    font-weight: 500;
    margin-top: 0.3rem;
    line-height: 1.2;
}

/* Desktop: Layout orizzontale */
@media (min-width: 992px) {
    .admin-stat-card {
        flex-direction: row;
        text-align: left;
        gap: 1.2rem;
        padding: 1.5rem;
    }
    
    .admin-stat-card .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .admin-stat-card .stat-info h3 {
        font-size: 2.2rem;
    }
    
    .admin-stat-card .stat-info p {
        font-size: 0.85rem;
    }
}

/* ========== NO IMAGE PLACEHOLDER ========== */
.no-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.no-image-placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.5rem;
}

.no-image-placeholder span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.cast-card .no-image-placeholder {
    transition: all 0.3s ease;
}

.cast-card:hover .no-image-placeholder {
    background: linear-gradient(135deg, #3a3a3a, #2f2f2f);
    border-color: rgba(229, 9, 20, 0.4);
}

.cast-card:hover .no-image-placeholder i {
    color: rgba(229, 9, 20, 0.6);
}

.crew-no-image {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crew-no-image i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ========== ADMIN AREA - SEARCH RESULTS ========== */
.search-result-item {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background: #2a2a2a;
    border-color: #e50914;
}

.search-result-item.selected {
    background: rgba(0, 200, 83, 0.2);
    border-color: #00c853;
}

.search-result-poster {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h6 {
    color: #fff !important;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-check {
    flex-shrink: 0;
}

.selection-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========== ADMIN AREA - BULK ACTIONS ========== */
.bulk-actions {
    position: sticky;
    top: 70px;
    z-index: 100;
    background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
    border: 2px solid #00c853;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 200, 83, 0.3);
}

.bulk-actions.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* ========== ADMIN AREA - SAVED MOVIES ========== */
.saved-movie-item {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.saved-movie-item:hover {
    background: #2a2a2a;
    border-color: rgba(229, 9, 20, 0.5);
}

.saved-movie-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.saved-movie-info {
    flex: 1;
    min-width: 0;
}

.saved-movie-info h6 {
    color: #fff !important;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-movie-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ========== ADMIN AREA - PROGRESS MODAL ========== */
#progressModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
    border: 3px solid #00c853;
    border-radius: 15px;
    padding: 2rem;
    z-index: 10000;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#progressOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
}

#progressModal h4 {
    font-size: 1.2rem;
}

#progressModal p {
    font-size: 0.95rem;
}

/* ========== TAB NAVIGATION ========== */
.nav-tabs .nav-link {
    color: #b3b3b3;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #fff;
    background: rgba(229, 9, 20, 0.1);
}

.nav-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2), rgba(255, 23, 68, 0.2));
    border-bottom: 3px solid #e50914;
}

/* ========== RESPONSIVE ADMIN ========== */
@media (max-width: 768px) {
    .search-result-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }
    
    .search-result-poster {
        width: 50px;
        height: 75px;
    }
    
    .search-result-info h6 {
        font-size: 0.85rem;
    }
    
    .search-result-info .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .search-result-check {
        font-size: 1.5rem !important;
    }
    
    .bulk-actions {
        top: 60px;
        padding: 0.8rem;
    }
    
    .bulk-actions h5 {
        font-size: 1rem;
    }
    
    .saved-movie-item {
        padding: 0.6rem;
    }
    
    .saved-movie-poster {
        width: 40px;
        height: 60px;
    }
    
    .saved-movie-info h6 {
        font-size: 0.8rem;
    }
    
    .saved-movie-actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .saved-movie-actions .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    #progressModal {
        padding: 1.5rem;
    }
    
    #progressModal h4 {
        font-size: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

/* ========== USER MOVIES LIST (Admin Area - Attività Utenti) ========== */
.user-movie-list-item {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.user-movie-list-item:hover {
    background: #2a2a2a;
    border-color: rgba(229, 9, 20, 0.5);
    transform: translateX(5px);
}

.user-movie-list-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.user-movie-list-info {
    flex: 1;
    min-width: 0;
}

.user-movie-list-info h6 {
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-movie-list-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-movie-list-meta .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

.user-movie-list-meta span {
    font-size: 0.8rem;
}

.user-movie-list-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Tablet */
@media (max-width: 991px) {
    .user-movie-list-item {
        padding: 0.6rem;
        gap: 0.7rem;
    }
    
    .user-movie-list-poster {
        width: 45px;
        height: 67px;
    }
    
    .user-movie-list-info h6 {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .user-movie-list-meta {
        gap: 0.4rem;
    }
    
    .user-movie-list-meta .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .user-movie-list-meta span {
        font-size: 0.75rem;
    }
    
    /* Pulsante più piccolo su tablet */
    .user-movie-list-actions .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.55rem;
    }
    
    .user-movie-list-actions .btn i {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .user-movie-list-item {
        padding: 0.5rem;
        gap: 0.6rem;
    }
    
    .user-movie-list-poster {
        width: 40px;
        height: 60px;
    }
    
    .user-movie-list-info h6 {
        font-size: 0.8rem;
    }
    
    .user-movie-list-meta {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .user-movie-list-meta .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .user-movie-list-meta span {
        font-size: 0.7rem;
    }
    
    /* Nascondi data aggiunta su mobile */
    .user-movie-list-meta span:nth-child(4) {
        display: none;
    }
    
    /* Pulsante ancora più piccolo e allineato a destra */
    .user-movie-list-actions {
        align-self: center;
    }
    
    .user-movie-list-actions .btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.45rem;
    }
    
    .user-movie-list-actions .btn i {
        font-size: 0.75rem;
    }
}

/* Mobile piccolo */
@media (max-width: 576px) {
    .user-movie-list-item {
        padding: 0.45rem;
        gap: 0.5rem;
    }
    
    .user-movie-list-poster {
        width: 35px;
        height: 52px;
    }
    
    .user-movie-list-info h6 {
        font-size: 0.75rem;
    }
    
    /* Nascondi anche l'anno su schermi molto piccoli */
    .user-movie-list-meta span:nth-child(3) {
        display: none;
    }
    
    /* Pulsante minimo */
    .user-movie-list-actions .btn {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .user-movie-list-actions .btn i {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .search-result-item {
        flex-wrap: nowrap;
    }
    
    .selection-checkbox {
        width: 18px;
        height: 18px;
    }
}

/* ========== LIGHTBOX ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(229, 9, 20, 0.5);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    background: rgba(229, 9, 20, 0.8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

/* ========== FIX ALTEZZA POSTER ALTERNATIVI ========== */
.card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
    height: 292px;
    width: 100%;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 768px) {
    .card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
        height: 219px;
    }
}

@media (max-width: 576px) {
    .card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
        height: 183px;
    }
}

/* ========== BANNER PUBBLICITARIO ========== */
.promo-banner-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9998;
    padding: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-banner-container.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.promo-banner {
    margin: 0;
    border-radius: 16px;
    border: none;
    border: 3px solid rgba(255, 255, 255, 0.6);
    padding: 2rem;
    position: relative;
    animation: bannerPulse 2s ease-in-out infinite;
    background-color: rgba(0, 0, 0, 0.92); /* meno trasparenza */
    backdrop-filter: blur(6px); /* effetto vetro (opzionale) */
}

@keyframes bannerPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    }
}

.promo-banner .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.8;
}

.promo-banner .btn-close:hover {
    opacity: 1;
}

.promo-icon {
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.promo-banner h3 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.promo-banner .lead {
    font-size: 1.1rem;
}

.promo-banner .btn {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.promo-banner .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Mobile */
@media (max-width: 768px) {
    .promo-banner-container {
        width: 95%;
    }

    .promo-banner {
        padding: 1.5rem 1rem;
    }
    
    .promo-banner h3 {
        font-size: 1.5rem;
    }
    
    .promo-banner .lead {
        font-size: 0.95rem;
    }
    
    .promo-banner .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }
    
    .promo-icon i {
        font-size: 2.5rem !important;
    }
}

/* ========== FIX ALTEZZA POSTER ALTERNATIVI ========== */
.card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
    height: 292px;
    width: 100%;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 768px) {
    .card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
        height: 219px;
    }
}

@media (max-width: 576px) {
    .card-body h2:has(i.bi-file-image) ~ .row .gallery-image img {
        height: 183px;
    }
}

/* ========== STAGIONI ED EPISODI (SERIE TV) ========== */
.accordion-item {
    background-color: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-button {
    background-color: var(--dark-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 1.2rem;
}

.accordion-button:not(.collapsed) {
    background-color: var(--dark-card-hover);
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-body {
    padding: 1.5rem;
}

/* Episode Card */
.episode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(229, 9, 20, 0.5);
    transform: translateX(5px);
}

.episode-thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    flex-shrink: 0;
}

.episode-thumbnail-placeholder {
    width: 200px;
    height: 112px;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.episode-thumbnail-placeholder i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.episode-meta {
    font-size: 0.85rem;
}

/* Responsive Episodes */
@media (max-width: 768px) {
    .episode-thumbnail,
    .episode-thumbnail-placeholder {
        width: 120px;
        height: 67px;
    }
    
    .episode-thumbnail-placeholder i {
        font-size: 2rem;
    }
    
    .episode-card {
        padding: 0.8rem;
    }
    
    .episode-card h6 {
        font-size: 0.9rem;
    }
    
    .episode-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .episode-card .d-flex {
        flex-direction: column;
    }
    
    .episode-thumbnail,
    .episode-thumbnail-placeholder {
        width: 100%;
        height: 180px;
    }
}