/**
 * Revolution Slider - Viewfinder Camera Effect
 * Appliquez cet effet sur votre Revolution Slider WordPress
 * 
 * INSTALLATION:
 * 1. Uploadez ce fichier CSS dans votre thème WordPress (wp-content/themes/votre-theme/css/)
 * 2. Ajoutez-le dans functions.php ou via l'éditeur de thème
 * 3. Ajoutez la classe "viewfinder-slider" à votre Revolution Slider
 */

/* Container principal pour le viewfinder */
.viewfinder-slider {
    position: relative;
    overflow: hidden;
}

/* Overlay sombre pour améliorer le contraste */
.viewfinder-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 5;
    pointer-events: none;
}

/* Container pour tous les effets viewfinder */
.viewfinder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* Grille principale - effet de carrés */
.viewfinder-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
}

.viewfinder-grid-cell {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 255, 255, 0.02);
    animation: gridPulse 3s ease-in-out infinite;
    animation-delay: calc(var(--cell-index) * 0.1s);
}

@keyframes gridPulse {
    0%, 100% {
        background: rgba(0, 255, 255, 0.02);
        border-color: rgba(255, 255, 255, 0.08);
    }
    50% {
        background: rgba(0, 255, 255, 0.05);
        border-color: rgba(0, 255, 255, 0.25);
    }
}

/* Lignes de règle de tiers (Rule of thirds) - comme sur un appareil photo */
.viewfinder-thirds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.viewfinder-line-v {
    position: absolute;
    top: 0;
    height: 100%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.1);
}

.viewfinder-line-v:nth-child(1) { left: 33.33%; }
.viewfinder-line-v:nth-child(2) { left: 66.66%; }

.viewfinder-line-h {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.1);
}

.viewfinder-line-h:nth-child(3) { top: 33.33%; }
.viewfinder-line-h:nth-child(4) { top: 66.66%; }

/* Coins du viewfinder - effet cadre caméra */
.viewfinder-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 255, 255, 0.6);
    z-index: 12;
    pointer-events: none;
    animation: cornerGlow 2s ease-in-out infinite;
}

@keyframes cornerGlow {
    0%, 100% {
        border-color: rgba(0, 255, 255, 0.6);
        box-shadow: 0 0 10px rgba(0, 255, 255, 0);
    }
    50% {
        border-color: rgba(0, 255, 255, 0.8);
        box-shadow: 0 0 20px rgba(0, 255, 255, 0);
    }
}

.viewfinder-corner.top-left {
    top: 40px;
    left: 40px;
    border-right: none;
    border-bottom: none;
}

.viewfinder-corner.top-right {
    top: 40px;
    right: 40px;
    border-left: none;
    border-bottom: none;
}

.viewfinder-corner.bottom-left {
    bottom: 40px;
    left: 40px;
    border-right: none;
    border-top: none;
}

.viewfinder-corner.bottom-right {
    bottom: 40px;
    right: 40px;
    border-left: none;
    border-top: none;
}

/* Indicateurs de caméra - HUD */
.viewfinder-camera-info {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    z-index: 12;
    display: none;
    gap: 25px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 25px;
    border-radius: 5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    pointer-events: none;
}

.viewfinder-camera-info span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Indicateur REC clignotant */
.viewfinder-rec-indicator {
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    animation: recBlink 1.5s infinite;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

@keyframes recBlink {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    }
    50% { 
        opacity: 0.3;
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
    }
}

/* Effet de scan - ligne qui descend */
.viewfinder-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.8), 
        transparent
    );
    animation: scanMove 4s linear infinite;
    z-index: 11;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

@keyframes scanMove {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Effet de vignette */
.viewfinder-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 11;
    pointer-events: none;
}

/* Crosshair central (optionnel) */
.viewfinder-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    z-index: 12;
    pointer-events: none;
}

.viewfinder-crosshair::before,
.viewfinder-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(0, 255, 255, 0.4);
}

.viewfinder-crosshair::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

.viewfinder-crosshair::after {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

/* Cercle central */
.viewfinder-crosshair-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    animation: crosshairPulse 2s ease-in-out infinite;
}

@keyframes crosshairPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

/* Timestamp (optionnel) */
.viewfinder-timestamp {
    position: absolute;
	display:none;
    bottom: 30px;
    right: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 3px;
    z-index: 12;
    pointer-events: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

/* RESPONSIVE - Mobile & Tablet */
@media (max-width: 1024px) {
    .viewfinder-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
    
    .viewfinder-corner {
        width: 50px;
        height: 50px;
    }
    
    .viewfinder-camera-info {
        font-size: 11px;
        gap: 15px;
        padding: 8px 15px;
    }
}

@media (max-width: 768px) {
    .viewfinder-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 3px;
    }
    
    .viewfinder-corner {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .viewfinder-corner.top-left,
    .viewfinder-corner.top-right {
        top: 20px;
    }
    
    .viewfinder-corner.bottom-left,
    .viewfinder-corner.bottom-right {
        bottom: 80px;
    }
    
    .viewfinder-corner.top-left,
    .viewfinder-corner.bottom-left {
        left: 20px;
    }
    
    .viewfinder-corner.top-right,
    .viewfinder-corner.bottom-right {
        right: 20px;
    }
    
    .viewfinder-camera-info {
        font-size: 10px;
        gap: 10px;
        padding: 6px 12px;
        top: 15px;
    }
    
    .viewfinder-timestamp {
        font-size: 10px;
        padding: 6px 10px;
		display:none;
        bottom: 20px;
        right: 20px;
    }
    
    .viewfinder-crosshair {
        width: 30px;
        height: 30px;
    }
    
    .viewfinder-crosshair-circle {
        width: 60px;
        height: 60px;
    }
}

/* Désactiver sur très petits écrans si nécessaire */
@media (max-width: 480px) {
    .viewfinder-grid {
        display: none; /* Optionnel: masquer la grille sur mobile */
    }
    
    .viewfinder-thirds {
        opacity: 0.5;
    }
}

/* Animation d'entrée */
@keyframes viewfinderFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.viewfinder-overlay {
    animation: viewfinderFadeIn 0.5s ease-out;
}

/* Compatibilité avec Revolution Slider */
.rev_slider_wrapper .viewfinder-overlay,
.tp-revslider-mainul .viewfinder-overlay {
    z-index: 10 !important;
}

/* S'assurer que les boutons de navigation restent cliquables */
.viewfinder-slider .tp-leftarrow,
.viewfinder-slider .tp-rightarrow,
.viewfinder-slider .tp-bullets {
    z-index: 15 !important;
    pointer-events: auto !important;
}
