/* MyAgent Lending Group - Welcome Video Widget Stiling (Navy/Gold HSL Theme) */

:root {
    --widget-shadow: 0 8px 32px rgba(10, 25, 47, 0.25);
    --widget-gold-pulse: 0 0 0 0 rgba(212, 163, 89, 0.6);
}

/* Floating Bubble Container */
.welcome-bubble-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 990;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Floating Portrait Bubble */
.welcome-bubble {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background-image: url('/images/mama_couch.jpg');
    background-size: cover;
    background-position: center;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 20px rgba(10, 25, 47, 0.2);
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.welcome-bubble:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 163, 89, 0.4);
    border-color: var(--accent-hover);
}

/* Pulsing Golden Aura (Pulsing every 8 seconds to get attention without annoying) */
.welcome-bubble.pulse-active {
    animation: gold-pulse-ring 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gold-pulse-ring {
    0% {
        box-shadow: 0 4px 20px rgba(10, 25, 47, 0.2), 0 0 0 0 rgba(212, 163, 89, 0.6);
    }
    12% {
        box-shadow: 0 4px 20px rgba(10, 25, 47, 0.2), 0 0 0 16px rgba(212, 163, 89, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(10, 25, 47, 0.2), 0 0 0 0 rgba(212, 163, 89, 0);
    }
}

/* Play Badge Overlay on Bubble */
.welcome-bubble-play-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-bg);
    font-size: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.welcome-bubble:hover .welcome-bubble-play-badge {
    transform: scale(1.15);
    background-color: var(--accent-hover);
}

/* Welcome Floating Badge (Loom style) */
.welcome-bubble-badge {
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 163, 89, 0.3);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--widget-shadow);
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-bubble-badge.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Glassmorphic Overlay Player Modal */
.welcome-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 12, 24, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', system-ui, sans-serif;
    padding: 20px;
}

.welcome-player-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Centered Player Card (9:16 vertical aspect ratio for high-impact portrait visual) */
.welcome-player-card {
    width: 100%;
    max-width: 380px;
    background: rgba(10, 25, 47, 0.85);
    border: 2px solid rgba(212, 163, 89, 0.4);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.welcome-player-overlay.open .welcome-player-card {
    transform: scale(1) translateY(0);
}

/* Close Button in Card */
.welcome-player-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 400;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.welcome-player-close:hover {
    background: var(--accent);
    color: var(--primary-bg);
    border-color: var(--accent);
    transform: rotate(90deg);
}

/* Video Frame Container */
.welcome-video-container {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Static Fallback Container (If no video is loaded) */
.welcome-fallback-container {
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-bg) 100%);
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow-y: auto;
}

.welcome-fallback-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 16px;
}

.welcome-fallback-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
}

.welcome-fallback-header h3 {
    color: #ffffff;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.welcome-fallback-header span {
    color: var(--accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.welcome-fallback-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.welcome-fallback-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--accent);
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
}

/* Quick Actions Area (CTAs at bottom) */
.welcome-actions-container {
    background: rgba(5, 12, 24, 0.95);
    padding: 16px;
    border-top: 1px solid rgba(212, 163, 89, 0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-align: center;
}

.welcome-btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary-bg);
}

.welcome-btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 163, 89, 0.35);
}

.welcome-btn-navy {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.welcome-btn-navy:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.welcome-btn-call {
    background: #10b981;
    color: #ffffff;
}

.welcome-btn-call:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* --------------------------------------------------
   Responsive Media Queries for Perfect Device Alignments
   -------------------------------------------------- */

@media (max-width: 1023px) {
    .welcome-bubble {
        width: 76px;
        height: 76px;
        border-width: 2px;
    }
    .welcome-bubble-container {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 767px) {
    /* Offset by 88px to hover safely ABOVE the mobile sticky footer and quick links */
    .welcome-bubble-container {
        bottom: 88px; 
        right: 16px;
        gap: 8px;
    }
    .welcome-bubble {
        width: 64px;
        height: 64px;
    }
    .welcome-bubble-play-badge {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
    .welcome-bubble-badge {
        display: none; /* Hide helper badge on small viewports to avoid cramping */
    }
    .welcome-player-card {
        max-width: 100%;
        border-radius: 16px;
        height: 90vh; /* Don't exceed mobile height limits */
        max-height: 560px;
    }
    .welcome-video-container, .welcome-fallback-container {
        aspect-ratio: auto;
        flex-grow: 1;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    /* Handle landscape phones */
    .welcome-bubble-container {
        bottom: 12px;
        right: 12px;
    }
    .welcome-bubble {
        width: 52px;
        height: 52px;
    }
    .welcome-player-card {
        height: 95vh;
        flex-direction: row;
        max-width: 540px;
        max-height: 280px;
    }
    .welcome-video-container, .welcome-fallback-container {
        width: 50%;
        height: 100%;
        aspect-ratio: auto;
    }
    .welcome-actions-container {
        width: 50%;
        justify-content: center;
        border-top: none;
        border-left: 1px solid rgba(212, 163, 89, 0.25);
    }
}
