/* shots_design_fixes.css - Refactored for Drawest v4 */

/* 1. Global / Common */
:root {
    --bg-body-light: #f8f9fa;
    --bg-body-dark: #121212;
    --bg-surface-light: #ffffff;
    --bg-surface-dark: #1e1e1e;
    --text-main-light: #212529;
    --text-main-dark: #e0e0e0;
    --border-light: #dee2e6;
    --border-dark: #333333;
}

/* 2. Gallery Grid Fixes */
.gallery-grid {
    column-count: 1;
    column-gap: 1.5rem;
    padding: 0 1rem;
}

@media (min-width: 576px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (min-width: 992px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (min-width: 1400px) {
    .gallery-grid {
        column-count: 4;
    }
}

.photo-card {
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-surface-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

[data-theme="dark"] .photo-card {
    background: var(--bg-surface-dark);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 3. Detail Page - Critical Fixes */
.photo-hero {
    background: transparent !important;
    position: relative;
    padding: 2rem 0;
    text-align: center;
}

.shot-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    /* Fix bottom gap usually caused by inline images */
    line-height: 0;
    border-radius: 8px;
}

/* Controls Overlay - Ensure clickable */
.image-controls-layer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    /* Let clicks pass through if invisible */
}

.shot-wrapper:hover .image-controls-layer,
.image-controls-layer:hover {
    opacity: 1;
    pointer-events: auto;
    /* Enable clicks when visible */
}

/* Mobile support fallback: always show or show on active */
@media (max-width: 768px) {
    .image-controls-layer {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Action Bar */
.action-bar {
    background: var(--bg-surface-light);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .action-bar {
    background: var(--bg-surface-dark);
    border-color: var(--border-dark);
    color: var(--text-main-dark);
}

/* 4. Components */
/* Reference Card */
.ref-card {
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.ref-card:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    background: #f8f9fa;
}

[data-theme="dark"] .ref-card {
    background: #252525;
    border-color: #444;
    color: #eee;
}

[data-theme="dark"] .ref-card:hover {
    background: #303030;
    border-color: #0d6efd;
}

/* Color Palette Swatches */
.palette-swatch {
    cursor: pointer;
    transition: transform 0.1s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.palette-swatch:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.palette-swatch:active {
    transform: scale(0.95);
}

/* Range Slider Styling - Unified */
input[type=range].custom-range,
input[type=range].palette-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right, #0d6efd 0%, #0d6efd 25%, #dee2e6 25%, #dee2e6 100%);
    /* Note: Dynamic background gradient requires JS to update percentage. 
       For static CSS, plain background on track is easier. */
    background: #e9ecef;
}

[data-theme="dark"] input[type=range].custom-range {
    background: #444;
}

input[type=range].custom-range::-webkit-slider-thumb,
input[type=range].palette-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
}

input[type=range].custom-range::-webkit-slider-runnable-track,
input[type=range].palette-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
}

/* Animations */
@keyframes like-bounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.btn-like-active i {
    animation: like-bounce 0.3s ease-in-out;
}