@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --primary: 0 72.2% 50.6%;
    --primary-foreground: 0 85.7% 97.3%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --border: 0 0% 14.9%;
    --radius: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -30%;
    right: -30%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, rgba(99, 102, 241, 0.15) 30%, rgba(59, 130, 246, 0.08) 50%, transparent 70%);
    animation: float1 6s ease-in-out infinite;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -30%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.28) 0%, rgba(14, 165, 233, 0.1) 30%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
    animation: float2 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes float1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-40%, 40%) scale(1.4);
        opacity: 0.9;
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0) scale(1.1);
        opacity: 1;
    }
    50% {
        transform: translate(40%, -40%) scale(1.5);
        opacity: 0.85;
    }
}

.elia-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 120px 1rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.card {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 36rem;
    box-shadow:
        0 0 80px rgba(99, 102, 241, 0.15),
        0 0 40px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-description {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    line-height: 1.625;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    align-items: center;
}

.orb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.orb-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

#vapiButton {
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.95) 0%, rgba(99, 102, 241, 0.9) 50%, rgba(59, 130, 246, 0.85) 100%) !important;
    color: #ffffff !important;
    width: 140px !important;
    height: 140px !important;
    border: 3px solid rgba(139, 92, 246, 0.4) !important;
    border-radius: 50% !important;
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.6),
        0 0 120px rgba(139, 92, 246, 0.4),
        0 10px 40px rgba(99, 102, 241, 0.5),
        inset 0 0 60px rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    min-width: 140px !important;
    min-height: 140px !important;
    max-width: 140px !important;
    max-height: 140px !important;
}

#vapiButton svg {
    width: 50px !important;
    height: 50px !important;
    position: relative !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

#vapiButton::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(99, 102, 241, 0.8),
        rgba(139, 92, 246, 0.8),
        rgba(59, 130, 246, 0.8),
        rgba(99, 102, 241, 0.8)
    );
    animation: rotate 4s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

#vapiButton::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 85%;
    height: 85%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: pulse-orb 2s ease-in-out infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-orb {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

#vapiButton:hover::before {
    opacity: 1;
}

#vapiButton:hover {
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 1) 0%, rgba(99, 102, 241, 1) 50%, rgba(59, 130, 246, 0.95) 100%) !important;
    box-shadow:
        0 0 80px rgba(99, 102, 241, 0.8),
        0 0 150px rgba(139, 92, 246, 0.6),
        0 15px 50px rgba(99, 102, 241, 0.7),
        inset 0 0 80px rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05) !important;
}

#vapiButton:active {
    transform: scale(0.95) !important;
}

/* Estado cuando está en llamada */
#vapiButton.in-call {
    background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.9) 50%, rgba(185, 28, 28, 0.85) 100%) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    box-shadow:
        0 0 60px rgba(239, 68, 68, 0.6),
        0 0 120px rgba(220, 38, 38, 0.4),
        0 10px 40px rgba(239, 68, 68, 0.5),
        inset 0 0 60px rgba(255, 255, 255, 0.1) !important;
}

#vapiButton.in-call::before {
    background: conic-gradient(
        from 0deg,
        rgba(239, 68, 68, 0.8),
        rgba(220, 38, 38, 0.8),
        rgba(185, 28, 28, 0.8),
        rgba(239, 68, 68, 0.8)
    );
}

/* Animación cuando el usuario está hablando */
#vapiButton.speaking {
    animation: speaking-pulse 0.5s ease-in-out infinite !important;
}

@keyframes speaking-pulse {
    0%, 100% {
        box-shadow:
            0 0 60px rgba(99, 102, 241, 0.6),
            0 0 120px rgba(139, 92, 246, 0.4),
            0 10px 40px rgba(99, 102, 241, 0.5),
            inset 0 0 60px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 100px rgba(99, 102, 241, 0.9),
            0 0 180px rgba(139, 92, 246, 0.7),
            0 15px 60px rgba(99, 102, 241, 0.8),
            inset 0 0 80px rgba(255, 255, 255, 0.2);
        transform: scale(1.08);
    }
}

#vapiButton.in-call.speaking {
    animation: speaking-pulse-red 0.5s ease-in-out infinite !important;
}

@keyframes speaking-pulse-red {
    0%, 100% {
        box-shadow:
            0 0 60px rgba(239, 68, 68, 0.6),
            0 0 120px rgba(220, 38, 38, 0.4),
            0 10px 40px rgba(239, 68, 68, 0.5),
            inset 0 0 60px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 100px rgba(239, 68, 68, 0.9),
            0 0 180px rgba(220, 38, 38, 0.7),
            0 15px 60px rgba(239, 68, 68, 0.8),
            inset 0 0 80px rgba(255, 255, 255, 0.2);
        transform: scale(1.08);
    }
}

.status-card {
    background: rgba(20, 20, 30, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    opacity: 0;
    transition: all 0.3s;
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.status-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.status-text {
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.text-muted {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1.5rem;
}

/* Ocultar completamente el botón por defecto de VAPI */
#vapi-button-container,
[id^="vapi-btn"],
div[style*="position: fixed"][style*="right"],
button[class*="vapi"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Pop-up de formulario */
.demo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.demo-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.demo-popup {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow:
        0 0 80px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.demo-popup-overlay.show .demo-popup {
    transform: scale(1);
}

.demo-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.demo-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.demo-popup-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-popup-content > p {
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-submit:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(139, 92, 246, 1) 100%);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: translateY(0);
}

.form-success {
    text-align: center;
    padding: 2rem 0;
}

.form-success svg {
    margin: 0 auto 1rem;
    display: block;
}

.form-success h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

.form-success p {
    color: hsl(var(--muted-foreground));
}

@media (max-width: 640px) {
    .card {
        padding: 2rem 1.5rem;
    }

    .card-title {
        font-size: 1.875rem;
    }

    #vapiButton {
        width: 120px !important;
        height: 120px !important;
        min-width: 120px !important;
        min-height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }

    .demo-popup {
        padding: 2rem 1.5rem;
    }

    .demo-popup-content h2 {
        font-size: 1.5rem;
    }
}
