/* Virtual Tour Builder - Frontend Styles */
/* Based on original standalone design, adapted for WordPress plugin */

/* CSS Variables */
:root {
    --vtb-primary: #392082;
    --vtb-primary-light: #4a2aa0;
    --vtb-primary-dark: #2a1661;
    --vtb-accent: #e8e3f5;
    --vtb-light-grey: #f5f5f7;
    --vtb-medium-grey: #d1d1d6;
    --vtb-dark-grey: #86868b;
    --vtb-text: #1d1d1f;
    --vtb-white: #ffffff;
}

/* Tour Container - Scoped wrapper */
.vtb-tour-wrapper {
    font-family: 'Be Vietnam Pro', sans-serif;
    color: var(--vtb-text);
    background: var(--vtb-light-grey);
    margin: 0;
    padding: 0;
}

.vtb-tour-wrapper * {
    box-sizing: border-box;
}

/* Screen reader only */
.vtb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header */
.vtb-tour-header {
    background: var(--vtb-white);
    border-bottom: 1px solid var(--vtb-medium-grey);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
}

.vtb-header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.vtb-tour-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vtb-primary);
    white-space: nowrap;
    margin: 0;
}

.vtb-search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.vtb-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--vtb-medium-grey);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Be Vietnam Pro', sans-serif;
    transition: all 0.3s ease;
    background: var(--vtb-white);
}

.vtb-search-input:focus {
    outline: none;
    border-color: var(--vtb-primary);
    box-shadow: 0 0 0 3px var(--vtb-accent);
}

.vtb-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vtb-dark-grey);
    pointer-events: none;
}

.vtb-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--vtb-primary);
    cursor: pointer;
    padding: 0.5rem;
}

/* Main Layout */
.vtb-main-container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
}

/* Sidebar */
.vtb-sidebar {
    width: 320px;
    background: var(--vtb-white);
    border-right: 1px solid var(--vtb-medium-grey);
    padding: 2rem 0 2rem 2rem;
    overflow-y: auto;
    height: calc(100vh - 100px);
    position: sticky;
    top: 100px;
    transition: transform 0.3s ease;
}

.vtb-sidebar h2 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.5rem;
    color: var(--vtb-primary);
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    font-weight: 700;
}

.vtb-category-section {
    margin-bottom: 2rem;
    padding-right: 1rem;
}

.vtb-category-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vtb-dark-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.vtb-category-toggle {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.vtb-category-title.collapsed .vtb-category-toggle {
    transform: rotate(-90deg);
}

.vtb-location-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vtb-location-list.collapsed {
    max-height: 0;
}

.vtb-location-item {
    padding: 0.625rem 0.5rem;
    margin-bottom: 0.25rem;
    margin-right: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--vtb-text);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.vtb-location-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--vtb-primary);
    color: var(--vtb-white);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.vtb-location-item:hover {
    background: var(--vtb-accent);
    border-color: var(--vtb-primary);
    transform: translateX(4px);
}

.vtb-location-item:hover .vtb-location-number {
    background: var(--vtb-primary-dark);
}

.vtb-location-item.active {
    background: var(--vtb-primary);
    color: var(--vtb-white);
}

.vtb-location-item.active .vtb-location-number {
    background: var(--vtb-white);
    color: var(--vtb-primary);
}

/* Map Container */
.vtb-map-container {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vtb-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--vtb-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(57, 32, 130, 0.12);
    overflow: hidden;
}

.vtb-map-image {
    width: 100%;
    height: auto;
    display: block;
}

.vtb-map {
    /* Image map styles */
}

.vtb-map area {
    cursor: pointer;
}

/* Canvas for hover highlighting */
.vtb-map-highlight-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Mobile Search Results */
.vtb-mobile-results {
    display: none;
    padding: 2rem;
    background: var(--vtb-white);
    border-radius: 16px;
    margin-top: 2rem;
    box-shadow: 0 4px 24px rgba(57, 32, 130, 0.08);
}

.vtb-mobile-results h3 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.25rem;
    color: var(--vtb-primary);
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.vtb-mobile-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vtb-mobile-results-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid var(--vtb-medium-grey);
}

.vtb-mobile-results-list li:hover {
    background: var(--vtb-accent);
    border-color: var(--vtb-primary);
}

/* Modal Overlay */
.vtb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    padding: 2rem;
}

.vtb-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vtb-modal {
    background: var(--vtb-white);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vtb-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--vtb-text);
    z-index: 10;
}

.vtb-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.vtb-modal-header {
    padding: 2rem 2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.vtb-modal-number {
    background: var(--vtb-primary);
    color: var(--vtb-white);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.vtb-modal-title h2 {
    font-size: 1.75rem;
    color: var(--vtb-primary);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.vtb-modal-category {
    font-size: 0.875rem;
    color: var(--vtb-dark-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.vtb-modal-content {
    padding: 0 2rem 2rem;
}

.vtb-featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.vtb-image-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--vtb-dark-grey);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.vtb-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--vtb-text);
    margin-bottom: 2rem;
}

.vtb-content-section {
    margin-bottom: 2rem;
}

.vtb-section-title {
    font-size: 1.25rem;
    color: var(--vtb-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Panorama Container */
.vtb-panorama-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #000;
}

/* Media Grid */
.vtb-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.vtb-media-item {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vtb-media-item:hover {
    transform: scale(1.02);
}

.vtb-media-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.vtb-media-caption {
    padding: 0.75rem;
    background: var(--vtb-light-grey);
    font-size: 0.875rem;
    color: var(--vtb-text);
}

/* Video Container */
.vtb-video-container {
    position: relative;
    width: 100%;
    margin: 10px 0;
    border-radius: 12px;
    overflow: hidden;
}

.vtb-video-container iframe {
    width: 100%;
    height: 400px;
}

.vtb-video-container video {
    width: 100%;
    height: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .vtb-header-content {
        padding: 1rem;
    }

    .vtb-tour-title {
        display: none;
    }

    .vtb-mobile-menu-btn {
        display: block;
    }

    .vtb-main-container {
        flex-direction: column;
    }

    .vtb-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    .vtb-sidebar.open {
        transform: translateX(0);
    }

    .vtb-map-container {
        padding: 1rem;
    }

    .vtb-map-wrapper {
        border-radius: 12px;
    }

    .vtb-mobile-results {
        display: block;
    }

    .vtb-modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .vtb-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .vtb-modal-content {
        padding: 0 1.5rem 1.5rem;
    }

    .vtb-panorama-container {
        height: 300px;
    }

    .vtb-video-container iframe {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .vtb-search-container {
        max-width: 100%;
    }

    .vtb-sidebar {
        width: 260px;
    }

    .vtb-media-grid {
        grid-template-columns: 1fr;
    }
}