/* ======================================
   El Horizonte IA — Custom Styles
   v2.0.0 | 2026
   ====================================== */

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0A0B0F;
}
::-webkit-scrollbar-thumb {
    background: #1A1D24;
    border: 2px solid #0A0B0F;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #EAB308;
}

/* ===== LOADING SCREEN ===== */
.loader-ring {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 60px;
}
.loader-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 48px;
    height: 48px;
    margin: 6px;
    border: 3px solid #EAB308;
    border-radius: 50%;
    animation: loader-ring-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #EAB308 transparent transparent transparent;
}
.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes loader-ring-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    animation: loader-text-blink 1.5s ease-in-out infinite;
}

@keyframes loader-text-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#loader {
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ===== NAVIGATION ===== */
.nav-glass {
    background: rgba(10, 11, 15, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(234, 179, 8, 0.05);
}

.nav-glass.scrolled {
    background: rgba(10, 11, 15, 0.95);
    border-bottom-color: rgba(234, 179, 8, 0.1);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Hamburger Animation */
.hamburger-line {
    display: block;
    position: absolute;
    height: 2px;
    width: 24px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.top-line { transform: translateY(-7px); }
.mid-line { opacity: 1; }
.bot-line { transform: translateY(7px); }

.hamburger-active .top-line {
    transform: rotate(45deg) translateY(0);
}
.hamburger-active .mid-line {
    opacity: 0;
}
.hamburger-active .bot-line {
    transform: rotate(-45deg) translateY(0);
}

/* ===== BUTTONS ===== */
.btn-cyber {
    background: #EAB308;
    color: #000;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cyber::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-cyber:hover {
    background: #FACC15;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -5px rgba(234, 179, 8, 0.4);
}

.btn-cyber:hover::before {
    opacity: 1;
}

.btn-cyber:active {
    transform: translateY(0);
}

.btn-outline {
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #E2E8F0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-outline:hover {
    border-color: #EAB308;
    color: #EAB308;
    background: rgba(234, 179, 8, 0.05);
    transform: translateY(-2px);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, #EAB308, #FACC15, #F59E0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(270deg, #EAB308, #FACC15, #F59E0B, #EAB308);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== FLOATING ANIMATIONS ===== */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float-slow-reverse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 25px) scale(0.95); }
    66% { transform: translate(35px, -15px) scale(1.05); }
}

.animate-float-slow {
    animation: float-slow 15s ease-in-out infinite;
}

.animate-float-slow-reverse {
    animation: float-slow-reverse 18s ease-in-out infinite;
}

/* ===== BOUNCE SLOW ===== */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.animate-bounce-slow {
    animation: bounce-slow 2s ease-in-out infinite;
}

/* ===== FLOAT CARDS ===== */
.float-card {
    animation: float-card 6s ease-in-out infinite;
}

.float-card-delayed {
    animation: float-card 6s ease-in-out infinite 2s;
}

@keyframes float-card {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
    animation: fade-in-delayed 2s ease forwards;
    opacity: 0;
}

@keyframes fade-in-delayed {
    0%, 60% { opacity: 0; transform: translate(-50%, 10px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== TICKER ===== */
.ticker-wrapper {
    overflow: hidden;
    position: relative;
}

.ticker-track {
    animation: ticker-scroll 40s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== ARTICLE CARDS ===== */
.article-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px -15px rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.3);
}

/* ===== TOOL CARDS ===== */
.tool-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.3);
}

/* ===== TESTIMONIAL CARDS ===== */
.testimonial-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.3);
}

/* ===== TEAM CARDS ===== */
.team-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card:hover {
    transform: translateY(-6px);
}

/* ===== FEED ITEMS ===== */
.feed-item {
    transition: all 0.3s ease;
}

.feed-item:hover {
    transform: translateX(8px);
    background: rgba(26, 29, 36, 0.8);
}

/* ===== WAVEFORM BARS ===== */
.waveform-bar {
    height: var(--h);
    animation: waveform-pulse 1.5s ease-in-out infinite;
    animation-delay: calc(var(--h) * 0.01);
}

@keyframes waveform-pulse {
    0%, 100% { 
        height: var(--h);
        opacity: 0.6;
    }
    50% { 
        height: calc(var(--h) * 0.6);
        opacity: 1;
    }
}

/* Stagger the waveform bars */
.waveform-bar:nth-child(odd) { animation-delay: 0s; }
.waveform-bar:nth-child(2n) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3n) { animation-delay: 0.2s; }
.waveform-bar:nth-child(5n) { animation-delay: 0.3s; }
.waveform-bar:nth-child(7n) { animation-delay: 0.4s; }

/* ===== BOOK 3D EFFECT ===== */
.book-3d {
    perspective: 1200px;
}

.book-3d-inner {
    transform: rotateY(-18deg) rotateX(5deg);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-3d:hover .book-3d-inner {
    transform: rotateY(-8deg) rotateX(2deg) scale(1.05);
}

.book-front {
    box-shadow: 
        -20px 20px 60px rgba(0, 0, 0, 0.5),
        -5px 5px 20px rgba(234, 179, 8, 0.1);
    transition: box-shadow 0.6s ease;
}

.book-3d:hover .book-front {
    box-shadow: 
        -10px 10px 40px rgba(0, 0, 0, 0.4),
        -3px 3px 15px rgba(234, 179, 8, 0.2);
}

/* ===== STAT CARDS ===== */
.stat-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(26, 29, 36, 0.8);
}

/* ===== HIDE SCROLLBAR ===== */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== BACK TO TOP ===== */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ===== HERO ANIMATIONS (GSAP targets) ===== */
.hero-badge,
.hero-title,
.hero-subtitle,
.hero-cta,
.hero-social-proof,
.hero-image {
    opacity: 0;
}

/* When JS loads, these will be animated by GSAP */
.js-loaded .hero-badge,
.js-loaded .hero-title,
.js-loaded .hero-subtitle,
.js-loaded .hero-cta,
.js-loaded .hero-social-proof,
.js-loaded .hero-image {
    /* GSAP will handle the actual values */
}

/* ===== MOBILE MENU ANIMATION ===== */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.open {
    max-height: 500px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .ticker-track {
        animation-duration: 25s;
    }
    
    .book-3d-inner {
        transform: rotateY(-12deg) rotateX(3deg);
    }
    
    .waveform-bar {
        width: 2px !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem !important;
    }
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    width: 100%;
    height: 100%;
}

/* ===== SELECTION ===== */
::selection {
    background: #EAB308;
    color: #000;
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

/* ===== FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #EAB308;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .ticker-track {
        animation: none !important;
    }
    
    .waveform-bar {
        animation: none !important;
    }
}
