/* ========================================
   SHARED CUSTOM CSS STYLES
   Used across index.html and leads.html
   ======================================== */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --biyo-primary: 37 99 235;
    --biyo-secondary: 124 58 237;
    --biyo-accent: 16 185 129;
}

/* ========================================
   GRADIENT UTILITIES
   ======================================== */
.bg-gradient-blue-purple {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(124, 58, 237));
}

.text-gradient-blue-purple {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(124, 58, 237));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-blue-purple-emerald {
    background: linear-gradient(to bottom right, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1), rgba(16, 185, 129, 0.1));
}

.bg-gradient-blue-purple-soft {
    background: linear-gradient(to bottom right, rgb(37, 99, 235), rgb(124, 58, 237));
}

/* ========================================
   ANIMATIONS
   ======================================== */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.backdrop-blur {
    backdrop-filter: blur(8px);
}

.ring-1 {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.blur-2xl {
    filter: blur(40px);
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.z-40 {
    z-index: 40;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* ========================================
   CHAT ANIMATION STYLES
   ======================================== */
.chat-message {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.chat-message.show {
    opacity: 1;
}

.chat-message.customer-message.show {
    animation: slideInRight 0.3s ease-out;
}

.chat-message.ai-message.show {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   VOICE VISUALIZATION STYLES
   ======================================== */
.voice-visualizer {
    min-height: 64px;
}

.voice-bar {
    height: 4px;
    min-height: 4px;
    max-height: 64px;
    transition: height 0.1s ease-out, opacity 0.1s ease-out;
}

/* ========================================
   POPUP STYLES
   ======================================== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Ensure backdrop filter is disabled when popup is hidden */
.popup-overlay:not(.show) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

/* When popup is hidden, make it completely invisible */
.popup-overlay:not(.show) {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Additional hidden state for complete invisibility */
.popup-overlay.hidden,
.popup-overlay[style*="display: none"],
.popup-overlay[style*="visibility: hidden"] {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
    opacity: 0 !important;
}

/* Ensure audio demo popup also gets backdrop filter removed when hidden */
#audioDemoPopup.hidden,
#audioDemoPopup[style*="display: none"],
#audioDemoPopup[style*="visibility: hidden"] {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
    opacity: 0 !important;
}

/* Ensure audio demo popup has backdrop filter when visible */
#audioDemoPopup:not(.hidden) {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.popup-overlay.show .popup-content {
    transform: translate(-50%, -50%) scale(1);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.btn-primary {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(124, 58, 237));
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: rgb(203, 213, 225);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: rgb(51, 65, 85);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(203, 213, 225);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgb(248, 250, 252);
}

.form-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgb(203, 213, 225);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: rgb(37, 99, 235);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.125rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 640px) {
    .popup-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}
