/* =====================================================
   SCHOOL VIRTUAL TOUR - STYLES
   ===================================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #22d3ee;
    --accent-light: #67e8f9;
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --font-family: 'Prompt', sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* =====================================================
   LANDING PAGE
   ===================================================== */

.landing-container {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    bottom: 10%;
    left: -50px;
    animation-delay: -7s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-light));
    top: 50%;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    75% {
        transform: translate(20px, 10px) rotate(3deg);
    }
}

/* Content */
.content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.title {
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.title-main {
    display: block;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 3rem;
}

/* CTA Button */
.cta-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    font-family: var(--font-family);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 100px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow:
        0 10px 40px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cta-button:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-icon {
    font-size: 1rem;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover .btn-shine {
    left: 100%;
}

/* Locations Section */
.locations-section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Location Card */
.location-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.location-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}

.location-card:hover::before {
    opacity: 1;
}

.location-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.125rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 500;
}

.card-status {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-status.available {
    color: var(--accent);
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =====================================================
   VIEWER PAGE
   ===================================================== */

.viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--bg-glass);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

/* Viewer Header */
.viewer-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    z-index: 10;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
}

.room-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    padding: 0.75rem 2rem;
    border-radius: 100px;
    border: 1px solid var(--border-glass);
}

.room-counter {
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Navigation Controls */
.nav-controls {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Instructions Panel */
.instructions {
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.5s ease;
}

.instructions.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 50%) scale(1);
    }
}

.instruction-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.instruction-icon {
    font-size: 1.5rem;
}

.instruction-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.close-instructions {
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 100px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-instructions:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* Move Indicator */
.move-indicator {
    position: fixed;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.move-indicator.visible {
    opacity: 1;
}

.indicator-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: pulse 1s ease-out infinite;
}

.indicator-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Cursor Styles */
.cursor-move {
    cursor: crosshair !important;
}

/* =====================================================
   RESPONSIVE & MOBILE OPTIMIZATIONS
   ===================================================== */

/* Desktop/Mobile instruction visibility */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Prevent text selection on touch */
.viewer-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
}

/* Safe area padding for notched phones */
.viewer-header {
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
}

.nav-controls {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .title-line {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .locations-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Show mobile instructions, hide desktop */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .viewer-header {
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }

    .back-button span:last-child {
        display: none;
    }

    .back-button {
        min-width: 48px;
        min-height: 48px;
        justify-content: center;
    }

    .room-title {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .room-counter {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Larger touch-friendly navigation buttons */
    .nav-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        min-width: 48px;
        min-height: 48px;
    }

    .nav-controls {
        gap: 1.5rem;
        bottom: 1.5rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    .instructions {
        width: calc(100% - 2rem);
        max-width: 350px;
        padding: 1.5rem;
    }

    .instruction-card {
        padding: 0.75rem;
    }

    .instruction-icon {
        font-size: 1.25rem;
    }

    .instruction-text {
        font-size: 0.9rem;
    }

    .close-instructions {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Location cards touch-friendly */
    .location-card {
        padding: 1.25rem;
        min-height: 80px;
    }

    .card-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .room-title {
        max-width: 100px;
        font-size: 0.9rem;
    }

    .nav-btn {
        width: 54px;
        height: 54px;
    }

    .instructions {
        padding: 1rem;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .viewer-header {
        padding: 0.5rem 1rem;
    }

    .room-title {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .nav-controls {
        bottom: 0.75rem;
    }

    .nav-btn {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .instructions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90%;
        padding: 1rem;
        gap: 0.5rem;
    }

    .instruction-card {
        flex: 0 0 auto;
    }

    .close-instructions {
        flex: 0 0 100%;
    }
}