/* Next Stage Gallery - Minimalist Design axat pe imaginea mare */

:root {
    /* Material Design Color Palette - Simplificat */
    --md-primary: #2196f3;
    --md-secondary: #03dac6;
    --md-background: #fafafa;
    --md-surface: #ffffff;
    --md-on-primary: #ffffff;
    --md-on-surface: #000000;
    
    /* Material Design Motion - Simplificat */
    --md-motion-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
    --md-duration-simple: 100ms;
    --md-duration-complex: 200ms;
    
    /* Material Design Border Radius - Minimal */
    --md-shape-small: 2px;
    --md-shape-medium: 4px;
    --md-shape-large: 8px;
    
    /* Typography */
    --md-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Container Principal - Minimalist */
.next-stage-gallery-container {
    position: relative;
    width: 100%;
    max-width: 1200px; /* Mărit pentru focus pe imaginea mare */
    margin: 16px auto;
    background: var(--md-surface);
    border: 1px solid rgba(0, 0, 0, 0.08); /* Border subtil în loc de shadow */
    border-radius: var(--md-shape-medium);
    overflow: visible;
    font-family: var(--md-font-family);
    transition: border-color var(--md-duration-complex) var(--md-motion-standard);
}

.next-stage-gallery-container:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Main Slider - Axat pe imaginea mare */
.nsg-main-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-shape-medium) var(--md-shape-medium) 0 0;
    min-height: 500px; /* Înălțime mai mare pentru focus pe imagine */
}

/* Responsive heights - Mărite pentru focus pe imagine */
@media (min-width: 769px) {
    .nsg-main-slider[data-height-desktop] {
        height: var(--height-desktop, 800px) !important; /* Mărit din 700px */
        min-height: 600px !important;
    }
}

@media (max-width: 768px) {
    .nsg-main-slider[data-height-mobile] {
        height: var(--height-mobile, 450px) !important; /* Mărit din 400px */
        min-height: 350px !important;
    }
}

/* Slide - Optimizat pentru imaginea mare */
.nsg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--md-duration-complex) var(--md-motion-standard);
    background: #000;
    padding: 0;
}

.nsg-slide.active {
    opacity: 1;
    z-index: 2;
}

.nsg-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    opacity: 0;
    transition: opacity var(--md-duration-complex) var(--md-motion-standard);
}

.nsg-slide img.loaded {
    opacity: 1;
}

/* Toolbar - Minimalist și mai discret */
.nsg-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    color: var(--md-on-primary);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    opacity: 0;
    transform: translateY(-100%);
    transition: all var(--md-duration-complex) var(--md-motion-standard);
}

.next-stage-gallery-container:hover .nsg-toolbar {
    opacity: 1;
    transform: translateY(0);
}

.nsg-toolbar-left,
.nsg-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nsg-toolbar-center {
    flex: 1;
    margin: 0 16px;
}

/* Counter - Minimalist */
.nsg-counter {
    font-size: 14px;
    font-weight: 400;
    font-family: var(--md-font-family);
    background: rgba(0, 0, 0, 0.3);
    color: var(--md-on-primary);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background var(--md-duration-simple) var(--md-motion-standard);
}

/* Progress Bar - Minimalist */
.nsg-progress-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    overflow: hidden;
}

.nsg-progress-fill {
    height: 100%;
    background: var(--md-primary);
    border-radius: 1px;
    transition: width var(--md-duration-complex) var(--md-motion-standard);
    width: 0%;
}

/* Tool Buttons - Minimalist și flat */
.nsg-tool-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-on-primary);
    transition: all var(--md-duration-simple) var(--md-motion-standard);
    position: relative;
}

.nsg-tool-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.nsg-tool-btn:active {
    transform: scale(0.95);
}

/* Tool Button Icons - Simplificate */
.nsg-tool-btn svg {
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 1.5 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    width: 20px !important;
    height: 20px !important;
    opacity: 0.9;
    transition: opacity var(--md-duration-simple) var(--md-motion-standard);
}

.nsg-tool-btn:hover svg {
    opacity: 1;
}

/* Navigation Arrows - Minimalist */
.nsg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all var(--md-duration-simple) var(--md-motion-standard);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
}

.next-stage-gallery-container:hover .nsg-arrow {
    opacity: 1;
    pointer-events: all;
}

.nsg-arrow:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--md-primary);
    color: var(--md-primary);
}

.nsg-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* Poziționare săgeți */
.nsg-arrow.nsg-prev {
    left: 10px;
}

.nsg-arrow.nsg-next {
    right: 10px;
}

@media (max-width: 1024px) {
    .nsg-arrow.nsg-prev {
        left: 12px;
    }
    
    .nsg-arrow.nsg-next {
        right: 12px;
    }
}

.nsg-arrow::after {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-right: none;
    border-bottom: none;
}

.nsg-arrow.nsg-prev::after {
    transform: rotate(-45deg);
    margin-left: 2px;
}

.nsg-arrow.nsg-next::after {
    transform: rotate(135deg);
    margin-right: 2px;
}

/* Caption - Minimalist */
.nsg-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: var(--md-on-primary);
    padding: 32px 16px 16px;
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--md-font-family);
}

/* Dots Navigation - Minimalist */
.nsg-dots {
    display: flex;
    justify-content: center;
    padding: 16px;
    gap: 8px;
    background: rgb(255 255 255);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nsg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(255 255 255);
    cursor: pointer;
    transition: all var(--md-duration-simple) var(--md-motion-standard);
    border: none;
}

.nsg-dot:hover,
.nsg-dot.active {
    background: var(--md-primary);
    transform: scale(1.25);
}

.nsg-dot.active {
    width: 16px;
    border-radius: 4px;
}

/* Thumbnails - Minimalist */
.nsg-thumbnails {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: var(--md-background);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--md-primary) transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nsg-thumbnails::-webkit-scrollbar {
    height: 3px;
}

.nsg-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.nsg-thumbnails::-webkit-scrollbar-thumb {
    background: var(--md-primary);
    border-radius: 2px;
}

.nsg-thumbnail {
    flex-shrink: 0;
    width: 64px;
    height: 48px;
    border-radius: var(--md-shape-small);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--md-duration-simple) var(--md-motion-standard);
    border: 2px solid transparent;
    background: #f5f5f5;
}

.nsg-thumbnail:hover {
    border-color: var(--md-primary);
}

.nsg-thumbnail.active {
    border-color: var(--md-primary);
}

.nsg-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading State - Minimalist */
.nsg-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity var(--md-duration-complex) var(--md-motion-standard);
    border-radius: var(--md-shape-medium);
}

.nsg-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nsg-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(33, 150, 243, 0.2);
    border-top: 2px solid var(--md-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.nsg-loading-text {
    color: var(--md-primary);
    font-size: 14px;
    font-weight: 400;
    font-family: var(--md-font-family);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design - Optimizat pentru imaginea mare */
@media (max-width: 768px) {
    .next-stage-gallery-container {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    
    .nsg-main-slider {
        min-height: 350px;
    }
    
    .nsg-toolbar {
        padding: 8px 12px;
    }
    
    .nsg-toolbar-center {
        margin: 0 12px;
    }
    
    .nsg-toolbar-left,
    .nsg-toolbar-right {
        gap: 8px;
    }
    
    .nsg-tool-btn {
        width: 36px;
        height: 36px;
    }
    
    .nsg-tool-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .nsg-arrow {
        width: 36px;
        height: 36px;
    }
    
    .nsg-counter {
        font-size: 12px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .nsg-main-slider {
        min-height: 280px;
    }
    
    .nsg-toolbar-center {
        display: none; /* Ascunde progress bar pe ecrane foarte mici */
    }
    
    .nsg-thumbnail {
        width: 56px;
        height: 42px;
    }
}

/* Dark Theme - Minimalist */
@media (prefers-color-scheme: dark) {
    :root {
        --md-primary: #64b5f6;
        --md-background: #121212;
        --md-surface: #1e1e1e;
        --md-on-surface: #ffffff;
    }
    
    .next-stage-gallery-container {
        background: var(--md-surface);
        border-color: rgba(255, 255, 255, 0.12);
    }
    
    .nsg-thumbnails {
        background: var(--md-background);
    }
    
    .nsg-dots {
        background: var(--md-surface);
        border-top-color: rgba(255, 255, 255, 0.12);
    }
    
    .nsg-arrow {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .nsg-arrow:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--md-primary);
    }
}

/* Accessibility - Minimalist */
.nsg-arrow:focus,
.nsg-dot:focus,
.nsg-thumbnail:focus,
.nsg-tool-btn:focus {
    outline: 2px solid var(--md-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Fullscreen - Minimalist */
.nsg-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: #000 !important;
    border-radius: 0 !important;
    border: none !important;
}

.nsg-fullscreen .nsg-main-slider {
    height: 100vh !important;
    border-radius: 0 !important;
}

.nsg-fullscreen .nsg-toolbar {
    opacity: 1;
    transform: translateY(0);
}