/**
 * NGVF Standalone Gallery Styles
 * 
 * @package NGVF_Standalone
 * @version 2.0.0
 */

/* ==========================================================================
   Main Container
   ========================================================================== */

.ngvf-standalone-gallery {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 20px;
    box-sizing: border-box;
}

.ngvf-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ==========================================================================
   Thumbnails Section
   ========================================================================== */

.ngvf-thumbnails {
    flex: 0 0 auto;
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
}

/* Scrollbar styling */
.ngvf-thumbnails::-webkit-scrollbar {
    width: 8px;
}

.ngvf-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ngvf-thumbnails::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ngvf-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.ngvf-thumb-grid {
    display: grid;
    gap: 10px;
}

/* Column layouts */
.ngvf-thumbnails[data-columns="1"] {
    width: 170px;
}

.ngvf-thumbnails[data-columns="1"] .ngvf-thumb-grid {
    grid-template-columns: 1fr;
}

.ngvf-thumbnails[data-columns="2"] {
    width: 350px;
}

.ngvf-thumbnails[data-columns="2"] .ngvf-thumb-grid {
    grid-template-columns: repeat(2, 1fr);
}

.ngvf-thumbnails[data-columns="3"] {
    width: 530px;
}

.ngvf-thumbnails[data-columns="3"] .ngvf-thumb-grid {
    grid-template-columns: repeat(3, 1fr);
}

.ngvf-thumbnails[data-columns="4"] {
    width: 710px;
}

.ngvf-thumbnails[data-columns="4"] .ngvf-thumb-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Thumbnail Items
   ========================================================================== */

.ngvf-thumb {
    position: relative;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f8f8;
    transition: all 0.3s ease;
}

.ngvf-thumb:hover {
    border-color: #ddd;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ngvf-thumb.active {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.ngvf-thumb:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ngvf-thumb img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

.ngvf-thumb:hover img {
    opacity: 0.9;
}

/* ==========================================================================
   Main Image Section
   ========================================================================== */

.ngvf-main {
    flex: 1 1 auto;
    min-width: 0;
}

.ngvf-main-wrapper {
    position: relative;
    width: 100%;
    background: #f8f8f8;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.ngvf-main-link {
    display: block;
    position: relative;
}

.ngvf-main-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    transition: transform 0.3s ease;
}

.ngvf-main-link:hover .ngvf-main-img {
    transform: scale(1.02);
}

/* Zoom icon */
.ngvf-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ngvf-main-link:hover .ngvf-zoom-icon {
    opacity: 1;
}

/* ==========================================================================
   Image Info
   ========================================================================== */

.ngvf-info {
    padding: 10px 0;
}

.ngvf-description {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ngvf-pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e5e5;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ngvf-pagination a {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s ease;
    display: inline-block;
}

.ngvf-pagination a:hover {
    background: #005a87;
}

.ngvf-page-info {
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.ngvf-main-wrapper.loading {
    min-height: 400px;
    position: relative;
}

.ngvf-main-wrapper.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: ngvf-spin 1s linear infinite;
}

@keyframes ngvf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .ngvf-container {
        flex-direction: column;
    }
    
    .ngvf-thumbnails {
        width: 100% !important;
        max-height: none;
        overflow-y: visible;
        order: 2;
        margin-top: 20px;
    }
    
    .ngvf-thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    }
    
    .ngvf-main {
        order: 1;
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .ngvf-standalone-gallery {
        padding: 10px;
    }
    
    .ngvf-thumb-grid {
        gap: 8px;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    
    .ngvf-zoom-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .ngvf-thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 5px;
    }
    
    .ngvf-pagination a {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ngvf-thumbnails {
        display: none;
    }
    
    .ngvf-pagination {
        display: none;
    }
    
    .ngvf-zoom-icon {
        display: none;
    }
    
    .ngvf-main-wrapper {
        box-shadow: none;
    }
}
