/* NX Office Tour Gallery Widget - Unique Classes */

.nx-office-gallery-widget {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Location Tabs */
.nx-location-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.nx-location-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.nx-location-tab:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.nx-location-tab.active {
    background: #ffffff;
    border-color: #4a90e2;
    color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.nx-location-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.nx-location-address {
    font-size: 13px;
    opacity: 0.7;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-all;
    hyphens: auto;
    overflow-wrap: anywhere;
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
}

/* Gallery Container */
.nx-gallery-container {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.nx-gallery-location {
    display: none;
}

.nx-gallery-location.active {
    display: block;
}

/* Main Gallery */
.nx-main-gallery {
    position: relative;
    overflow: hidden;
}

.nx-gallery-images {
    position: relative;
    min-height: 400px;
    height: auto;
    aspect-ratio: 16/10;
}

.nx-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.nx-gallery-slide.active {
    opacity: 1;
}

.nx-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #f8f9fa;
}

/* Image fit variations */
.nx-gallery-images[data-image-fit="cover"] .nx-gallery-image {
    object-fit: cover;
    background: transparent;
}

.nx-gallery-images[data-image-fit="contain"] .nx-gallery-image {
    object-fit: contain;
    background: #f8f9fa;
}

/* Image Captions */
.nx-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #4a90e2;
    color: #ffffff;
    padding: 20px;
    font-size: 16px;
    line-height: 1.4;
    backdrop-filter: blur(10px);
}

/* Navigation Arrows */
.nx-gallery-nav {
    position: absolute;
    top: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid lightgray;
    border-radius: 10%;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.25);
}

.nx-gallery-nav:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.4);
}

.nx-gallery-nav:active {
    transform: scale(0.95);
}

.nx-gallery-nav.nx-prev {
    right: 90px;
}

.nx-gallery-nav.nx-next {
    right: 20px;
}

.nx-gallery-nav:disabled {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(211, 211, 211, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.1);
}

/* Thumbnails */
.nx-gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

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

.nx-gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.nx-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.nx-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none;
    padding: 0;
}

.nx-thumbnail:hover {
    border-color: #4a90e2;
    transform: scale(1.05);
}

.nx-thumbnail.active {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.nx-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery Counter */
.nx-gallery-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Loading State */
.nx-gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background: #f8f9fa;
    color: #666;
    font-size: 16px;
}

.nx-gallery-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: nx-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nx-location-tabs {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .nx-location-tab {
        min-width: 280px;
        width: 90%;
        max-width: 350px;
        padding: 14px 20px;
        min-height: 70px;
        justify-content: center;
    }
    
    .nx-gallery-images {
        min-height: 300px;
        aspect-ratio: 16/11;
    }
    
    .nx-gallery-nav {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .nx-gallery-nav.nx-prev {
        right: 70px;
    }
    
    .nx-gallery-nav.nx-next {
        right: 15px;
    }
    
    .nx-image-caption {
        padding: 15px;
        font-size: 14px;
    }
    
    .nx-gallery-thumbnails {
        padding: 15px;
        gap: 8px;
    }
    
    .nx-thumbnail {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .nx-gallery-images {
        min-height: 250px;
        aspect-ratio: 4/3;
    }
    
    .nx-location-tab {
        padding: 12px 14px;
        min-width: 240px;
        width: 92%;
        max-width: 300px;
        min-height: 80px;
        margin: 0 auto;
    }
    
    .nx-location-name {
        font-size: 14px;
        line-height: 1.3;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .nx-location-address {
        font-size: 10px;
        line-height: 1.3;
        max-width: 100%;
        margin-top: 3px;
        word-break: break-all;
        overflow-wrap: anywhere;
        white-space: normal;
        display: block;
    }
    
    .nx-image-caption {
        padding: 12px;
        font-size: 13px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .nx-location-tab {
        padding: 10px 12px;
        min-width: 220px;
        width: 90%;
        max-width: 280px;
        min-height: 85px;
    }
    
    .nx-location-name {
        font-size: 13px;
    }
    
    .nx-location-address {
        font-size: 9px;
        line-height: 1.2;
    }
}

/* Animation Classes */
.nx-fade-in {
    animation: nx-fadeIn 0.5s ease;
}

.nx-slide-in-right {
    animation: nx-slideInRight 0.5s ease;
}

.nx-slide-in-left {
    animation: nx-slideInLeft 0.5s ease;
}

@keyframes nx-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nx-slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes nx-slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Accessibility */
.nx-gallery-nav:focus,
.nx-location-tab:focus,
.nx-thumbnail:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .nx-gallery-nav,
    .nx-gallery-thumbnails {
        display: none;
    }
    
    .nx-gallery-images {
        height: auto;
    }
    
    .nx-gallery-slide {
        position: static;
        opacity: 1;
        page-break-inside: avoid;
    }
}