/* SASIGLOBAL - Global Stylesheet 2026 */

:root {
    --primary: #dc143c;
    --primary-light: #ff4d6d;
    --primary-glow: rgba(220, 20, 60, 0.08);
    --background: #ffffff;
    --surface: #ffffff;
    --on-background: #0f172a;
    --on-surface-variant: #475569;
    --outline: rgba(0, 0, 0, 0.03);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-tech: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: var(--background);
}

body {
    background-color: var(--background);
    color: var(--on-background);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* VIP Elite Background - Ultra Premium Layering */
.bg-orchestrator {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--background);
    overflow: hidden;
}

.bg-orchestrator::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(220, 20, 60, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(15, 23, 42, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(241, 245, 249, 0.4) 0%, transparent 60%);
    filter: blur(100px);
    animation: fluidMove 25s ease-in-out infinite alternate;
}

@keyframes fluidMove {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(2%, 4%) rotate(1deg) scale(1.05); }
    66% { transform: translate(-1%, 2%) rotate(-1deg) scale(0.98); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

/* Texture Overlay - Premium Paper Feel */
.bg-texture {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
}

/* Glassmorphism VIP - High-Fidelity Blurs */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-panel:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(220, 20, 60, 0.15);
    transform: translateY(-4px);
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.08),
        0 10px 20px -15px rgba(220, 20, 60, 0.1);
}

/* Scroll Reveal Animation System */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-child {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-child.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Image Card Hover — Full Color on Hover */
.group img.opacity-10 {
    filter: grayscale(100%);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover img.opacity-10 {
    opacity: 0.35 !important;
    filter: grayscale(0%);
    transform: scale(1.08);
}

/* Corporate Popup Overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 24px;
}

/* ============================================================
   MASTERPIECE SUCCESS POPUP - ELITE ARCHITECTURE
   ============================================================ */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6); /* Slate-950 con transparencia */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    padding: 2rem;
}

.popup-overlay.popup-visible {
    opacity: 1;
    visibility: visible;
}

.popup-card {
    background: #ffffff;
    width: 100%;
    max-width: 560px;
    padding: 5rem 4rem;
    position: relative;
    text-align: center;
    transform: perspective(1000px) rotateX(10deg) translateY(40px);
    opacity: 0;
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
    
    /* Sombras Multinivel Elite */
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.05),
        0 30px 60px rgba(0,0,0,0.1),
        0 0 0 1px rgba(15, 23, 42, 0.03),
        inset 0 0 0 1px rgba(255,255,255,0.5);
    
    border-radius: 2px; /* Mantener estética industrial de bordes rectos */
}

.popup-visible .popup-card {
    transform: perspective(1000px) rotateX(0deg) translateY(0);
    opacity: 1;
}

/* Sello de Verificación Elite */
.popup-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 3rem;
}

.popup-icon {
    width: 100%;
    height: 100%;
    background: #020617; /* Slate-950 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
}

.popup-icon span {
    font-size: 44px;
    color: #ffffff;
}

/* Efecto Radar de Seguridad */
.popup-icon-pulse {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary);
    opacity: 0.3;
    z-index: 1;
    animation: radarPulse 2.5s infinite cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes radarPulse {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.6); opacity: 0; }
}

.popup-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #020617;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.popup-subtitle {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.6em;
    margin-bottom: 2.5rem;
    display: block;
    opacity: 0.9;
}

.popup-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #020617, transparent);
    margin: 0 auto 3rem;
}

.popup-body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 2;
    color: #334155;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.popup-body strong {
    font-weight: 800;
    color: #020617;
}

.popup-body-sm {
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    padding: 2rem;
    margin-top: 3rem;
    line-height: 1.8;
    border-left: 3px solid var(--primary);
    text-align: left;
}

.popup-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
}

.popup-brand {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: #94a3b8;
}

.popup-brand span {
    color: var(--primary);
}

.popup-close {
    display: block;
    width: 100%;
    margin-top: 3rem;
    padding: 24px;
    background: #020617;
    color: white;
    border: none;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6em;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

.popup-close::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.6s;
}

.popup-close:hover {
    background: var(--primary);
    letter-spacing: 0.7em;
    box-shadow: 0 20px 40px rgba(220, 20, 60, 0.25);
}

.popup-close:hover::after {
    left: 100%;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* Premium Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-zoom {
    animation: heroZoom 20s infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    width: 100%;
    height: 100%;
    border: none;
    transform: scale(1.05);
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.scanline::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(220, 20, 60, 0.02) 50%, transparent);
    background-size: 100% 8px;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.3;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Custom Typography Utilities */
.text-balance {
    text-wrap: balance;
}

@supports not (text-wrap: balance) {
    .text-balance {
        word-break: break-word;
    }
}

.text-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #64748b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff4d6d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Pagination Dots (Vertical) - Premium Design */
.pagination-dots {
    position: fixed;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.dot::before {
    content: attr(data-label);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--on-background);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.dot:hover::before {
    opacity: 0.4;
    transform: translateY(-50%) translateX(-8px);
}

.dot.active {
    background: var(--primary);
    transform: scale(2);
    box-shadow: 0 0 15px var(--primary);
}

.dot.active::before {
    opacity: 1;
    transform: translateY(-50%) translateX(-12px);
    color: var(--primary);
}

/* VIP Elite Navigation - High Contrast Dark */
#main-nav {
    background: rgba(15, 23, 42, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -6px; left: 0;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* VIP Elite Footer - High Contrast Dark */
#footer {
    background: #0f172a;
    color: #ffffff;
}

#footer span, #footer a, #footer p {
    color: rgba(255, 255, 255, 0.6);
}

#footer h2, #footer h3, #footer .text-slate-900 {
    color: #ffffff !important;
}

#footer a:hover {
    color: var(--primary);
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; transform: scale(1.02) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .pagination-dots {
        display: none !important;
    }
}

/* GIS Map & Elite Popups (Final Implementation) */
#map {
    background-color: #0f172a; /* Slate 900 background while loading */
    transition: opacity 0.5s ease;
}

.elite-popup .maplibregl-popup-content {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.elite-popup .maplibregl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

/* Scroll Animations Fix for Map & Projects */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-child {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.scroll-child.visible {
    opacity: 1;
    transform: translateY(0);
}
