/*
Theme Name: Archivo Mapuche
Template: twentytwentyfour
Version: 1.0
Description: Tema inmersivo para archivo de cosmovisiones mapuche
*/

/* ============================================
   RESET Y ESTRUCTURA BASE
   ============================================ */
body.page-template-front-page-php {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #0a0a0a !important;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
}

/* Ocultar elementos de WordPress en la homepage */
body.page-template-front-page-php header,
body.page-template-front-page-php footer,
body.page-template-front-page-php .wp-site-blocks,
body.page-template-front-page-php main:not(.kultrun-container) {
    display: none !important;
}

/* ============================================
   KULTRUN INTERACTIVO
   ============================================ */
.kultrun-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%) !important;
    z-index: 9999 !important;
    overflow: hidden !important;
}

.kultrun-circle {
    width: 600px !important;
    height: 600px !important;
    border-radius: 50% !important;
    background-image: url('assets/images/kultrun.png') !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: #000000 !important;
    border: 4px solid #D2691E !important;
    box-shadow: 
        0 0 100px rgba(210, 105, 30, 0.6),
        0 0 200px rgba(210, 105, 30, 0.3),
        inset 0 0 80px rgba(0, 0, 0, 0.8) !important;
    position: relative !important;
    animation: pulse 10s infinite alternate !important;
    transition: transform 0.5s ease !important;
}

.kultrun-circle:hover {
    transform: scale(1.02) !important;
}

@keyframes pulse {
    0% { 
        box-shadow: 
            0 0 60px rgba(210, 105, 30, 0.3),
            inset 0 0 40px rgba(0, 0, 0, 0.5) !important;
    }
    100% { 
        box-shadow: 
            0 0 80px rgba(210, 105, 30, 0.5),
            0 0 120px rgba(46, 139, 87, 0.2),
            inset 0 0 50px rgba(0, 0, 0, 0.7) !important;
    }
}

/* ============================================
   4 BOTONES CARDINALES CORREGIDOS
   ============================================ */
.sensitive-zone {
    position: absolute !important;
    width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%) !important;
    cursor: pointer !important;
    opacity: 0.9 !important;
    transition: all 0.3s ease !important;
    z-index: 20 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    border: 3px solid rgba(210, 105, 30, 0.7) !important;
    background: rgba(26, 26, 26, 0.85) !important;
    box-shadow: 
        0 0 30px rgba(210, 105, 30, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

.sensitive-zone:hover {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
    border-color: #2E8B57 !important;
    box-shadow: 
        0 0 50px rgba(46, 139, 87, 0.7),
        0 0 80px rgba(46, 139, 87, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.7) !important;
}

/* POSICIONES CARDINALES CORRECTAS - SOBRE LA LÍNEA EXTERIOR */
.zone-norte {
    top: calc(50% - 300px + 50px) !important; /* 300px = radio del kultrun, 50px = mitad del botón */
    left: 50% !important;
}

.zone-sur {
    top: calc(50% + 300px - 50px) !important;
    left: 50% !important;
}

.zone-este {
    top: 50% !important;
    left: calc(50% + 300px - 50px) !important;
}

.zone-oeste {
    top: 50% !important;
    left: calc(50% - 300px + 50px) !important;
}

/* Labels de los botones */
.zone-label {
    color: #F5F5F5 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-align: center !important;
    margin-top: 5px !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8) !important;
    opacity: 0.9 !important;
}

/* Indicador interior (círculo pequeño) */
.zone-hint {
    width: 60% !important;
    height: 60% !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, 
        rgba(210, 105, 30, 0.4) 0%, 
        rgba(139, 69, 19, 0.2) 70%,
        transparent 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    animation: pulsar-boton 3s infinite alternate !important;
}

@keyframes pulsar-boton {
    0% { 
        transform: scale(1); 
        opacity: 0.7; 
    }
    100% { 
        transform: scale(1.1); 
        opacity: 1; 
        border-color: rgba(46, 139, 87, 0.6);
    }
}

/* Botón activo (descubierto) */
.sensitive-zone.active {
    opacity: 1 !important;
    border-color: #2E8B57 !important;
    background: rgba(30, 60, 40, 0.85) !important;
}

.sensitive-zone.active .zone-hint {
    background: radial-gradient(circle, 
        rgba(46, 139, 87, 0.6) 0%, 
        rgba(46, 139, 87, 0.3) 70%,
        transparent 100%) !important;
    animation: activo-pulsar 2s infinite !important;
}

@keyframes activo-pulsar {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(46, 139, 87, 0.5); 
    }
    50% { 
        box-shadow: 0 0 40px rgba(46, 139, 87, 0.8); 
    }
}

/* ============================================
   CENTRO DEL KULTRUN
   ============================================ */
.kultrun-center {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 120px !important;
    height: 120px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, #D2691E 0%, #8B4513 100%) !important;
    border: 3px solid #F5F5F5 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 5 !important;
}

.kultrun-center:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    background: radial-gradient(circle, #2E8B57 0%, #1A1A1A 100%) !important;
}

.kultrun-center span {
    color: #F5F5F5 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    text-align: center !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8) !important;
}

/* ============================================
   PANEL DE CONTENIDO
   ============================================ */
.content-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    width: 80% !important;
    max-width: 800px !important;
    height: 70vh !important;
    background: rgba(26, 26, 26, 0.95) !important;
    border: 2px solid #D2691E !important;
    border-radius: 20px !important;
    padding: 30px !important;
    z-index: 1000 !important;
    transition: transform 0.5s ease !important;
    box-shadow: 0 0 50px rgba(0,0,0,0.8) !important;
}

.content-panel.active {
    transform: translate(-50%, -50%) scale(1) !important;
}

.close-panel {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: #D2691E !important;
    color: white !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

/* ============================================
   CONTROLES
   ============================================ */
.controls {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    display: flex !important;
    gap: 15px !important;
    z-index: 10000 !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

.controls button {
    background: rgba(210, 105, 30, 0.8) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    min-width: 80px !important;
    transition: all 0.3s ease !important;
}

.controls button:hover {
    transform: scale(1.05) !important;
}

.controls .control-btn {
    background: rgba(70, 130, 180, 0.8) !important;
}

.controls .control-btn.desactivado {
    background: rgba(210, 105, 30, 0.8) !important;
}

.controls .clima-controls {
    display: flex !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.controls .control-clima {
    background: rgba(46, 139, 87, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 8px 15px !important;
    font-size: 12px !important;
    min-width: 70px !important;
}

.controls .control-clima:hover {
    background: rgba(46, 139, 87, 1) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.4) !important;
}

.controls .control-clima.desactivado {
    background: rgba(210, 105, 30, 0.8) !important;
}

.controls .control-clima.desactivado:hover {
    background: rgba(210, 105, 30, 1) !important;
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.4) !important;
}

/* ============================================
   CONTADOR DE DESCUBRIMIENTO
   ============================================ */
.discovery-counter {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    border: 1px solid rgba(210, 105, 30, 0.5) !important;
    z-index: 10000 !important;
}

/* ============================================
   SISTEMA CLIMÁTICO
   ============================================ */
#weather-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none !important;
    z-index: 5 !important;
    opacity: 0 !important;
    transition: opacity 1s ease !important;
    display: block !important;
}

#clima-indicador {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    border: 2px solid rgba(210, 105, 30, 0.7) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#clima-indicador:hover {
    background: rgba(0, 0, 0, 0.95) !important;
    transform: scale(1.05) !important;
    border-color: rgba(46, 139, 87, 0.8) !important;
}

#luna {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    font-size: 28px !important;
    z-index: 10000 !important;
    opacity: 0.7 !important;
    filter: drop-shadow(0 0 15px rgba(255,255,200,0.4)) !important;
    animation: flotar-luna 10s infinite alternate ease-in-out !important;
    cursor: pointer !important;
}

@keyframes flotar-luna {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(5deg); }
}

/* Efectos climáticos */
.lluvia-activa #weather-canvas {
    opacity: 0.6 !important;
}

.nieve-activa #weather-canvas {
    opacity: 0.5 !important;
}

/* Temperaturas */
body.temp-frio {
    background: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 100%) !important;
}

body.temp-fresco {
    background: linear-gradient(135deg, #1a3c40 0%, #2d5d5b 100%) !important;
}

body.temp-templado {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

body.temp-calido {
    background: linear-gradient(135deg, #3d2c2e 0%, #5d4037 100%) !important;
}

body.temp-calor {
    background: linear-gradient(135deg, #4a2c2a 0%, #7b3f3f 100%) !important;
}

/* ============================================
   VIDEO PLAYER EN PANEL
   ============================================ */
#panel-content video {
    width: 100% !important;
    max-height: 400px !important;
    border-radius: 10px !important;
    background: #000 !important;
    margin: 20px 0 !important;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 20px 0;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   AUDIO PLAYER EN PANEL
   ============================================ */
.audio-player {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid rgba(210, 105, 30, 0.5);
}

.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.audio-controls button {
    background: rgba(210, 105, 30, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.audio-controls button:hover {
    background: rgba(210, 105, 30, 1);
    transform: scale(1.1);
}

/* ============================================
   CONTENIDO DEL PANEL
   ============================================ */
#panel-content {
    color: #F5F5F5;
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

#panel-content h2 {
    color: #D2691E;
    margin-bottom: 10px;
    border-bottom: 2px solid rgba(210, 105, 30, 0.3);
    padding-bottom: 10px;
}

#panel-content h3 {
    color: rgba(210, 105, 30, 0.8);
    margin-bottom: 20px;
}

#panel-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ============================================
   CONTROLES DE AUDIO AMBIENTAL
   ============================================ */
#sound-toggle {
    background: rgba(70, 130, 180, 0.8) !important;
}

#sound-toggle.muted {
    background: rgba(210, 105, 30, 0.8) !important;
}

/* ============================================
   MÓVIL
   ============================================ */
@media (max-width: 768px) {
    .kultrun-circle {
        width: 95vw !important;
        height: 95vw !important;
        max-width: 500px !important;
        max-height: 500px !important;
    }
    
    .sensitive-zone {
        width: 80px !important;
        height: 80px !important;
    }
    
    .zone-label {
        font-size: 11px !important;
    }
    
    /* Ajustar posiciones para móvil */
    .zone-norte {
        top: calc(50% - 47.5vw + 40px) !important;
    }
    
    .zone-sur {
        top: calc(50% + 47.5vw - 40px) !important;
    }
    
    .zone-este {
        left: calc(50% + 47.5vw - 40px) !important;
    }
    
    .zone-oeste {
        left: calc(50% - 47.5vw + 40px) !important;
    }
    
    .content-panel {
        width: 95% !important;
        height: 80vh !important;
        padding: 20px !important;
    }
    
    .controls {
        bottom: 15px !important;
        right: 15px !important;
        gap: 10px !important;
    }
    
    .controls button {
        padding: 8px 16px !important;
        min-width: 70px !important;
        font-size: 11px !important;
    }
    
    .kultrun-center {
        width: 100px !important;
        height: 100px !important;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 8px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .clima-controls {
        order: -1 !important;
        width: 100% !important;
        justify-content: flex-end !important;
    }
    
    .controls button {
        min-width: 100px !important;
        padding: 6px 12px !important;
        font-size: 10px !important;
    }
    
    .sensitive-zone {
        width: 70px !important;
        height: 70px !important;
    }
    
    .zone-label {
        font-size: 10px !important;
    }
    
    .kultrun-center {
        width: 80px !important;
        height: 80px !important;
    }
    
    .kultrun-center span {
        font-size: 14px !important;
    }
}