/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F47A59;
    --primary-hover: #E66A49;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --bg-light: #F9FAFB;
    --border-gray: #E5E7EB;
    --white: #FFFFFF;
    --black: #000000;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    background-image: url('../images/tour360-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    z-index: 0;
    pointer-events: none;
}

html {
    scroll-behavior: smooth;
}

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F47A59 0%, #F79E85 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen:not(.active) {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 140px;
    height: auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    opacity: 0;
    transition: opacity 0.6s ease;
    position: relative;
    z-index: 1;
}

.main-content.visible {
    opacity: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==================== HEADER ==================== */
.header {
    background: var(--white);
    padding: 2rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-centered {
    height: 50px;
    width: auto;
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: transparent;
    padding: 2rem 0 1.5rem;
    text-align: center;
}

.hero-pretitle {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-pretitle .highlight {
    color: var(--primary-color);
    font-style: italic;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== SPACES GRID ==================== */
.spaces {
    padding: 1.5rem 0 4rem;
}

.spaces-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.space-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border-gray);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.space-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #F79E85);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.space-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(244, 122, 89, 0.15);
    border-color: var(--primary-color);
}

.space-card:hover::before {
    transform: scaleX(1);
}

.space-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), #F79E85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.space-card:hover .space-icon {
    transform: scale(1.1) rotate(5deg);
}

.space-icon svg {
    width: 26px;
    height: 26px;
    color: var(--white);
    stroke-width: 2px;
}

.space-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.space-desc {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.space-button {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.space-card:hover .space-button {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #F79E85;
    text-decoration: underline;
}

/* ==================== VIEWER PAGE ==================== */
.viewer-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--black);
}

#panorama {
    width: 100vw;
    height: 100vh;
}

.back-button-centered {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 3rem;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.back-button-centered:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(244, 122, 89, 0.3);
    transform: translateX(-50%) translateY(-2px);
}

/* ==================== GYROSCOPE BUTTON ==================== */
.gyro-button {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border: 2px solid transparent;
    border-radius: 3rem;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gyro-button:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(244, 122, 89, 0.3);
    transform: translateX(-50%) translateY(-2px);
}

.gyro-button.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(244, 122, 89, 0.4);
}

.gyro-button svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.gyro-button.active svg {
    animation: gyro-spin 2s linear infinite;
}

@keyframes gyro-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==================== PANNELLUM CUSTOMIZATION ==================== */
.pnlm-container {
    font-family: 'Lato', sans-serif !important;
}

/* Ocultar TODOS los controles de Pannellum */
.pnlm-controls-container,
.pnlm-controls,
.pnlm-zoom-controls,
.pnlm-zoom-in,
.pnlm-zoom-out,
.pnlm-fullscreen-toggle-button,
.pnlm-fullscreen-toggle-button-inactive,
.pnlm-fullscreen-toggle-button-active,
.pnlm-compass,
.pnlm-panorama-info,
.pnlm-load-button,
.pnlm-hot-spot-debug-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .header-logo-centered {
        height: 40px;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-pretitle {
        font-size: 0.9375rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .spaces {
        padding: 1.5rem 0 3rem;
    }

    .spaces-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .space-card {
        padding: 1.5rem 1.25rem;
    }

    .back-button-centered {
        top: 1rem;
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .gyro-button {
        bottom: 1.5rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .header-logo-centered {
        height: 32px;
    }

    .spaces-grid {
        grid-template-columns: 1fr;
    }

    .space-icon {
        width: 50px;
        height: 50px;
    }

    .space-icon svg {
        width: 26px;
        height: 26px;
    }

    .space-title {
        font-size: 1.125rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
.space-card:focus-visible,
.back-button:focus-visible,
.footer-link:focus-visible,
.gyro-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}
