/* ===================================
   OPTIMIZED IMAGE SLIDER STYLES
   Maximizes image display (85% height)
   Minimizes metadata space (5%)
   =================================== */

/* Modal Container */
.image-slider-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.image-slider-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Header Section (5% height) */
.image-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

/* Buttons */
.slider-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.slider-btn:hover {
    background: rgba(255, 127, 80, 0.8);
    border-color: rgba(255, 127, 80, 1);
    transform: translateY(-2px);
}

.slider-close-btn {
    width: 45px;
    height: 45px;
    font-size: 22px;
}

.slider-close-btn:hover {
    transform: rotate(90deg);
}

/* Counter */
.slider-counter {
    font-size: 16px;
    color: white;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Actions */
.slider-actions {
    display: flex;
    gap: 10px;
}

/* Image Container (85% height - maximized) */
.slider-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.slider-image-container.zoomed {
    overflow: auto;
    cursor: move;
}

/* Main Image */
.slider-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.slider-main-image.zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    min-width: 200%;
    cursor: move;
}

/* Loading Spinner */
.slider-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slider-loading.active {
    opacity: 1;
    visibility: visible;
}

.slider-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff7f50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navigation Buttons */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 5;
}

.slider-nav-btn.prev {
    left: 20px;
}

.slider-nav-btn.next {
    right: 20px;
}

.slider-nav-btn:hover:not(:disabled) {
    background: rgba(255, 127, 80, 0.8);
    border-color: #ff7f50;
    transform: translateY(-50%) scale(1.1);
}

.slider-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Metadata Overlay (5% height - compact) */
.slider-metadata-overlay {
    position: relative;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 100%);
    padding: 12px 20px;
    flex-shrink: 0;
    max-height: 200px;
    overflow: auto;
}

/* Metadata Content */
.slider-metadata-content {
    opacity: 1;
}


.slider-metadata-content h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slider-metadata-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Metadata Grid */
.slider-meta-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.slider-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.slider-meta-item i {
    font-size: 14px;
    color: #ff7f50;
}

/* Thumbnails Container (10%) */
.slider-thumbnails-container {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    flex-shrink: 0;
    max-height: 140px;
    overflow: hidden;
}

/* Thumbnails Wrapper */
.slider-thumbnails-wrapper {
    opacity: 1;
    overflow: hidden;
}

/* Thumbnails Strip */
.slider-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 127, 80, 0.5) rgba(255, 255, 255, 0.1);
}

.slider-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.slider-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.slider-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 127, 80, 0.5);
    border-radius: 3px;
}

.slider-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 127, 80, 0.8);
}

/* Individual Thumbnail */
.slider-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.slider-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.slider-thumbnail:hover {
    border-color: rgba(255, 127, 80, 0.8);
    transform: translateY(-3px);
}

.slider-thumbnail:hover img {
    transform: scale(1.1);
}

.slider-thumbnail.active {
    border-color: #ff7f50;
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(255, 127, 80, 0.4);
}

/* Notification */
.slider-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(255, 127, 80, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.slider-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .image-slider-header {
        padding: 10px 15px;
    }

    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .slider-close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .slider-counter {
        font-size: 14px;
        padding: 6px 12px;
    }

    .slider-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .slider-nav-btn.prev {
        left: 10px;
    }

    .slider-nav-btn.next {
        right: 10px;
    }

    .slider-metadata-overlay {
        padding: 10px 15px;
    }

    .slider-metadata-content h3 {
        font-size: 16px;
    }

    .slider-metadata-content p {
        font-size: 12px;
    }

    .slider-meta-grid {
        gap: 12px;
    }

    .slider-meta-item {
        font-size: 11px;
    }

    .slider-thumbnails-container {
        padding: 10px 15px;
        max-height: 120px;
    }

    .slider-thumbnail {
        width: 70px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .image-slider-header {
        padding: 8px 10px;
    }

    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .slider-close-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .slider-counter {
        font-size: 12px;
        padding: 5px 10px;
    }

    .slider-actions {
        gap: 6px;
    }

    .slider-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .slider-metadata-overlay {
        padding: 8px 10px;
    }

    .slider-metadata-content h3 {
        font-size: 14px;
    }

    .slider-metadata-content p {
        font-size: 11px;
        -webkit-line-clamp: 1;
    }

    .slider-meta-grid {
        gap: 10px;
    }

    .slider-meta-item {
        font-size: 10px;
    }

    .slider-meta-item i {
        font-size: 12px;
    }

    .slider-thumbnails-container {
        padding: 8px 10px;
        max-height: 100px;
    }

    .slider-thumbnail {
        width: 60px;
        height: 45px;
        border-width: 1px;
    }

    .slider-thumbnail.active {
        border-width: 2px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .slider-metadata-overlay {
        max-height: 100px;
    }

    .slider-thumbnails-container {
        max-height: 80px;
        padding: 10px 15px 8px;
    }

    .slider-thumbnail {
        width: 60px;
        height: 45px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .slider-main-image {
        max-height: 80vh;
    }
}

/* Large Screens */
@media (min-width: 1920px) {
    .slider-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .slider-close-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .slider-counter {
        font-size: 18px;
        padding: 10px 20px;
    }

    .slider-nav-btn {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .slider-metadata-content h3 {
        font-size: 20px;
    }

    .slider-metadata-content p {
        font-size: 14px;
    }

    .slider-meta-item {
        font-size: 13px;
    }

    .slider-thumbnail {
        width: 90px;
        height: 68px;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .image-slider-modal {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .image-slider-modal,
    .slider-btn,
    .slider-nav-btn,
    .slider-thumbnail,
    .slider-main-image,
    .slider-metadata-overlay,
    .slider-thumbnails-container,
    .slider-notification {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .image-slider-modal {
        display: none !important;
    }
}
