/* Styles pour la page vidéo - Layout alterné */

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

body.video-page {
    position: relative;
    font-family: "Kanit", sans-serif;
    background-color: #000;
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
}

body.video-page::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* =====================================================
   IMAGE DE FOND — fixe, sans parallax
   ===================================================== */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
}

.parallax-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.1s linear;
    transform-origin: center top;
}

/* =====================================================
   DÉGRADÉ BAS → NOIR, fixe sur l'image
   ===================================================== */
.bottom-fade-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.9) 70%,
        #000 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* =====================================================
   LOGO & NAVIGATION
   ===================================================== */
.page-logo {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
    width: 75px;
    height: 75px;
}

.logo-small {
    width: 75px;
    height: 75px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.hamburger-menu {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
}

.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10001;
}

.hamburger-btn span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn:hover span {
    background-color: #ccc;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    height: 100%;
    z-index: 9999;
    transition: right 0.4s ease;
    opacity: 0;
    visibility: hidden;
}

.menu-overlay.active {
    right: 0;
    opacity: 1;
    visibility: visible;
}

.menu-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 40px;
}

.menu-item {
    color: white;
    text-decoration: none;
    font-size: 32px;
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    padding: 15px 30px;
    border: 2px solid transparent;
    border-radius: 5px;
}

.menu-item:hover,
.menu-item.active {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-10px);
}

/* =====================================================
   TITRE PRINCIPAL
   ===================================================== */
.video-title {
    position: relative;
    z-index: 10;
    padding: 140px 60px 60px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.video-title h1 {
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(42px, 6vw, 80px);
    letter-spacing: 2px;
    line-height: 1.05;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

/* Phrase d'accroche */
.projects-intro {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px 50px 60px;
}

.projects-intro p {
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Liste des projets */
.projects-list {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 120px 40px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* =====================================================
   LIGNE DE PROJET (alternance gauche/droite)
   ===================================================== */
.project-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 420px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-row.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ordre normal : image gauche, texte droite */
.project-row .project-image {
    order: 1;
}

.project-row .project-text {
    order: 2;
    padding-left: 60px;
}

/* Ordre inversé : texte gauche, image droite */
.project-row.reverse .project-image {
    order: 2;
}

.project-row.reverse .project-text {
    order: 1;
    padding-left: 0;
    padding-right: 60px;
    text-align: right;
}

/* =====================================================
   IMAGE DU PROJET
   ===================================================== */
.project-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 12px;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    display: block;
}

.project-row:hover .image-wrapper img {
    transform: scale(1.05);
}

/* Fondu côté texte (droite) pour le layout normal */
.image-gradient-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.85));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
}

/* Fondu côté texte (gauche) pour le layout inversé */
.image-gradient-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to left, transparent, rgba(0,0,0,0.85));
    pointer-events: none;
    border-radius: 12px 0 0 12px;
}

/* =====================================================
   TEXTE DU PROJET
   ===================================================== */
.project-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-number {
    font-family: "Kanit", sans-serif;
    font-weight: 200;
    font-style: italic;
    font-size: 14px;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.project-title {
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    text-transform: uppercase;
    font-size: clamp(26px, 3vw, 42px);
    color: white;
    line-height: 1.1;
    letter-spacing: 1px;
}

.project-desc {
    font-family: "Kanit", sans-serif;
    font-weight: 200;
    font-style: italic;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    max-width: 380px;
}

.project-row.reverse .project-desc {
    max-width: 380px;
    margin-left: auto;
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 24px;
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: fit-content;
}

.watch-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.watch-btn:hover {
    background: white;
    color: black;
    border-color: white;
}

.watch-btn:hover svg {
    transform: scale(1.2);
}

.project-row.reverse .watch-btn {
    margin-left: auto;
}

/* =====================================================
   MODAL VIDÉO
   ===================================================== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Croix — fixée dans le coin supérieur droit de l'écran, indépendante de tout transform */
.modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease, transform 0.2s ease;
}

.video-modal.active .modal-close {
    opacity: 1;
    visibility: visible;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

/* Contenu modal — sans padding, juste la vidéo */
.modal-content {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 1000px;
    max-height: 90vh;
    background: rgba(10, 10, 10, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.video-modal.active .modal-content {
    transform: scale(1);
}

/* Wrapper vidéo YouTube — ratio 16:9 */
.modal-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
}

.modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}

/* Wrapper tweet — hauteur auto, scroll si nécessaire */
.modal-video-wrapper.tweet-mode {
    padding-bottom: 0;
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    border-radius: 16px;
}

/* Contenu Tweet dans la modal */
.tweet-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    width: 100%;
}

.tweet-error a {
    color: white;
    margin-top: 10px;
    display: block;
    text-decoration: underline;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .project-row {
        grid-template-columns: 1fr 1fr;
        min-height: 340px;
    }

    .project-row .project-text {
        padding-left: 40px;
    }

    .project-row.reverse .project-text {
        padding-right: 40px;
    }

    .video-title {
        padding: 140px 40px 50px 40px;
    }
}

@media (max-width: 768px) {
    /* Logo scroll avec la page sur mobile */
    .page-logo {
        position: absolute;
        top: 80px;
    }

    /* Cacher hamburger sur mobile */
    .hamburger-menu {
        display: none;
    }

    /* Menu toujours visible sur mobile */
    .menu-overlay {
        width: auto;
        right: auto;
        left: 50%;
        top: 30px;
        height: auto;
        transform: translateX(-50%);
        opacity: 1;
        visibility: visible;
        transition: none;
    }

    .menu-content {
        flex-direction: row;
        gap: 15px;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
    }

    .menu-item {
        font-size: 16px;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        white-space: nowrap;
    }

    .menu-item:hover,
    .menu-item.active {
        transform: translateY(-2px);
    }

    .video-title {
        padding: 155px 24px 40px 24px;
    }

    .projects-list {
        padding: 0 24px 80px 24px;
        gap: 0;
    }

    /* Sur mobile, tout s'empile verticalement */
    .project-row {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 30px 0;
        gap: 20px;
    }

    .project-row .project-image,
    .project-row.reverse .project-image {
        order: 1;
    }

    .project-row .project-text,
    .project-row.reverse .project-text {
        order: 2;
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    .project-row.reverse .project-desc {
        margin-left: 0;
    }

    .project-row.reverse .watch-btn {
        margin-left: 0;
    }

    .image-wrapper {
        height: 220px;
    }

    /* Gradient en bas sur mobile */
    .image-gradient-right,
    .image-gradient-left {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50%;
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
        border-radius: 0 0 12px 12px;
    }

    .modal-content {
        width: 95vw;
        padding: 40px 20px 25px;
    }
}

@media (max-width: 480px) {
    .video-title h1 {
        font-size: 36px;
    }

    .image-wrapper {
        height: 180px;
    }

    .project-title {
        font-size: 26px;
    }

    .project-desc {
        font-size: 14px;
    }
}

/* =====================================================
   BOUTON ME CONTACTER & POPUP
   ===================================================== */
.contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    color: black;
    border: none;
    padding: 12px 24px;
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10002;
    text-transform: uppercase;
}

.contact-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.contact-popup {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 10003;
    transition: bottom 0.5s ease;
}

.contact-popup.active {
    bottom: 0;
}

.popup-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px 15px 0 0;
    padding: 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    color: #333;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.close-popup:hover {
    transform: rotate(90deg);
}

.popup-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.mail-icon {
    width: 60px;
    height: 60px;
    color: #000;
}

.popup-title {
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 28px;
    margin: 0;
    color: #000;
    text-transform: uppercase;
}

.email-link {
    font-family: "Kanit", sans-serif;
    font-weight: 200;
    font-style: italic;
    font-size: 20px;
    color: #000;
    background: transparent;
    padding: 10px 20px;
    border: 2px solid #000;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.email-link:hover {
    background: #000;
    color: white;
}

.copy-feedback {
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 14px;
    color: #4CAF50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
}
