/* VT Sidebar Styles */
.vt-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: var(--vt-width-expanded, 300px);
    background-color: var(--vt-bg, #ffffff);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease-in-out;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* Background blur overlay when sidebar is expanded */
.vt-sidebar:not(.is-collapsed)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: -1;
    opacity: 0;
    animation: fadeInOverlay 0.3s ease-in-out forwards;
}

.vt-sidebar.is-collapsed::before {
    opacity: 0;
    animation: fadeOutOverlay 0.3s ease-in-out forwards;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOutOverlay {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vt-sidebar {
        transition: none;
    }
    
    .vt-sidebar::before {
        animation: none !important;
        opacity: 0 !important;
    }
}

.vt-sidebar.left {
    left: 0;
    border-top-right-radius: var(--vt-radius, 5px);
    border-bottom-right-radius: var(--vt-radius, 5px);
}

.vt-sidebar.right {
    right: 0;
    left: auto;
    border-top-left-radius: var(--vt-radius, 5px);
    border-bottom-left-radius: var(--vt-radius, 5px);
}

.vt-sidebar.is-collapsed {
    width: 0 !important; /* Hide sidebar */
    min-width: 0;
    overflow: visible;
}

.vt-sidebar.is-collapsed .vt-items {
    opacity: 0;
    pointer-events: none;
}

.vt-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%) !important;
    color: white !important;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
    backdrop-filter: blur(10px);
    /* Force perfect circle */
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    /* Prevent WordPress theme interference */
    font-family: inherit;
    text-decoration: none;
    outline: none;
}

.vt-sidebar.left .vt-toggle {
    right: -25px;
}

.vt-sidebar.right .vt-toggle {
    left: -25px;
}

/* Keep circle in original position - chevron moves within it */
.vt-sidebar.left.is-collapsed .vt-toggle {
    right: -25px;
}

.vt-sidebar.right.is-collapsed .vt-toggle {
    left: -25px;
}

.vt-toggle:hover {
    background: linear-gradient(135deg, #ff3742 0%, #ff4757 100%) !important;
    color: white !important;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 12px 35px rgba(255, 71, 87, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.vt-toggle:active {
    transform: translateY(-50%) scale(1.05);
    transition: all 0.1s ease;
}

.vt-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.3);
}

/* Collapsed state - red gradient */
.vt-sidebar.is-collapsed .vt-toggle {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.vt-sidebar.is-collapsed .vt-toggle:hover {
    background: linear-gradient(135deg, #ff3742 0%, #ff4757 100%);
    box-shadow: 0 12px 35px rgba(255, 71, 87, 0.5);
}

.vt-toggle-icon {
    font-size: 18px;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    color: white !important;
    /* Prevent WordPress theme interference */
    font-family: inherit;
    text-decoration: none;
    outline: none;
}

/* Keep chevron-right in all states - no rotation */
.vt-sidebar.left .vt-toggle-icon,
.vt-sidebar.right .vt-toggle-icon {
    transform: rotate(0deg);
}

/* Move chevron outward within the circle when collapsed */
.vt-sidebar.left.is-collapsed .vt-toggle-icon {
    transform: rotate(0deg) translateX(12px);
}

.vt-sidebar.right.is-collapsed .vt-toggle-icon {
    transform: rotate(0deg) translateX(-8px);
}

/* Enhanced hover effects for icon */
.vt-toggle:hover .vt-toggle-icon {
    transform: scale(1.2);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    color: white !important;
}

/* Pulse animation for collapsed state to draw attention */
.vt-sidebar.is-collapsed .vt-toggle {
    animation: pulse-attention 2s infinite;
}

@keyframes pulse-attention {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4), 0 0 0 8px rgba(255, 71, 87, 0.1);
    }
}

.vt-items {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0; /* removed padding as requested */
    width: 100%;
    box-sizing: border-box;
}

.vt-item {
    width: 100%;
    min-width: 0;
    display: block;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--vt-radius, 5px);
    min-height: var(--vt-thumb-min, 80vh); /* dynamically overridden via JS */
    max-height: none; /* removed max-height limit */
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.vt-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.vt-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Current virtual tour highlighting */
.vt-item.vt-current {
    position: relative;
    border: 3px solid var(--vt-current-color, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3), 0 4px 20px rgba(0, 115, 170, 0.4);
}

.vt-item.vt-current::after {
    content: 'Current';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--vt-current-color, #0073aa);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vt-item.vt-current:hover {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.5), 0 6px 25px rgba(0, 115, 170, 0.5);
}

/* Alternative subtle highlighting option */
.vt-item.vt-current.subtle {
    border: 2px solid var(--vt-current-color, #0073aa);
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2), 0 2px 10px rgba(0, 115, 170, 0.2);
}

.vt-item.vt-current.subtle::after {
    content: '●';
    background: var(--vt-current-color, #0073aa);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 8px;
}

.vt-placeholder {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.vt-sidebar-error {
    padding: 20px;
    color: #d63638;
    font-style: italic;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vt-sidebar {
        width: var(--vt-width-collapsed, 60px) !important;
    }

    .vt-sidebar .vt-items {
        opacity: 0;
        pointer-events: none;
    }

    /* Mobile: Show expanded state when not collapsed */
    .vt-sidebar:not(.is-collapsed) {
        width: var(--vt-width-expanded, 300px) !important;
    }

    .vt-sidebar:not(.is-collapsed) .vt-items {
        opacity: 1;
        pointer-events: auto;
    }

    /* Desktop hover behavior */
    @media (hover: hover) {
        .vt-sidebar:hover {
            width: var(--vt-width-expanded, 300px) !important;
        }

        .vt-sidebar:hover .vt-items {
            opacity: 1;
            pointer-events: auto;
        }
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .vt-sidebar,
    .vt-toggle,
    .vt-items,
    .vt-item,
    .vt-toggle-icon::before,
    .vt-toggle-icon::after {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .vt-sidebar {
        border: 2px solid;
    }

    .vt-toggle {
        border: 2px solid;
    }

    .vt-item {
        border: 1px solid;
    }
}
