/* Reset and Base definitions not covered entirely by Tailwind */
:root {
    --primary-color: #00bdd6;
    --primary-hover: #00a8c0;
    --text-muted: #64748b;
    --midnight: #f8fafc;
    /* For contrast on light backgrounds */
    --font-main: 'Outfit', sans-serif;
}

* {
    scroll-behavior: smooth;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 189, 214, 0.4);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

@media (max-width: 768px) {

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* ============================================
   NAVBAR — FLOATING PILL SHAPE
   ============================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px !important;
    height: 60px;
    position: fixed;
    width: 90%;
    max-width: 1100px;
    top: 20px; /* Un poco más de aire desde el tope */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001; /* Asegurar que esté por encima de todo */
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 189, 214, 0.2);
    border-radius: 9999px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar:hover {
    border-color: rgba(0, 189, 214, 0.5);
    background: rgba(255, 255, 255, 0.95);
}

.shadow-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #424242;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ============================================
   BUTTONS — LIQUID FILL EFFECT
   ============================================ */
.btn-primary {
    padding: 12px 28px;
    background: rgba(0, 189, 214, 0.1);
    border: 1px solid rgba(0, 189, 214, 0.4);
    border-radius: 9999px;
    color: #00889c;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 300%;
    background: var(--primary-color);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%) scale(0) rotate(45deg);
    z-index: -1;
    border-radius: 40%;
}

.btn-primary:hover::after {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.btn-primary:hover {
    color: #fff !important;
    box-shadow: 0 0 20px rgba(0, 189, 214, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 12px 28px;
    background: transparent;
    border: 2px solid rgba(0, 189, 214, 0.2);
    border-radius: 9999px;
    color: rgba(66, 66, 66, 0.8);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-secondary:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(0, 189, 214, 0.05);
}

.glow-effect {
    box-shadow: 0 0 15px rgba(0, 189, 214, 0.2);
}

.glow-effect:hover {
    box-shadow: 0 0 25px rgba(0, 189, 214, 0.4);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 100px 5% 0 8%; /* Espacio para que el texto no choque con el menú */
    position: relative;
    overflow: hidden;
    background-attachment: scroll;
    background-repeat: no-repeat;
}

header {
    height: 0;
    position: relative;
    z-index: 1001;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 60%, transparent 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-title,
.hero-subtitle,
.hero-cta {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-section.hero-active .hero-overlay {
    opacity: 1;
}

.hero-section.hero-active .hero-title {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.hero-section.hero-active .hero-subtitle {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.hero-section.hero-active .hero-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.05;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #424242;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.gradient-text {
    background: linear-gradient(135deg, #00bdd6 0%, #0099b0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal-left,
.reveal-bottom,
.reveal-right {
    opacity: 0;
    filter: blur(10px);
    transition:
        opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
        filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left {
    transform: translateX(-80px) scale(0.95);
}

.reveal-bottom {
    transform: translateY(80px) scale(0.95);
}

.reveal-right {
    transform: translateX(80px) scale(0.95);
}

.reveal-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: blur(0);
}

/* Glass cards logic for sections */
.glass-card-service {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 189, 214, 0.1);
}

.glass-card-form {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 189, 214, 0.15);
    border-radius: 1.5rem;
}

/* Premium Acrylic Glassmorphism panel */
.glass-panel-premium {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 
                inset 0 2px 15px rgba(255, 255, 255, 1), 
                inset 0 -2px 15px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    height: 100%;
}

/* Premium Logo Stamp Animation Box */
.acrylic-stamp-box {
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 
                inset 0 4px 20px rgba(255, 255, 255, 1), 
                inset 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform-origin: center;
}

.stamp-logo {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
    opacity: 0;
    transform: scale(3) rotate(-15deg);
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.25));
}

/* Triggered by JS IntersectionObserver */
.acrylic-stamp-box.animate-stamp .stamp-logo {
    animation: stamp-effect 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.8s; /* Retardo para que el usuario llegue y lo vea caer */
}

/* El impacto en la caja acrílica ocurre al mismo tiempo que el sello aterriza */
.acrylic-stamp-box.animate-stamp {
    animation: box-impact 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    animation-delay: 1.35s; /* 0.8s (delay) + ~0.55s (tiempo que tarda el sello en impactar) */
}

@keyframes box-impact {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(0.96) translateY(8px); }
    60% { transform: scale(1.02) translateY(-2px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes stamp-effect {
    0% {
        opacity: 0;
        transform: scale(3) rotate(-15deg);
    }
    50% {
        opacity: 1;
        transform: scale(0.9) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================
   CHATBOT WIDGET
   ============================================ */
#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

#chatbot-container.chat-active .chat-toggle {
    display: none;
}

.chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #00bdd6;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 20px rgba(0, 189, 214, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: chat-pulse 2.5s ease-in-out infinite;
    transition: transform 0.3s;
}

.chat-toggle:hover {
    transform: scale(1.1);
    animation: none;
    box-shadow: 0 0 30px rgba(0, 189, 214, 0.6);
}

@keyframes chat-pulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 189, 214, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 189, 214, 0.7);
    }
}

.chat-widget {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 60vh;
    max-height: 700px;
    background: #ffffff;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
}

.chat-widget.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    padding: 15px 20px;
    background: #00bdd6;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.bot {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
    color: #424242;
}

.message.user {
    background: rgba(0, 189, 214, 0.1);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #00889c;
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 9999px;
    background: #f1f5f9;
    border: 1px solid transparent;
    font-size: 0.9rem;
    color: #424242;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #00bdd6;
    background: white;
}

.chat-input-area button {
    background: none;
    border: none;
    color: #00bdd6;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.1);
}

/* Chat Typing Indicator */
.typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00bdd6;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-container {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 1.5rem;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Utils */
.clip-path-diagonal {
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 30% 0);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Mobile Responsiveness for chat and navbar */
@media (max-width: 768px) {
    .navbar {
        width: 95%;
        padding: 0 20px !important;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-section {
        padding-left: 5%;
    }

    .chat-widget {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        max-width: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: translateY(100%) !important;
        z-index: 99999 !important;
        background: #f8fafc !important;
    }

    .chat-widget.active {
        transform: translateY(0) !important;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }

    .hamburger span {
        width: 24px;
        height: 2px;
        background: #424242;
        transition: all 0.3s;
        border-radius: 2px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(0, 189, 214, 0.2);
        border-radius: 1rem;
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        text-align: center;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }
}