/* ============================================================
   360° VIRTUAL TOUR - PUBLIC PAGE STYLES
   Evaans Matriculation Higher Secondary School
   ============================================================ */

/* ---- Page Hero for 360 Tour ---- */
.page-hero {
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #050a1e 0%, #1a1a2e 50%, #16213e 100%);
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    background: url('images/school-bg.jpg') center/cover no-repeat;
    opacity: 0.2;
}

.page-hero-content {
    position: relative;
    z-index: 10;
    padding: 40px 20px;
}

.page-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.page-hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255,255,255,0.8);
    margin-bottom: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: 100px;
    color: white;
    font-weight: 600;
}

.hero-badge i {
    font-size: 1.2em;
    color: var(--accent, #ff5e14);
}

/* ---- Tour Section ---- */
.tour-section {
    padding: 40px 0 60px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 70vh;
}

.tour-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    min-height: 600px;
}

/* ---- Tour Sidebar ---- */
.tour-sidebar {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    height: fit-content;
    max-height: calc(100vh - 160px);
    position: sticky;
    top: 100px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.tour-sidebar.collapsed .sidebar-content,
.tour-sidebar.collapsed .sidebar-header h3 span {
    display: none;
}

/* Grid adapts when sidebar is collapsed */
.tour-container.sidebar-collapsed {
    grid-template-columns: 1fr;
}

/* Floating open button (appears when sidebar is collapsed) */
.sidebar-open-btn {
    display: none;
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.sidebar-open-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.sidebar-open-btn.visible {
    display: flex;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

/* Back Navigation */
.nav-back {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.nav-back:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateX(-4px);
}

/* Navigation Sections */
.nav-section {
    margin-bottom: 24px;
}

.nav-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-item:hover {
    background: #fff;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.nav-item i {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

/* Tour Tips */
.tour-tips {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f7ff, #e8f4ff);
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.tour-tips h4 {
    font-size: 13px;
    font-weight: 700;
    color: #0369a1;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tour-tips li {
    font-size: 12px;
    color: #475569;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tour-tips li i {
    color: #0ea5e9;
    width: 16px;
}

/* ---- Tour Viewer ---- */
.tour-viewer {
    position: relative;
    background: #111;
    border-radius: 20px;
    overflow: hidden;
    min-height: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Panorama Container */
.panorama-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
    background: #000;
}

.viewer-canvas {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
}

.viewer-canvas:active {
    cursor: grabbing;
}

/* No Panorama State */
.no-panorama {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #888;
    text-align: center;
    padding: 40px;
}

.no-panorama-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-panorama h3 {
    font-size: 24px;
    font-weight: 700;
    color: #555;
    margin: 0 0 12px;
}

.no-panorama p {
    font-size: 16px;
    color: #888;
    margin: 0 0 24px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Location Overlay */
.location-overlay {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    color: white;
    padding: 20px 28px;
    border-radius: 16px;
    max-width: 400px;
    z-index: 20;
}

.location-overlay .breadcrumb {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}

.location-overlay h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.location-overlay p {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin: 0;
    line-height: 1.5;
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}

.viewer-controls button {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-controls button:hover {
    background: rgba(102, 126, 234, 0.8);
    transform: scale(1.1);
}

.viewer-controls button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Hotspots */
.hotspot {
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #ff5e14 0%, #ff3300 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    animation: hotspotPulse 2s infinite;
    box-shadow: 0 0 20px rgba(255, 94, 20, 0.5);
    z-index: 15;
}

.hotspot::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(255, 94, 20, 0.5);
    border-radius: 50%;
    animation: hotspotRing 2s infinite;
}

.hotspot:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

.hotspot-label {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.hotspot:hover .hotspot-label {
    opacity: 1;
}

@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 94, 20, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 94, 20, 0.8); }
}

@keyframes hotspotRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Instructions Section ---- */
.instructions-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    text-align: center;
    color: var(--dark, #050a1e);
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin-bottom: 48px;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.instruction-card {
    background: white;
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.instruction-card:hover {
    transform: translateY(-8px);
    border-color: #667eea;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
}

.instruction-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #667eea;
}

.instruction-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark, #050a1e);
    margin-bottom: 12px;
}

.instruction-card p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ---- CTA Section ---- */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
}

.cta-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-buttons .btn-primary {
    background: white;
    color: #667eea;
}

.cta-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.cta-buttons .btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

.cta-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* ---- Responsive Design ---- */
@media (max-width: 1024px) {
    .tour-container {
        grid-template-columns: 1fr;
    }
    
    .tour-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 300px;
        max-height: 100vh;
        z-index: 1000;
        border-radius: 0 20px 20px 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    }

    .tour-sidebar.mobile-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .tour-sidebar.collapsed {
        transform: translateX(-100%);
        width: 300px;
        opacity: 1;
    }

    .sidebar-open-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }

    .sidebar-backdrop.visible {
        display: block;
    }
    
    .tour-viewer {
        min-height: 500px;
    }
    
    .panorama-container {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .tour-section {
        padding: 20px 0 40px;
    }
    
    .tour-container {
        padding: 0 12px;
        gap: 16px;
    }
    
    .tour-viewer {
        min-height: 400px;
        border-radius: 16px;
    }
    
    .panorama-container {
        min-height: 400px;
    }
    
    .location-overlay {
        bottom: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
        padding: 16px 20px;
    }
    
    .location-overlay h3 {
        font-size: 18px;
    }
    
    .viewer-controls {
        top: 16px;
        right: 16px;
    }
    
    .viewer-controls button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .instruction-grid {
        gap: 20px;
    }
    
    .instruction-card {
        padding: 28px 20px;
    }
}

/* ---- Navigation Controls (Bottom-right overlay) ---- */
.nav-controls-360 {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.nav-controls-row {
    display: flex;
    gap: 8px;
}

.nav-ctrl-btn {
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border-radius: 14px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.nav-ctrl-btn:hover {
    background: rgba(102, 126, 234, 0.8);
    transform: scale(1.08);
}

.nav-ctrl-btn:active {
    transform: scale(0.95);
    background: rgba(102, 126, 234, 0.95);
}

.nav-ctrl-sm {
    width: 42px;
    height: 42px;
    font-size: 16px;
    border-radius: 10px;
}

.nav-controls-secondary {
    gap: 6px;
}

/* Mobile responsive nav controls */
@media (max-width: 768px) {
    .nav-controls-360 {
        bottom: 16px;
        right: 16px;
        gap: 6px;
    }

    .nav-ctrl-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 12px;
    }

    .nav-ctrl-sm {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .nav-controls-360 {
        bottom: 12px;
        right: 12px;
    }

    .nav-ctrl-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .nav-ctrl-sm {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* ---- Print Styles ---- */
@media print {
    .tour-sidebar,
    .viewer-controls,
    .loading-overlay,
    .nav-controls-360 {
        display: none !important;
    }
    
    .tour-container {
        display: block;
    }
}
