/* =========================================
   Webcam Mont Blanc - Custom CSS
   Theme: Dark Mountain Photography
   ========================================= */

/* Alpine x-cloak : masquer jusqu'a initialisation */
[x-cloak] { display: none !important; }

/* Glass morphism */
.glass {
    background: rgba(26, 39, 68, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-nav {
    background: rgba(26, 39, 68, 0.9);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Navigation links */
.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #ced4da;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: #f1f3f5;
    background: rgba(255, 255, 255, 0.06);
}

.nav-active {
    color: #ff922b !important;
    background: rgba(255, 146, 43, 0.1);
}

/* Mobile nav */
.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.5rem;
    transition: color 0.15s ease;
}

/* Animations */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

.animate-pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* Canvas / Image container */
.webcam-container {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.webcam-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Overlay on image */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

/* POI markers */
.poi-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

.poi-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff922b;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 8px rgba(255, 146, 43, 0.5);
    transition: transform 0.2s ease;
}

.poi-marker:hover .poi-dot {
    transform: scale(1.4);
}

.poi-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    background: rgba(26, 39, 68, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poi-marker:hover .poi-tooltip,
.poi-tooltip.opacity-100 {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Sur mobile, les tooltips s'affichent au tap */
@media (max-width: 768px) {
    .poi-dot {
        width: 14px;
        height: 14px;
    }
    .poi-tooltip {
        font-size: 11px;
    }
}

/* Fullscreen mode */
.fullscreen-mode {
    position: fixed !important;
    inset: 0;
    z-index: 100;
    background: #000;
}

.fullscreen-mode .webcam-container {
    height: 100vh;
}

.fullscreen-mode canvas {
    height: 100%;
    object-fit: contain;
}

/* Toolbar auto-hide in fullscreen */
.fullscreen-toolbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    transition: opacity 0.3s ease;
}

.fullscreen-toolbar.hidden-toolbar {
    opacity: 0;
    pointer-events: none;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Comparison slider */
.comparison-container {
    position: relative;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
}

.comparison-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
    cursor: ew-resize;
    z-index: 20;
}

.comparison-slider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* View Transitions API */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: fade-out 0.2s ease-in;
}

::view-transition-new(root) {
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .image-overlay {
        padding: 0.75rem 1rem;
    }
}

/* Button base */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #ff922b;
    color: #1a2744;
}

.btn-primary:hover {
    background: #ffa94d;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f3f5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* Zoom control buttons - large touch targets */
.zoom-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.15s ease;
}

.zoom-btn:active {
    transform: scale(0.9);
}
