/* =========================================================
   1. STILE GENERALE & RESET
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #050505;
    color: #e5e5e5;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

/* Protezione immagini e selezioni */
img {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* =========================================================
   2. HOME PAGE (Logo 16:9 centrato e Sfondo)
   ========================================================= */
.home-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #060606;
    background-image: url('immagini/sfondo 1.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    padding: 20px;
}

body.home-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.88);
    z-index: -1;
    pointer-events: none;
}

.home-container {
    text-align: center;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
}

.logo-wrapper-rectangular {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 16 / 9;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cinematic-logo-rect {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(255, 51, 102, 0.35));
    transition: transform 0.4s ease;
}

.cinematic-logo-rect:hover {
    transform: scale(1.02);
}

/* =========================================================
   3. PULSANTI CINEMATOGRAFICI
   ========================================================= */
.btn-cinematic {
    display: inline-block;
    padding: 12px 35px;
    border: 1px solid #ff3366;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    transition: all 0.4s ease;
    background: rgba(255, 51, 102, 0.05);
    border-radius: 2px;
}

.btn-cinematic:hover {
    background: #ff3366;
    color: #000000;
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.6);
}

.btn-cinematic-small {
    padding: 5px 10px;
    border: 1px solid #ff3366;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: 0.7rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-cinematic-small:hover {
    background: #ff3366;
    color: #000;
}

/* =========================================================
   4. INTERNI, HEADER E SFONDO UNIFORME ("sfondo 1")
   ========================================================= */
.cinematic-interior {
    background-color: #060606;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.film-watermark-bg {
    background-color: #060606;
    background-image: url('immagini/sfondo 1.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

body.film-watermark-bg::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.88);
    z-index: -1;
    pointer-events: none;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    border-bottom: 1px solid #1a1a1a;
    background: rgba(6, 6, 6, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mini-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.site-header nav a {
    color: #888;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.site-header nav a.active, .site-header nav a:hover {
    color: #ff3366;
}

.content-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* Stile tipografico cinematografico */
.cinematic-title {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 3px;
    font-weight: 300;
    color: #fff;
    font-size: 1.8rem;
}

.cinematic-font {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 1.15rem;
    line-height: 1.9;
    color: #dcdcdc;
}

.subtitle {
    color: #ff3366;
    font-size: 0.8rem;
    margin-bottom: 30px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* =========================================================
   5. PULSANTI E CARD PORTFOLIO HOME
   ========================================================= */
.portfolio-header-section {
    text-align: center;
    margin-bottom: 30px;
}

.portfolio-grid-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 650px;
    margin: 0 auto;
}

.cinematic-gallery-btn {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.95) 0%, rgba(8, 8, 8, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
    text-decoration: none;
    color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.cinematic-gallery-btn:hover {
    border-color: #ff3366;
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.3);
    background: linear-gradient(135deg, rgba(25, 10, 18, 0.95) 0%, rgba(10, 5, 8, 0.98) 100%);
}

.gallery-icon-img-box {
    width: 65px;
    height: 45px;
    margin-right: 20px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #444;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.gallery-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
}

.cinematic-gallery-btn:hover .gallery-name {
    color: #ff3366;
}

.gallery-desc {
    font-size: 0.78rem;
    color: #888888;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* =========================================================
   6. CORNICE DELLE FOTO PORTFOLIO E PAGINA LAVORO ("sfondo 2")
   ========================================================= */
.film-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.film-strip-frame {
    background-image: url('immagini/sfondo 2.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid #333333;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.film-strip-frame:hover {
    transform: translateY(-4px);
    border-color: #ff3366;
}

.photo-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.film-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-title {
    display: none;
}

/* Galleria orizzontale pagina lavoro */
.lavoro-horizontal-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.lavoro-frame-card {
    background-image: url('immagini/sfondo 2.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid #333333;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 280px;
    transition: transform 0.3s ease;
}

.lavoro-frame-card:hover {
    transform: translateY(-4px);
    border-color: #ff3366;
}

.lavoro-photo-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lavoro-img-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   7. PULSANTE ADMIN IN BASSO A SINISTRA (STACCATO E PICCOLO)
   ========================================================= */
.page-footer-custom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 25px 40px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(4, 4, 4, 0.9);
}

.admin-access-corner {
    position: relative;
}

.btn-admin-corner {
    background: rgba(15, 15, 15, 0.8);
    color: #777;
    border: 1px solid #333;
    padding: 5px 10px;
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-admin-corner:hover {
    color: #ff3366;
    border-color: #ff3366;
}

.admin-form-popup {
    position: absolute;
    bottom: 30px;
    left: 0;
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 4px;
    width: 160px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    z-index: 50;
}

.admin-form-popup input {
    width: 100%;
    padding: 5px;
    background: #000;
    border: 1px solid #444;
    color: #fff;
    font-size: 0.7rem;
    margin-bottom: 5px;
    text-align: center;
}

.footer-copyright {
    color: #444;
    font-size: 0.7rem;
}

/* =========================================================
   8. LIGHTBOX & MODALE UPLOAD
   ========================================================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border: 1px solid #333;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 2.2rem;
    cursor: pointer;
}

.upload-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.upload-box {
    background: #111;
    border: 1px solid #333;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ff3366;
}

.upload-box form label {
    display: block;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
}

.upload-box input, .upload-box select {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    font-size: 0.85rem;
}

/* =========================================================
   9. PROTEZIONE COPYRIGHT E AVVISO LAMPEGGIANTE
   ========================================================= */
.copyright-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

.blinking-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff0000;
    letter-spacing: 2px;
    text-align: center;
    padding: 20px;
    animation: blinkingAnim 0.6s infinite alternate;
}

@keyframes blinkingAnim {
    0% { opacity: 0.2; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); text-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
}