/* ==========================================================================
   PRIME LAWYERS — FLOATING AI DUO LAUNCHER & CONSULTATION MODAL (SCOPED CSS)
   ========================================================================== */

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

#floatingAiLauncher {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: block;
    cursor: pointer;
    user-select: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    animation: slideTopToBottomSlow 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

/* Promptly Noticeable Speaker Button & Cervical 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: 150px;
    height: 110px;
    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: 140px;
    height: auto;
    max-height: 155px;
    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;
}

.duo-avatar-transparent-wrap:hover .duo-persona-cutout {
    transform: translateY(-5px) scale(1.04);
    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: pointer;
    transition: transform 0.2s;
}

.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;
}

/* ================= 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: 12px;
    right: 12px;
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s;
}

#chatModalCloseBtn:hover {
    background: #EF4444;
    border-color: #EF4444;
}

.duo-chat-modal-grid {
    display: grid;
    grid-template-columns: 38% 62%;
}

.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: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid #D4AF37;
    overflow: hidden;
    background: #0B192C;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

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

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

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

.duo-counsel-sub {
    font-size: 0.78rem;
    color: #CBD5E1;
    margin-bottom: 0.75rem;
}

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

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

.duo-modal-welcome-note {
    background: rgba(245, 197, 24, 0.1);
    border-left: 3px solid #F5C518;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #F1F5F9;
    margin-bottom: 1rem;
    line-height: 1.45;
}

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

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

.duo-form-label {
    display: block;
    font-size: 0.78rem;
    color: #CBD5E1;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.duo-form-input,
.duo-form-textarea {
    width: 100% !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 6px !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.88rem !important;
    font-family: inherit;
    box-sizing: border-box;
    user-select: text !important;
}

.duo-form-input:focus,
.duo-form-textarea:focus {
    border-color: #F5C518 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.2) !important;
}

.duo-form-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #F5C518 0%, #D4AF37 100%);
    color: #001226 !important;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 197, 24, 0.3);
    margin-top: 0.35rem;
    transition: transform 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: 80px;
        height: 80px;
    }
    .duo-form-row-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    #floatingAiLauncher {
        bottom: 12px;
        left: 12px;
    }
    .duo-persona-cutout {
        width: 110px;
    }
}
