/* ==========================================================================
   PRIME LAWYERS — FLOATING AI DUO LAUNCHER & CONSULTATION MODAL (SCOPED CSS)
   Universal Draggable & Hanging Persona Launcher (Mobile & Desktop)
   ========================================================================== */

@keyframes slideTopToBottomSlow {
    0% {
        transform: translateY(-80px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes subtleHangingSway {
    0%, 100% {
        transform: rotate(0deg);
    }
    30% {
        transform: rotate(1.2deg);
    }
    70% {
        transform: rotate(-1.2deg);
    }
}

#floatingAiLauncher {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
    display: block;
    cursor: grab;
    cursor: -webkit-grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    animation: slideTopToBottomSlow 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    will-change: left, top, transform;
    transform-origin: top center;
}

#floatingAiLauncher:hover {
    animation: subtleHangingSway 4s ease-in-out infinite;
}

#floatingAiLauncher.is-dragging {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
    transition: none !important;
    animation: none !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 16px rgba(245, 197, 24, 0.75));
    transform: scale(1.04) !important;
    opacity: 0.96;
}

/* Elegant Hanging Lanyard / Charm Motif */
.hanging-lanyard-hook {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: -4px;
    position: relative;
    z-index: 25;
    pointer-events: none;
}

.hanging-lanyard-ring {
    width: 14px;
    height: 14px;
    border: 2px solid #F5C518;
    border-radius: 50%;
    background: radial-gradient(circle, #FFE57F 0%, #D4AF37 60%, #8A6D1C 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 8px rgba(245, 197, 24, 0.7);
}

.hanging-lanyard-cord {
    width: 2px;
    height: 9px;
    background: linear-gradient(180deg, #F5C518 0%, rgba(212, 175, 55, 0.9) 100%);
    box-shadow: 0 0 4px rgba(245, 197, 24, 0.6);
}

.duo-avatar-transparent-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent !important;
    position: relative;
    width: 140px;
    touch-action: none;
}

/* Promptly Noticeable Speaker Button & Curved Arrow */
.duo-speaker-ctrl-box {
    position: relative;
    z-index: 25;
    margin-bottom: 2px;
}

.duo-launcher-speaker-btn {
    background: #001226 !important;
    border: 2px solid #F5C518 !important;
    color: #F5C518 !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), 0 0 12px rgba(245, 197, 24, 0.45) !important;
    transition: all 0.25s ease !important;
    text-decoration: none !important;
    outline: none !important;
    user-select: none !important;
}

.duo-launcher-speaker-btn:hover {
    transform: scale(1.08) !important;
    background: #002244 !important;
    box-shadow: 0 6px 20px rgba(245, 197, 24, 0.7) !important;
}

.duo-launcher-speaker-btn.is-muted {
    border-color: #94A3B8 !important;
    color: #94A3B8 !important;
    background: #0B192C !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
}

.duo-launcher-speaker-btn.is-muted:hover {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
}

.speaker-curved-arrow-svg {
    position: absolute;
    top: 18px;
    left: 0;
    width: 140px;
    height: 100px;
    pointer-events: none;
    z-index: 20;
    overflow: visible;
}

.curved-arrow-path {
    fill: none;
    stroke: #F5C518;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-dasharray: 4 2;
    filter: drop-shadow(0 0 4px rgba(245, 197, 24, 0.8));
    animation: flowDashes 1.2s linear infinite;
    transition: stroke 0.3s ease, opacity 0.3s ease;
}

.curved-arrow-path.muted-path {
    stroke: #64748B !important;
    filter: none !important;
    animation: none !important;
    opacity: 0.35 !important;
}

.curved-origin-dot {
    fill: #F5C518;
    transition: fill 0.3s ease, opacity 0.3s ease;
}

.curved-origin-dot.muted-dot {
    fill: #64748B !important;
    opacity: 0.35 !important;
}

@keyframes flowDashes {
    from { stroke-dashoffset: 12; }
    to { stroke-dashoffset: 0; }
}

.duo-persona-cutout {
    width: 130px;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    display: block;
    background: transparent !important;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.75)) drop-shadow(0 6px 20px rgba(0, 0, 0, 0.65));
    transition: transform 0.3s ease, filter 0.3s ease;
    pointer-events: none;
    -webkit-user-drag: none;
}

.duo-avatar-transparent-wrap:hover .duo-persona-cutout {
    transform: translateY(-3px) scale(1.03);
    filter: drop-shadow(0 0 16px rgba(245, 197, 24, 0.95)) drop-shadow(0 8px 25px rgba(0, 0, 0, 0.75));
}

.duo-start-chat-btn {
    background: linear-gradient(135deg, #F5C518 0%, #D4AF37 100%);
    color: #001226 !important;
    font-weight: 800;
    font-size: 0.76rem;
    padding: 0.25rem 0.65rem;
    border-radius: 14px;
    border: 1px solid #FFFFFF;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    margin-top: -12px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: grab;
    transition: transform 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.duo-start-chat-btn:hover {
    transform: scale(1.08);
}

.duo-badge-pill {
    background: #0B192C !important;
    color: #F5C518 !important;
    border: 1.5px solid #D4AF37 !important;
    border-radius: 20px;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    z-index: 10;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

/* ================= CHAT MODAL ================= */
#aiAssistantChatModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 8, 20, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#aiAssistantChatModal.active,
#aiAssistantChatModal[style*="display: flex"] {
    display: flex !important;
}

.modal-container-card {
    background: #071322;
    border: 2px solid #D4AF37;
    border-radius: 12px;
    max-width: 780px;
    width: 95%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 16px 50px rgba(0,0,0,0.85);
    animation: modalPopIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes modalPopIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#chatModalCloseBtn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#chatModalCloseBtn:hover {
    background: #B91C1C;
    border-color: #EF4444;
    color: #FFFFFF;
    transform: rotate(90deg);
}

.duo-chat-modal-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 420px;
}

.duo-modal-col-left {
    background: #000000;
    border-right: 1.5px solid rgba(212, 175, 55, 0.4);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.duo-modal-image-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid #F5C518;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(245, 197, 24, 0.3);
    background: #0B192C;
}

.duo-modal-persona-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.duo-modal-left-meta {
    margin-top: 0.85rem;
    width: 100%;
}

.duo-counsel-title {
    font-family: 'Playfair Display', serif;
    color: #F5C518;
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
}

.duo-counsel-sub {
    font-size: 0.78rem;
    color: #CBD5E1;
    margin: 0.2rem 0 0.65rem 0;
}

.duo-voice-mute-btn {
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.5);
    color: #F5C518;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.duo-voice-mute-btn:hover {
    background: rgba(245, 197, 24, 0.3);
    color: #FFFFFF;
}

.duo-modal-col-right {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #071322;
}

.duo-modal-welcome-note {
    font-size: 0.85rem;
    color: #CBD5E1;
    line-height: 1.45;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.duo-modal-welcome-note strong {
    color: #F5C518;
}

.duo-form-row {
    margin-bottom: 0.75rem;
}

.duo-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.duo-form-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #CBD5E1;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duo-form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    color: #FFFFFF;
    font-size: 0.82rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.duo-form-input:focus {
    border-color: #F5C518;
    background: rgba(255, 255, 255, 0.08);
}

.duo-form-textarea {
    resize: none;
}

.duo-form-submit-btn {
    background: linear-gradient(135deg, #F5C518 0%, #D4AF37 100%);
    color: #001226;
    font-weight: 800;
    font-size: 0.86rem;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 0.35rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.duo-form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 197, 24, 0.45);
}

@media (max-width: 680px) {
    .duo-chat-modal-grid {
        grid-template-columns: 1fr;
    }
    .duo-modal-col-left {
        padding: 1rem;
        border-right: none;
        border-bottom: 1.5px solid rgba(212, 175, 55, 0.4);
    }
    .duo-modal-image-wrapper {
        width: 75px;
        height: 75px;
    }
    .duo-form-row-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    #floatingAiLauncher {
        bottom: 15px;
        left: 15px;
    }
    .duo-persona-cutout {
        width: 105px;
    }
}
