/* ===================================
   VINTAGE PHOTO ALBUM - STYLE COMPLET
   =================================== */

/* === STYLE GÉNÉRAL === */
.vintage-album-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 15px;
    font-family: 'Georgia', serif;
    perspective: 2500px;
    position: relative;
}

/* === BOUTON NOTRE SITE === */
.vintage-home-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #8b7355 0%, #6b5a47 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(139, 115, 85, 0.4);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatButton 3s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@keyframes floatButton {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 8px 30px rgba(139, 115, 85, 0.4);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 15px 40px rgba(139, 115, 85, 0.5);
    }
}

.vintage-home-button:hover {
    background: linear-gradient(135deg, #9d8463 0%, #7a6654 100%);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 45px rgba(139, 115, 85, 0.6);
    animation: none;
}

.vintage-home-button:active {
    transform: translateY(-2px) scale(1.02);
}

.home-icon {
    font-size: 22px;
    animation: pulseIcon 2s ease-in-out infinite;
}

.home-text {
    white-space: nowrap;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === IMAGE CLICKABLE === */
.vintage-photo-clickable {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.vintage-photo-clickable:hover {
    transform: scale(1.02);
}

/* === LIGHTBOX PLEIN ÉCRAN === */
.vintage-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    animation: fadeInLightbox 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeInLightbox {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vintage-lightbox-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
    position: relative;
}

.vintage-lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 100001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    line-height: 1;
}

.vintage-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.vintage-lightbox-image {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    animation: zoomInImage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-out;
}

@keyframes zoomInImage {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vintage-lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 18px;
    font-style: italic;
    text-align: center;
    max-width: 800px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* === WRAPPER ALBUM === */
.vintage-album-wrapper {
    position: relative;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 31px,
            rgba(139, 115, 85, 0.15) 31px,
            rgba(139, 115, 85, 0.15) 32px
        ),
        linear-gradient(135deg, #f9f6f0 0%, #f2ede3 100%);
    padding: 40px 15px;
    border-radius: 8px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(139, 115, 85, 0.2);
    transform-style: preserve-3d;
    border: 2px solid rgba(139, 115, 85, 0.3);
}

/* Effet de reliure avec spirale */
.vintage-album-wrapper::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 30px;
    bottom: 30px;
    width: 3px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 15px,
        rgba(139, 115, 85, 0.4) 15px,
        rgba(139, 115, 85, 0.4) 35px,
        transparent 35px,
        transparent 50px
    );
    border-radius: 2px;
}

/* Trous de perforation */
.vintage-album-wrapper::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: 30px;
    width: 16px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 15px,
        radial-gradient(circle at center, rgba(139, 115, 85, 0.3) 0%, rgba(139, 115, 85, 0.3) 40%, transparent 40%) 0 25px,
        transparent 35px,
        transparent 50px
    );
    background-size: 16px 50px;
    background-repeat: repeat-y;
}

/* === CAROUSEL === */
.vintage-carousel {
    position: relative;
    width: 100%;
    min-height: 600px;
    height: auto;
    margin: 0 auto;
    transform-style: preserve-3d;
    perspective: 2000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === SLIDES - PAGES DU LIVRE === */
.vintage-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: none;
    backface-visibility: hidden;
}

/* Page active (visible) */
.vintage-slide.active {
    z-index: 100;
    transform: rotateY(0deg);
    animation: none;
}

/* Pages déjà tournées (à gauche) */
.vintage-slide.turned {
    z-index: 1;
    transform: rotateY(-180deg) translateZ(-10px);
}

/* Pages en attente (à droite) */
.vintage-slide.waiting {
    z-index: 50;
    transform: rotateY(0deg);
    opacity: 0;
    pointer-events: none;
}

/* Animation: tourner la page vers l'avant (next) */
.vintage-slide.page-flip-forward {
    z-index: 200;
    animation: flipForward 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

@keyframes flipForward {
    0% {
        transform: rotateY(0deg) translateZ(0);
        box-shadow: 0 20px 80px rgba(0,0,0,0.3);
    }
    25% {
        transform: rotateY(-45deg) translateZ(20px);
        box-shadow: -30px 20px 100px rgba(0,0,0,0.5);
    }
    50% {
        transform: rotateY(-90deg) translateZ(30px);
        box-shadow: -60px 30px 120px rgba(0,0,0,0.6);
    }
    75% {
        transform: rotateY(-135deg) translateZ(20px);
        box-shadow: -30px 20px 100px rgba(0,0,0,0.5);
    }
    100% {
        transform: rotateY(-180deg) translateZ(-10px);
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    }
}

/* Animation: tourner la page vers l'arrière (prev) */
.vintage-slide.page-flip-backward {
    z-index: 200;
    animation: flipBackward 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

@keyframes flipBackward {
    0% {
        transform: rotateY(-180deg) translateZ(-10px);
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    }
    25% {
        transform: rotateY(-135deg) translateZ(20px);
        box-shadow: -30px 20px 100px rgba(0,0,0,0.5);
    }
    50% {
        transform: rotateY(-90deg) translateZ(30px);
        box-shadow: -60px 30px 120px rgba(0,0,0,0.6);
    }
    75% {
        transform: rotateY(-45deg) translateZ(20px);
        box-shadow: -30px 20px 100px rgba(0,0,0,0.5);
    }
    100% {
        transform: rotateY(0deg) translateZ(0);
        box-shadow: 0 20px 80px rgba(0,0,0,0.3);
    }
}

/* === CADRE PHOTO === */
.vintage-photo-frame {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #fdfcf9 0%, #f5f3ed 100%);
    padding: 40px;
    box-shadow: 
        0 15px 50px rgba(0,0,0,0.3),
        inset 0 0 30px rgba(0,0,0,0.03);
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(139, 115, 85, 0.2);
}

/* Effet de reliure centrale */
.vintage-photo-frame::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.15) 0%,
        rgba(0,0,0,0.05) 50%,
        transparent 100%);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
}

/* Bordure décorative intérieure */
.vintage-photo-frame::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(139, 115, 85, 0.3);
    border-radius: 2px;
    pointer-events: none;
}

.vintage-photo-border {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.vintage-photo-border img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 700px;
}

.vintage-caption {
    margin-top: 25px;
    text-align: center;
    font-size: 18px;
    color: #5a4a3a;
    font-style: italic;
    line-height: 1.6;
    font-weight: 500;
}

/* === NAVIGATION === */
.vintage-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(139, 115, 85, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
}

.vintage-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 35px rgba(0,0,0,0.35);
    border-color: #8b7355;
}

.vintage-nav:active {
    transform: translateY(-50%) scale(1.0);
}

.vintage-nav svg {
    width: 32px;
    height: 32px;
    color: #8b7355;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.vintage-prev {
    left: -35px;
}

.vintage-next {
    right: -35px;
}

/* === INDICATEURS - MINIATURES === */
.vintage-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 35px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.vintage-indicator {
    width: 70px;
    height: 70px;
    padding: 0;
    border: 3px solid rgba(139, 115, 85, 0.3);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.vintage-indicator::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139,115,85,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vintage-indicator:hover::before {
    opacity: 1;
}

.vintage-indicator img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.vintage-indicator:hover {
    transform: translateY(-6px) scale(1.05);
    border-color: #8b7355;
    box-shadow: 0 8px 20px rgba(139, 115, 85, 0.4);
}

.vintage-indicator.active {
    border-color: #8b7355;
    border-width: 4px;
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(139, 115, 85, 0.5);
}

.vintage-indicator.active::before {
    opacity: 0;
}

/* === COMPTEUR === */
.vintage-counter {
    text-align: center;
    margin-top: 25px;
    font-size: 20px;
    color: #8b7355;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* === FORMULAIRE MOT DE PASSE - STYLE PIN === */
.vintage-password-form {
    max-width: 380px;
    margin: 60px auto;
    padding: 50px 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid rgba(139, 115, 85, 0.15);
}

.vintage-lock-icon {
    font-size: 70px;
    margin-bottom: 25px;
    animation: lockPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.vintage-password-form h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
}

.vintage-password-form p {
    color: #666;
    margin-bottom: 35px;
    font-size: 15px;
}

/* Container pour les 4 cercles PIN */
.vintage-pin-dots {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 35px;
    padding: 0 20px;
}

.vintage-pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d1d6;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vintage-pin-dot.filled {
    background: #8b7355;
    border-color: #8b7355;
    transform: scale(1.1);
}

/* Input caché pour le PIN */
.vintage-password-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Clavier numérique style iOS */
.vintage-pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 280px;
    margin: 0 auto;
    padding: 0 10px;
}

.vintage-pin-key {
    width: 100%;
    aspect-ratio: 1;
    min-height: 70px;
    background: #f5f5f7;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.vintage-pin-key:hover {
    background: #e8e8ea;
}

.vintage-pin-key:active {
    transform: scale(0.92);
    background: #d1d1d6;
}

.vintage-pin-key.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.vintage-pin-key.delete {
    font-size: 24px;
    background: transparent;
    color: #8b7355;
}

.vintage-pin-key.delete:hover {
    background: rgba(139, 115, 85, 0.1);
}

.vintage-password-submit {
    display: none;
}

.vintage-password-error {
    margin-top: 20px;
    padding: 12px 15px;
    background: #ffebee;
    color: #c62828;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid #ef9a9a;
    font-weight: 500;
}

/* Animation shake pour erreur */
.vintage-pin-dots.shake {
    animation: pinShake 0.5s;
}

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Animation de succès */
.vintage-pin-dots.success .vintage-pin-dot {
    background: #34c759;
    border-color: #34c759;
    animation: pinSuccess 0.6s ease;
}

@keyframes pinSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* === TABLETTES === */
@media (max-width: 1024px) {
    .vintage-album-container {
        max-width: 100%;
        padding: 10px;
    }
    
    .vintage-carousel {
        min-height: 500px;
    }
    
    .vintage-photo-frame {
        padding: 30px;
    }
    
    .vintage-prev {
        left: -25px;
    }
    
    .vintage-next {
        right: -25px;
    }
}

/* === MOBILE LARGE === */
@media (max-width: 768px) {
    .vintage-album-container {
        margin: 10px auto;
        padding: 8px;
        perspective: 1500px;
    }
    
    /* Bouton responsive */
    .vintage-home-button {
        bottom: 20px;
        left: 20px;
        padding: 14px 22px;
        font-size: 13px;
        gap: 10px;
    }
    
    .home-icon {
        font-size: 20px;
    }
    
    /* Lightbox responsive */
    .vintage-lightbox-close {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    
    .vintage-lightbox-image {
        max-width: 100%;
        max-height: 80vh;
    }
    
    .vintage-lightbox-caption {
        font-size: 16px;
        margin-top: 15px;
        padding: 0 20px;
    }
    
    .vintage-album-wrapper {
        padding: 25px 10px 30px;
        border-radius: 6px;
    }
    
    .vintage-carousel {
        min-height: 380px;
        height: auto;
    }
    
    .vintage-photo-frame {
        padding: 20px;
        max-width: 100%;
    }
    
    .vintage-photo-frame::before {
        width: 20px;
    }
    
    .vintage-photo-border img {
        max-height: 400px;
    }
    
    .vintage-caption {
        font-size: 15px;
        margin-top: 20px;
    }
    
    .vintage-nav {
        width: 55px;
        height: 55px;
    }
    
    .vintage-nav svg {
        width: 26px;
        height: 26px;
    }
    
    .vintage-prev {
        left: 5px;
    }
    
    .vintage-next {
        right: 5px;
    }
    
    .vintage-indicators {
        gap: 10px;
        margin-top: 20px;
    }
    
    .vintage-indicator {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }
    
    .vintage-counter {
        font-size: 18px;
        margin-top: 15px;
    }
}

/* === MOBILE STANDARD === */
@media (max-width: 480px) {
    .vintage-album-container {
        margin: 5px auto;
        padding: 5px;
        perspective: 1200px;
    }
    
    /* Bouton mobile - texte réduit */
    .vintage-home-button {
        bottom: 15px;
        left: 15px;
        padding: 12px 20px;
        font-size: 11px;
        gap: 8px;
    }
    
    .home-icon {
        font-size: 18px;
    }
    
    .home-text {
        font-size: 11px;
    }
    
    /* Lightbox mobile */
    .vintage-lightbox {
        padding: 10px;
    }
    
    .vintage-lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
    
    .vintage-lightbox-caption {
        font-size: 14px;
    }
    
    .vintage-album-wrapper {
        padding: 20px 8px 25px;
    }
    
    .vintage-carousel {
        min-height: 320px;
        height: auto;
    }
    
    .vintage-photo-frame {
        padding: 15px;
    }
    
    .vintage-photo-frame::before {
        width: 15px;
    }
    
    .vintage-photo-border img {
        max-height: 350px;
    }
    
    .vintage-caption {
        font-size: 14px;
        margin-top: 15px;
    }
    
    .vintage-nav {
        width: 50px;
        height: 50px;
    }
    
    .vintage-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .vintage-prev {
        left: 3px;
    }
    
    .vintage-next {
        right: 3px;
    }
    
    .vintage-indicators {
        gap: 8px;
        margin-top: 15px;
    }
    
    .vintage-indicator {
        width: 50px;
        height: 50px;
    }
    
    .vintage-counter {
        font-size: 16px;
        margin-top: 12px;
    }
    
    /* Formulaire responsive */
    .vintage-password-form {
        margin: 30px auto;
        padding: 35px 20px;
    }
    
    .vintage-lock-icon {
        font-size: 60px;
    }
    
    .vintage-password-form h3 {
        font-size: 22px;
    }
    
    .vintage-pin-dots {
        gap: 16px;
        margin-bottom: 30px;
    }
    
    .vintage-pin-dot {
        width: 14px;
        height: 14px;
    }
    
    .vintage-pin-keyboard {
        gap: 12px;
        max-width: 260px;
    }
    
    .vintage-pin-key {
        min-height: 65px;
        font-size: 26px;
    }
}

/* === TRÈS PETITS ÉCRANS === */
@media (max-width: 360px) {
    /* Bouton version icône seule */
    .vintage-home-button {
        border-radius: 50%;
        width: 55px;
        height: 55px;
        padding: 0;
        justify-content: center;
        bottom: 15px;
        left: 15px;
    }
    
    .home-text {
        display: none;
    }
    
    .home-icon {
        font-size: 24px;
    }
    
    .vintage-album-wrapper {
        padding: 18px 5px 20px;
    }
    
    .vintage-carousel {
        min-height: 280px;
    }
    
    .vintage-photo-frame {
        padding: 12px;
    }
    
    .vintage-photo-border img {
        max-height: 300px;
    }
    
    .vintage-nav {
        width: 45px;
        height: 45px;
    }
    
    .vintage-nav svg {
        width: 22px;
        height: 22px;
    }
    
    .vintage-indicator {
        width: 45px;
        height: 45px;
    }
    
    .vintage-indicators {
        gap: 6px;
        margin-top: 12px;
    }
    
    .vintage-counter {
        margin-top: 10px;
    }
}