/* ==========================================================================
   20/59 Ventures Corp - Harry Voice & Text AI Widget Stylesheet
   Clean, Accessible Design for Seniors, Veterans & Agency Professionals
   ========================================================================== */

/* Launcher Floating Button */
#harry-widget-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
    background: linear-gradient(135deg, #4A7C59 0%, #3A5F47 100%);
    color: #FFFFFF;
    padding: 12px 22px 12px 14px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(74, 124, 89, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

#harry-widget-launcher:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(74, 124, 89, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
}

#harry-widget-launcher:focus-visible {
    outline: 3px solid #D4AF37;
    outline-offset: 4px;
}

.harry-launcher-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #F8F6F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A7C59;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.harry-launcher-avatar::after {
    content: '';
    position: absolute;
    top: -2px; right: -2px; bottom: -2px; left: -2px;
    border-radius: 50%;
    border: 2px solid #6B9A78;
    animation: harry-pulse 2s infinite ease-in-out;
}

@keyframes harry-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.8; }
}

.harry-launcher-text {
    display: flex;
    flex-direction: column;
}

.harry-launcher-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.harry-launcher-sub {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
}

/* Modal Popup Window */
#harry-widget-modal {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 640px;
    max-height: calc(100vh - 120px);
    z-index: 10000;
    background: #FFFFFF;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(74, 124, 89, 0.25);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(74, 124, 89, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

#harry-widget-modal.harry-active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Header */
.harry-modal-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #F8F6F0 0%, #EFECE4 100%);
    border-bottom: 1px solid rgba(74, 124, 89, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.harry-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.harry-avatar-wrapper {
    position: relative;
}

.harry-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #4A7C59;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 10px rgba(74, 124, 89, 0.3);
}

.harry-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #86868B;
    border: 2px solid #FFFFFF;
    transition: background 0.3s ease;
}

.harry-status-dot.online { background: #34C759; }
.harry-status-dot.speaking { background: #007AFF; animation: harry-pulse-dot 1s infinite; }
.harry-status-dot.connecting { background: #FF9500; }

@keyframes harry-pulse-dot {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.harry-header-details {
    display: flex;
    flex-direction: column;
}

.harry-name {
    font-size: 16px;
    font-weight: 700;
    color: #1D1D1F;
}

.harry-role {
    font-size: 11px;
    color: #515154;
    font-weight: 600;
}

/* Mode Switcher Tabs (Text vs Voice) */
.harry-mode-bar {
    display: flex;
    background: #F5F5F7;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    gap: 6px;
}

.harry-mode-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #515154;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.harry-mode-tab:hover {
    color: #1D1D1F;
    background: rgba(0, 0, 0, 0.04);
}

.harry-mode-tab.active {
    background: #FFFFFF;
    color: #4A7C59;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.harry-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #515154;
    transition: all 0.2s ease;
}

.harry-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1D1D1F;
}

/* Audio Visualizer Section (Voice Mode Only) */
.harry-visualizer-container {
    padding: 12px;
    background: #1D1D1F;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#harry-audio-canvas {
    width: 100%;
    height: 50px;
    display: block;
}

.harry-visualizer-status {
    position: absolute;
    bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #86868B;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Live Transcript / Chat Area */
.harry-transcript-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F9F9FB;
}

.harry-chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: harry-fade-in 0.25s ease-out forwards;
}

@keyframes harry-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.harry-chat-msg.assistant {
    align-self: flex-start;
    background: #FFFFFF;
    color: #1D1D1F;
    border: 1px solid rgba(74, 124, 89, 0.2);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.harry-chat-msg.user {
    align-self: flex-end;
    background: #4A7C59;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.25);
}

.harry-chat-sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Text Input Bar (Text Chat Mode) */
.harry-input-bar {
    padding: 10px 14px;
    background: #FFFFFF;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.harry-text-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D2D2D7;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #F5F5F7;
    transition: all 0.2s ease;
}

.harry-text-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #4A7C59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

.harry-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #4A7C59;
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.harry-send-btn:hover {
    background: #3A5F47;
    transform: scale(1.05);
}

/* Quick Lead Form Drawer (Expandable) */
.harry-lead-drawer {
    display: none;
    padding: 14px 16px;
    background: #FFFFFF;
    border-top: 1px solid rgba(74, 124, 89, 0.15);
    border-bottom: 1px solid rgba(74, 124, 89, 0.15);
}

.harry-lead-drawer.active {
    display: block;
    animation: harry-slide-down 0.25s ease-out;
}

@keyframes harry-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.harry-lead-title {
    font-size: 13px;
    font-weight: 700;
    color: #1D1D1F;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.harry-lead-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #D2D2D7;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.harry-lead-input:focus {
    outline: none;
    border-color: #4A7C59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

.harry-lead-submit {
    width: 100%;
    padding: 10px;
    background: #4A7C59;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.harry-lead-submit:hover {
    background: #3A5F47;
}

/* Control Action Bar */
.harry-control-bar {
    padding: 10px 14px;
    background: #FFFFFF;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-around;
}

.harry-btn {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid #E5E5EA;
    background: #F5F5F7;
    color: #1D1D1F;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.harry-btn:hover {
    background: #E8E8ED;
    border-color: #D1D1D6;
}

.harry-btn.bargein-btn {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    border-color: rgba(255, 59, 48, 0.3);
}

.harry-btn.bargein-btn:hover {
    background: rgba(255, 59, 48, 0.2);
}

.harry-btn.agent-btn {
    background: rgba(74, 124, 89, 0.12);
    color: #4A7C59;
    border-color: rgba(74, 124, 89, 0.3);
}

.harry-btn.agent-btn:hover {
    background: rgba(74, 124, 89, 0.22);
}

.harry-btn.mic-btn.muted {
    background: #FF3B30;
    color: #FFFFFF;
    border-color: #FF3B30;
}

.harry-btn.start-call-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
    background: #4A7C59;
    color: #FFFFFF;
    border: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.harry-btn.start-call-btn:hover {
    background: #3A5F47;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #harry-widget-launcher {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px 10px 12px;
    }
    #harry-widget-modal {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}
