/**
 * YouthMood - Modern Image Gallery Styles
 * 
 * Mobil öncelikli, touch-friendly ürün resim görüntüleme sistemi CSS
 */

/* ===== LIGHTBOX SİSTEMİ ===== */

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-lightbox.active {
    display: block;
    opacity: 1;
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close Button */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100002;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* Navigation Arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100002;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

/* Image Container - SADECE Lightbox için */
.image-lightbox .lightbox-image-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x pan-y pinch-zoom;
}

.image-lightbox .lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
}

.image-lightbox .lightbox-image.zoomed {
    cursor: grab;
}

.image-lightbox .lightbox-image.zoomed:active {
    cursor: grabbing;
}

/* Image Counter */
.lightbox-counter {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    z-index: 100002;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-counter .current {
    color: #667eea;
    font-weight: 800;
}

/* Zoom Controls */
.lightbox-zoom-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 32px;
    z-index: 100002;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 700;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn svg {
    width: 20px;
    height: 20px;
}

.zoom-reset {
    min-width: 50px;
    border-radius: 20px;
}

/* Mobile Hint */
.lightbox-hint {
    position: fixed;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100002;
    display: none;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.5s ease;
    animation: slideUpFade 0.5s ease-out;
}

.lightbox-hint svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Zoom Hint - SADECE Modal ana görselde */
.modal .main-image .zoom-hint {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 1;
    animation: fadeInOut 3s ease-in-out forwards;
    pointer-events: none;
    z-index: 10;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal .main-image .zoom-hint svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

@keyframes fadeInOut {
    0% { 
        opacity: 0; 
        transform: translateY(-10px);
    }
    15% { 
        opacity: 1; 
        transform: translateY(0);
    }
    85% { 
        opacity: 1; 
        transform: translateY(0);
    }
    100% { 
        opacity: 0; 
        transform: translateY(-10px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Mobile Only Elements */
.mobile-only {
    display: none;
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    .image-lightbox .mobile-only {
        display: flex;
    }
    
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    
    .lightbox-close svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-prev {
        left: 12px;
    }
    
    .lightbox-next {
        right: 12px;
    }
    
    .lightbox-counter {
        bottom: 140px;
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .lightbox-zoom-controls {
        bottom: 20px;
        padding: 10px 14px;
        gap: 10px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
    }
    
    .zoom-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .zoom-reset {
        min-width: 45px;
        font-size: 13px;
    }
    
    .lightbox-hint {
        bottom: 90px;
        font-size: 12px;
        padding: 10px 16px;
        max-width: calc(100% - 40px);
        text-align: center;
    }
    
    .modal .main-image .zoom-hint {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .modal .main-image .zoom-hint svg {
        width: 12px;
        height: 12px;
    }
    
    /* Mobilde lightbox image tam ekran */
    .image-lightbox .lightbox-image-container {
        max-width: 100%;
        max-height: 100vh;
    }
    
    .image-lightbox .lightbox-image {
        max-width: 100%;
        max-height: 100vh;
    }
}

/* ===== RESPONSIVE - TABLET ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .lightbox-nav {
        width: 52px;
        height: 52px;
    }
    
    .lightbox-counter {
        bottom: 120px;
    }
    
    .lightbox-zoom-controls {
        bottom: 25px;
    }
}

/* ===== RESPONSIVE - LARGE SCREENS ===== */
@media (min-width: 1440px) {
    .lightbox-nav {
        width: 60px;
        height: 60px;
    }
    
    .lightbox-nav svg {
        width: 28px;
        height: 28px;
    }
    
    .lightbox-prev {
        left: 40px;
    }
    
    .lightbox-next {
        right: 40px;
    }
}

/* ===== KEYBOARD FOCUS STATES ===== */
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.zoom-btn:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .image-lightbox,
    .lightbox-close,
    .lightbox-nav,
    .lightbox-image,
    .zoom-btn {
        transition: none;
    }
    
    .lightbox-hint {
        animation: none;
    }
    
    .zoom-hint {
        animation: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .lightbox-close,
    .lightbox-nav,
    .zoom-btn {
        border-width: 3px;
    }
    
    .lightbox-counter,
    .lightbox-zoom-controls,
    .lightbox-hint,
    .zoom-hint {
        border-width: 3px;
    }
}

/* ===== PRINT ===== */
@media print {
    .image-lightbox {
        display: none !important;
    }
}

/* ===== LOADING STATE ===== */
.image-lightbox .lightbox-image.loading {
    opacity: 0.5;
}

.image-lightbox .lightbox-image.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.image-lightbox .lightbox-image,
.image-lightbox .lightbox-overlay,
.image-lightbox .lightbox-content {
    will-change: transform, opacity;
}

.image-lightbox.active .lightbox-image,
.image-lightbox.active .lightbox-overlay {
    will-change: auto;
}

/* ===== DARK MODE SUPPORT (AUTO) ===== */
@media (prefers-color-scheme: dark) {
    .lightbox-overlay {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* ===== LANDSCAPE MODE (MOBILE) ===== */
@media (max-width: 896px) and (orientation: landscape) {
    .lightbox-counter {
        bottom: 80px;
    }
    
    .lightbox-zoom-controls {
        bottom: 15px;
        padding: 8px 12px;
    }
    
    .lightbox-hint {
        bottom: 70px;
        font-size: 11px;
        padding: 8px 14px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
}
