﻿/* ==========================================================================
   Xyphla Support Hub - Real-Time Voice Calling & Audio Dock Styles
   Responsive, Accessible, Polished WebRTC Interface for Customer Ticket View
   ========================================================================== */

/* 1. Header Voice Call Button & Status Indicators */
.xyp-btn-call {
    background: linear-gradient(135deg, #0E59F2 0%, #1D4ED8 100%);
    color: #FFFFFF !important;
    border: none;
    font-weight: 600;
    font-size: 12.5px;
    padding: 7px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(14, 89, 242, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    text-decoration: none;
}
.xyp-btn-call:hover {
    background: linear-gradient(135deg, #0B46BF 0%, #1E40AF 100%);
    box-shadow: 0 4px 14px rgba(14, 89, 242, 0.38);
    transform: translateY(-1px);
}
.xyp-btn-call:active {
    transform: translateY(0);
}
.xyp-btn-call .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 15px;
}
.xyp-btn-call.is-busy {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* 2. Pre-Call Permission & Consent Modal */
.xyp-call-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 22, 52, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.xyp-call-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.xyp-call-modal-card {
    background: #FFFFFF;
    border: 1px solid var(--xyp-border, #E2E8F0);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 28px;
    box-shadow: 0 24px 48px -12px rgba(5, 22, 52, 0.25);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.xyp-call-modal-backdrop.is-open .xyp-call-modal-card {
    transform: translateY(0) scale(1);
}
.xyp-call-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F1F5F9;
}
.xyp-call-modal-title {
    font-family: var(--xyp-font-display, 'Space Grotesk', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #051634;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.xyp-call-modal-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.15s ease;
}
.xyp-call-modal-close:hover {
    color: #051634;
    background: #F1F5F9;
}

/* Audio Mic Meter in Pre-Call Modal */
.xyp-mic-check-box {
    background: #F8FAFC;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    text-align: center;
}
.xyp-mic-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    margin: 12px 0 6px 0;
}
.xyp-visualizer-bar {
    width: 6px;
    background: #CBD5E1;
    border-radius: 4px;
    height: 8px;
    transition: height 0.08s ease, background-color 0.15s ease;
}
.xyp-visualizer-bar.active {
    background: #10B981;
}

/* Call Recording Notice */
.xyp-call-consent-alert {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 16px 0;
    font-size: 12.5px;
    color: #1E40AF;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.xyp-rec-pulse-dot {
    width: 9px;
    height: 9px;
    background: #EF4444;
    border-radius: 50%;
    margin-top: 3px;
    flex-shrink: 0;
    animation: xyp-blink 1.2s infinite ease-in-out;
}
@keyframes xyp-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}

/* 3. Persistent Floating In-Call Dock */
.xyp-call-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 100000;
    background: rgba(5, 22, 52, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 8px 14px 8px 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(14, 89, 242, 0.3);
    color: #FFFFFF;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: 94vw;
}
.xyp-call-dock.is-active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Dock Status Block */
.xyp-dock-status-col {
    display: flex;
    align-items: center;
    gap: 12px;
}
.xyp-dock-avatar-ring {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}
.xyp-dock-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #051634;
    background: #F59E0B; /* Default amber (ringing/connecting) */
}
.xyp-dock-status-dot.connected {
    background: #10B981; /* Green */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}
.xyp-dock-status-dot.hold {
    background: #F97316; /* Orange */
}

.xyp-dock-meta {
    display: flex;
    flex-direction: column;
}
.xyp-dock-agent-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #F8FAFC;
    line-height: 1.2;
}
.xyp-dock-sub-status {
    font-size: 11.5px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 6px;
}
.xyp-dock-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #38BDF8;
    font-weight: 700;
}
.xyp-dock-rec-pill {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #FCA5A5;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Dock Controls Group */
.xyp-dock-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    padding-left: 14px;
}
.xyp-dock-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}
.xyp-dock-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.xyp-dock-btn.is-muted {
    background: #EF4444 !important;
    color: #FFFFFF !important;
}
.xyp-dock-btn-hangup {
    background: #EF4444;
    color: #FFFFFF;
    width: 40px;
    height: 40px;
}
.xyp-dock-btn-hangup:hover {
    background: #DC2626;
    transform: scale(1.08);
}
.xyp-dock-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* 4. Timeline Audio Player Cards */
.xyp-voice-recording-card {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.xyp-voice-recording-card:hover {
    border-color: #0E59F2;
    box-shadow: 0 4px 16px rgba(14, 89, 242, 0.08);
}
.xyp-voice-recording-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.xyp-voice-recording-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xyp-voice-badge {
    background: #EFF6FF;
    color: #0E59F2;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.xyp-voice-recording-card audio {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    outline: none;
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
    .xyp-call-dock {
        width: calc(100% - 24px);
        bottom: 12px;
        border-radius: 16px;
        padding: 10px 14px;
        justify-content: space-between;
    }
    .xyp-dock-controls {
        gap: 6px;
        padding-left: 8px;
    }
    .xyp-dock-btn {
        width: 34px;
        height: 34px;
    }
    .xyp-dock-btn-hangup {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   7. Front-Page Voice Call Hero Bar & Quick-Start Modal
   ========================================================================== */
.xyp-voice-call-bar {
    background: linear-gradient(135deg, #051634 0%, #0A2250 55%, #0B2B66 100%);
    border: 1px solid rgba(14, 89, 242, 0.28);
    border-radius: 18px;
    padding: 26px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    box-shadow: 0 16px 36px -10px rgba(5, 22, 52, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.xyp-voice-call-bar::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -15%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(14, 89, 242, 0.35) 0%, transparent 70%);
    pointer-events: none;
}
.xyp-voice-call-bar.is-closed {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-color: rgba(148, 163, 184, 0.2);
}
.xyp-voice-bar-left {
    flex: 1;
    min-width: 0;
    z-index: 1;
}
.xyp-voice-bar-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
}
.xyp-voice-bar-status-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.xyp-voice-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.xyp-voice-status-pill.online {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.xyp-voice-status-pill.closed {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.xyp-voice-latency-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #94A3B8;
    font-size: 12px;
}
.xyp-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
    animation: xyp-rec-pulse 1.8s infinite;
}
.xyp-voice-bar-title {
    font-family: var(--xyp-font-display, 'Space Grotesk', sans-serif);
    font-size: 21px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.xyp-voice-bar-desc {
    color: #CBD5E1;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 16px 0;
    max-width: 680px;
}
.xyp-voice-specs-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.xyp-voice-spec-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #93C5FD;
    font-size: 12px;
    font-weight: 500;
}
.xyp-voice-spec-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}
.xyp-btn-call-hero {
    background: linear-gradient(135deg, #0E59F2 0%, #2563EB 50%, #1D4ED8 100%);
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    font-size: 15px;
    padding: 14px 26px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(14, 89, 242, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}
.xyp-btn-call-hero:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    box-shadow: 0 6px 26px rgba(14, 89, 242, 0.65);
    transform: translateY(-2px);
}
.xyp-btn-call-hero .dashicons {
    font-size: 19px;
    width: 19px;
    height: 19px;
    line-height: 19px;
}
.xyp-voice-cta-caption {
    font-size: 11.5px;
    color: #94A3B8;
    margin-top: 8px;
}

/* Quick Call Modal Specifics */
.xyp-quick-call-card {
    max-width: 520px !important;
}
.xyp-call-client-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    color: #1E3A8A;
}
.xyp-call-client-badge strong {
    display: block;
    font-size: 13.5px;
    color: #051634;
}
.xyp-call-client-badge span {
    font-size: 12px;
    color: #3B82F6;
}
.xyp-dock-ticket-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #60A5FA;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 6px;
}
.xyp-dock-ticket-link:hover {
    color: #93C5FD;
}

@media (max-width: 860px) {
    .xyp-voice-call-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 22px 20px;
    }
    .xyp-voice-bar-right {
        align-items: flex-start;
    }
    .xyp-btn-call-hero {
        width: 100%;
        justify-content: center;
    }
    .xyp-voice-cta-caption {
        text-align: center;
        width: 100%;
    }
}

.xyp-status-pill-call {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(14, 89, 242, 0.25);
    border: 1px solid rgba(14, 89, 242, 0.5);
    color: #93C5FD;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.xyp-status-pill-call:hover {
    background: rgba(14, 89, 242, 0.45);
    border-color: #60A5FA;
    color: #FFFFFF;
    transform: translateY(-1px);
}
