/* Font display: swap ensures text remains visible during webfont load */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-display: swap;
    src: local('Plus Jakarta Sans');
}

:root {
    --magenta: #ff12ff;
    --magenta-dark: #cc00cc;
}


html,
body {
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid #ff12ff;
    outline-offset: 4px;
}


.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
    background: linear-gradient(135deg, #ff12ff, #7e22ce, #ff6b00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-cyber {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-cyber:hover::before {
    left: 100%;
}

details[open] summary svg {
    transform: rotate(180deg);
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link.active {
    color: #ffffff !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff12ff;
    box-shadow: 0 0 10px #ff12ff;
}

/* Slider Styles */
.slider-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #0a0a0a;
    /* Diagnostic background */
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 2;
}

.tagline {
    text-shadow: 0 0 20px rgba(255, 18, 255, 0.3);
}

/* Reveal Animations */
.reveal-up {
    transform: translateY(30px);
}

.reveal-left {
    transform: translateX(-30px);
}

.reveal-right {
    transform: translateX(30px);
}

.reveal-scale {
    transform: scale(0.9);
}

.reveal-blur {
    filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
}

.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale,
.reveal-blur {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.revealed {
    opacity: 1 !important;
    transform: translate(0, 0) scale(1) !important;
    filter: blur(0) !important;
    pointer-events: auto !important;
}

.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

/* Form Styling */
.form-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--magenta);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 18, 255, 0.1);
}

.iti {
    width: 100%;
}

.iti__country-list {
    background-color: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.iti__country:hover,
.iti__country.iti__highlight {
    background-color: rgba(255, 18, 255, 0.1);
}

.iti__search-input {
    background-color: #1a1a1a !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 8px !important;
    margin: 4px !important;
    border-radius: 6px !important;
    width: calc(100% - 8px) !important;
    box-sizing: border-box !important;
}

#form-status {
    display: none;
}

/* reCAPTCHA Responsive Fix */
@media screen and (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
        -webkit-transform: scale(0.85);
        -webkit-transform-origin: 0 0;
    }
}

@media screen and (max-width: 340px) {
    .g-recaptcha {
        transform: scale(0.75);
        -webkit-transform: scale(0.75);
    }
}

/* Emergency Spacing Fix for Nosotros Grid */
.nosotros-grid-forced {
    gap: 120px !important;
}

@media (min-width: 768px) {
    .nosotros-grid-forced {
        gap: 60px !important;
    }
}

/* Nav scroll offset */
section[id],
footer[id] {
    scroll-margin-top: 100px;
}

#home {
    isolation: isolate;
}

/* Back to top button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: #ff12ff;
    box-shadow: 0 0 20px rgba(255, 18, 255, 0.4);
    transform: translateY(-5px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 18, 255, 0.3) transparent;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container::-webkit-scrollbar {
    width: 6px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: rgba(255, 18, 255, 0.3);
    border-radius: 10px;
}

body.modal-open {
    overflow: hidden;
}

/* Cookie Banner Styles */
#cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(150%);
    transform: translateX(-50%) translateY(150%);
    width: 90%;
    max-width: 500px;
    z-index: 2000;
    -webkit-transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

#cookie-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-glass {
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Performance optimization: Content visibility */
.section-auto-render {
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

/* Language Switcher */
.lang-btn {
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
}

.lang-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

.lang-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.lang-btn.active svg {
    filter: grayscale(0);
    border: 1px solid rgba(255, 18, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 18, 255, 0.3);
}

.lang-btn svg {
    display: block;
    filter: grayscale(0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Espaciados Forzados (Fix: Secciones Pegadas) */
section:not(#home),
footer {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    section:not(#home) {
        padding-top: 100px !important;
        padding-bottom: 100px !important;
    }
}

footer#contacto {
    padding-top: 0 !important;
}

#contacto .max-w-7xl {
    padding-top: 60px !important;
}

@media (min-width: 768px) {
    #contacto .max-w-7xl {
        padding-top: 100px !important;
    }
}

/* AI Chatbot Styles - Widget Refinement */
.chatbot-bubble {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-glass 3s infinite;
}

.chatbot-bubble:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 0, 255, 0.3);
    border-color: rgba(255, 18, 255, 0.5);
}

@keyframes pulse-glass {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.bubble-content {
    position: relative;
    z-index: 2;
}

.notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    border: 3px solid var(--magenta);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.chatbot-container {
    position: fixed;
    bottom: 2rem;
    /* Aligned with bottom button */
    right: calc(2rem + 60px + 1rem);
    /* To the left of the buttons */
    width: 340px;
    height: 500px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    border-radius: 1.5rem;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 0, 255, 0.1);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-container.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.9) translateX(20px);
    pointer-events: none;
}

.chatbot-container:not(.hidden) {
    display: flex;
    animation: slideUpChat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpChat {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, var(--magenta) 0%, #700070 100%);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-avatar-container {
    width: 42px !important;
    height: 42px !important;
    aspect-ratio: 1/1 !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    flex-shrink: 0 !important;
    border-radius: 50%;
    overflow: hidden;
}

.chatbot-avatar-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
}

.chatbot-header h4 {
    margin-bottom: 2px;
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Better gap */
    scrollbar-width: thin;
    scrollbar-color: var(--magenta) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--magenta);
    border-radius: 10px;
}

.chat-message-animate {
    animation: messageIn 0.3s ease-out forwards;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1.2rem;
    font-size: 0.85rem;
    max-width: 85%;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.bot-message {
    align-self: flex-start;
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    border-bottom-left-radius: 0.3rem;
    white-space: pre-line;
}

.user-message {
    align-self: flex-end;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.user-message .message-content {
    background: var(--magenta);
    color: white;
    font-weight: 500;
    border-bottom-right-radius: 0.3rem;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.2);
}

.chatbot-input-area {
    background: rgba(20, 20, 20, 1);
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#chat-input {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    color: white;
    outline: none;
    width: 100%;
}

#chat-input:focus {
    border-color: var(--magenta);
}

/* Typing Indicator */
.typing-dots {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    height: 12px !important;
    padding: 2px 0;
}

.typing-dots span {
    width: 6px !important;
    height: 6px !important;
    background-color: #ff12ff !important;
    /* Direct fallback */
    background-color: var(--magenta) !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: typing-bounce 1.4s infinite ease-in-out both !important;
    box-shadow: 0 0 5px rgba(255, 18, 255, 0.5) !important;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s !important;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s !important;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0s !important;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.3);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 2rem);
        height: 60vh;
        bottom: 5.5rem;
        right: 1rem;
    }
}
