/*
Theme Name: Álvaro Maureira Tech V3
Theme URI: https://alvaromaureira.cl
Author: Álvaro Maureira AI Team
Author URI: https://alvaromaureira.cl
Description: Tema tecnológico premium con identidad corporativa Magenta-Cyan, animaciones 3D y optimización UX/UI.
Version: 3.1
License: Private
*/

:root {
    /* Brand Colors */
    --brand-magenta: #FF006E;
    --brand-cyan: #00D4FF;
    --brand-black: #050505;
    --brand-dark: #0a0a0a;
    --brand-panel: rgba(20, 20, 20, 0.7);

    /* Gradients */
    --brand-gradient: linear-gradient(135deg, var(--brand-magenta) 0%, var(--brand-cyan) 100%);
    --brand-gradient-text: -webkit-linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
    --glass-gradient: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

    /* Effects */
    --neon-glow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 40px rgba(255, 0, 110, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --container-width: 1200px;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Ensure HTML handles the deep background so body can be transparent */
html {
    background-color: #050505;
}

body {
    background-color: transparent !important;
    /* FORCE TRANSPARENCY */
    color: #e0e0e0;
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind content (z-index 1) but above HTML background */
    opacity: 1;
    pointer-events: none;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px var(--brand-magenta);
    }

    50% {
        box-shadow: 0 0 20px var(--brand-magenta), 0 0 10px var(--brand-cyan);
    }

    100% {
        box-shadow: 0 0 5px var(--brand-magenta);
    }
}

/* Apply Animations */
h1,
h2,
h3,
p,
.btn,
.card,
.wp-block-image,
.wp-block-columns,
.wp-block-group {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

h1 {
    animation-delay: 0.1s;
}

p {
    animation-delay: 0.3s;
}

.btn {
    animation-delay: 0.5s;
}

.card {
    animation-delay: 0.2s;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1.2rem;
    line-height: 1.1;
    color: #fff;
}

h1.gradient-text,
h2.gradient-text,
.gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    letter-spacing: -2px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1.5rem;
    color: #aaa;
    font-size: 1.1rem;
}

a {
    color: var(--brand-cyan);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--brand-magenta);
    text-shadow: 0 0 15px var(--brand-magenta);
}

/* --- Layout & Alignment --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Default Content Constraint for Standard Blocks */
.entry-content>* {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Full Width & Wide Alignment */
.entry-content>.alignwide {
    max-width: 1400px;
}

.entry-content>.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    padding: 0;
}

/* Ensure images in full width don't break */
.alignfull img {
    width: 100%;
    height: auto;
    display: block;
}

section {
    padding: 100px 0;
    position: relative;
}

/* --- Icon Color Enforcement --- */
/* STRICT ENFORCEMENT */
i,
svg,
.dashicons,
.fa,
.fas,
.fab,
.far,
.wp-block-social-links a,
.wp-block-file__button,
.wp-element-button {
    color: var(--brand-cyan) !important;
    fill: var(--brand-cyan) !important;
    transition: 0.3s ease;
}

i:hover,
svg:hover,
.wp-block-social-links a:hover {
    color: var(--brand-magenta) !important;
    fill: var(--brand-magenta) !important;
    filter: drop-shadow(0 0 8px var(--brand-magenta));
    transform: scale(1.1);
}

/* Prevent Red/Yellow/Green */
.has-vivid-red-color,
.has-pale-pink-color,
.has-vivid-green-cyan-color {
    color: var(--brand-magenta) !important;
}

.has-luminous-vivid-orange-color,
.has-luminous-vivid-amber-color {
    color: var(--brand-cyan) !important;
}

/* Backgrounds */
.has-vivid-red-background-color {
    background-color: var(--brand-magenta) !important;
}

/* --- Components --- */

/* Premium Buttons & Block Buttons */
.btn,
.wp-block-button__link {
    display: inline-block;
    padding: 16px 40px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff !important;
    background: transparent !important;
    /* Remove black background */
    background-color: transparent !important;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    cursor: pointer;
    text-decoration: none;
}

.btn::before,
.wp-block-button__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-gradient);
    z-index: -1;
    transform: scaleX(0);
    /* Start hidden */
    transform-origin: right;
    transition: transform 0.4s ease;
}

/* Default state: Border only, transparent bg */
/* Hover state: Gradient fill */

.btn:hover,
.wp-block-button__link:hover {
    border-color: transparent;
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
    color: #fff !important;
    background: transparent !important;
}

.btn:hover::before,
.wp-block-button__link:hover::before {
    transform: scaleX(1);
    /* Fill on hover */
    transform-origin: left;
}

/* Filled Button Variant (if needed) */
.is-style-fill .wp-block-button__link {
    background: var(--brand-gradient) !important;
    border: none;
}

.is-style-fill .wp-block-button__link::before {
    display: none;
}

.btn-primary {
    background: var(--brand-gradient);
    border: none;
}

/* Glass Cards */
.card {
    background: var(--brand-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: 0.4s;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--brand-cyan);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.card:hover::after {
    opacity: 1;
}

/* --- Header --- */
.site-header {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: 0.3s;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    color: var(--brand-cyan);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

.main-navigation a {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--brand-gradient);
    transition: 0.3s;
}

.main-navigation a:hover::after {
    width: 100%;
}

/* --- Dropdown Submenus --- */
.main-navigation li {
    position: relative;
}

.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 220px;
    z-index: 1001;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.main-navigation li:hover>.sub-menu {
    display: flex;
}

.main-navigation .sub-menu li {
    width: 100%;
}

.main-navigation .sub-menu a {
    padding: 10px 20px;
    display: block;
    white-space: nowrap;
    font-size: 0.85rem;
}

.main-navigation .sub-menu a:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Nested submenus open to the right */
.main-navigation .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* --- Brain 3D Section Overrides (prevent fadeInUp hiding) --- */
.brain-3d-section h2,
.brain-3d-section h3,
.brain-3d-section p,
.brain-3d-section .brain-title,
.brain-3d-section .brain-subtitle,
.brain-overlay-text h2,
.brain-overlay-text p {
    animation: none !important;
    opacity: 1 !important;
    color: #fff;
}

.brain-3d-section .brain-title {
    color: #fff !important;
    text-shadow: 0 0 40px rgba(0, 242, 255, 0.8) !important;
}

.brain-3d-section .brain-subtitle {
    color: #ccc !important;
}

/* Reduce dead space between front-page content and brain section */
.site-main+.brain-3d-section,
#primary+.brain-3d-section {
    margin-top: -60px;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    color: var(--brand-cyan);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    display: block;
    font-weight: 700;
}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Tech Stack Strip --- */
.tech-stack {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
    opacity: 0.7;
}

.tech-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
}

/* --- Timeline / Authority --- */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-cyan);
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Podcast & Blog --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* --- Footer --- */
.site-footer {
    background: #020202;
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    margin-bottom: 60px;
}

.footer-widget h4 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    font-size: 0.9rem;
    color: #555;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-navigation {
        display: none;
    }

    h1 {
        font-size: 3rem;
    }

    .hero {
        padding-top: 120px;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .row {
        flex-direction: column;
    }
}

/* --- Newsletter Section --- */
.newsletter-section {
    padding: 80px 0;
    position: relative;
    z-index: 10;
}

.newsletter-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    background: rgba(10, 10, 10, 0.8);
    /* Darker background for contrast */
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.newsletter-content {
    flex: 1;
}

.form-group input {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-cyan);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.newsletter-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
}

.newsletter-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    position: relative;
    animation: pulseGlow 3s infinite;
}

.tech-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 0, 110, 0.5);
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.form-message {
    font-size: 0.9rem;
    margin-top: 10px;
    min-height: 20px;
}

.form-message.success {
    color: var(--brand-cyan);
}

.form-message.error {
    color: var(--brand-magenta);
}

@media (max-width: 768px) {
    .newsletter-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .newsletter-form {
        margin: 2rem auto 0;
    }

    .newsletter-visual {
        display: none;
    }
}
/* === Header CTA Button === */
.header-cta-btn:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
    transform: translateY(-1px);
}
@media (max-width: 768px) {
    .header-cta-wrap { display: none !important; }
}
/* === Desktop Dropdown Fix === */
.desktop-nav .cyber-menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; }
.desktop-nav .cyber-menu > li { position: relative; list-style: none; }
.desktop-nav .cyber-menu > li > a { text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; }

/* === DROPDOWN FIX: Override .main-navigation .sub-menu conflict === */
.main-navigation .cyber-menu .sub-menu,
.desktop-nav .cyber-menu .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 280px;
    background: rgba(2, 6, 23, 0.98) !important;
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 12px;
    padding: 12px 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(34,211,238,0.1);
    backdrop-filter: blur(20px);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none !important;
    flex-direction: column !important;
}
.main-navigation .cyber-menu .menu-item-has-children:hover > .sub-menu,
.desktop-nav .cyber-menu .menu-item-has-children:hover > .sub-menu,
.cyber-menu .menu-item-has-children:hover > .sub-menu {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}
.cyber-menu .sub-menu li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.cyber-menu .sub-menu a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 20px !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: all 0.2s ease;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.cyber-menu .sub-menu a:hover {
    background: rgba(34, 211, 238, 0.1) !important;
    color: #22d3ee !important;
    padding-left: 24px !important;
}
.cyber-menu .sub-menu a i {
    color: #22d3ee;
    width: 20px;
    text-align: center;
}
.cyber-menu .sub-menu .dropdown-header {
    padding: 8px 20px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    color: #22d3ee !important;
    font-weight: 600;
    border-bottom: 1px solid rgba(34,211,238,0.1);
    margin-bottom: 4px;
    pointer-events: none;
}
/* Ensure parent li is position relative */
.cyber-menu > li.menu-item-has-children {
    position: relative !important;
}
.cyber-menu .dropdown-arrow {
    font-size: 10px !important;
    margin-left: 4px;
    transition: transform 0.3s ease;
}
.cyber-menu .menu-item-has-children:hover .dropdown-arrow {
    transform: rotate(180deg);
}
