/* CallPop Phone - Styles for callpop in softphone right panel */

/* Compact state message */
.callpop-state-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    padding: 2rem;
}

/* Panel header */
.callpop-panel-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

/* Patient cards - 3-column grid */
.callpop-cards-phone {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* Divider between mentioned and other patients */
.callpop-others-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.callpop-others-divider::before,
.callpop-others-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #dee2e6;
}

.callpop-others-divider span {
    white-space: nowrap;
}

/* Patient card */
.callpop-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.callpop-card:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

/* Highlighted card when patient name mentioned by caller */
.callpop-card-mentioned {
    border-color: #198754;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.15);
}

.callpop-mentioned-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #198754;
    margin-top: 0.15rem;
}

.callpop-card-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.callpop-card-header .patient-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

/* Eligibility badge */
.callpop-elig-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    white-space: nowrap;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.callpop-elig-eligible {
    background: #d1e7dd;
    color: #0f5132;
}

.callpop-elig-ineligible {
    background: #f8d7da;
    color: #842029;
}

.callpop-elig-unknown {
    background: #fff3cd;
    color: #664d03;
}

.callpop-elig-unchecked {
    background: #e2e3e5;
    color: #41464b;
}

/* Pending forms alert */
.callpop-forms-alert {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    color: #664d03;
    font-size: 0.8rem;
}

.callpop-forms-alert i {
    color: #ffc107;
    font-size: 1rem;
    flex-shrink: 0;
}

.callpop-forms-alert > span {
    flex: 1 1 auto;
    min-width: 0;
}

.callpop-forms-send-btn {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.callpop-card-body {
    padding: 0.5rem 1rem;
}

.callpop-card-actions {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    gap: 0.5rem;
}

/* Field rows inside card */
.callpop-field {
    display: flex;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.callpop-field:last-child {
    border-bottom: none;
}

.callpop-field-label {
    flex: 0 0 130px;
    font-weight: 600;
    font-size: 0.78rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.callpop-field-value {
    flex: 1;
    font-size: 0.88rem;
    color: #212529;
    word-break: break-word;
}

.callpop-field-value.empty {
    color: #adb5bd;
    font-style: italic;
}

.callpop-field-value.has-balance {
    color: #dc3545;
    font-weight: 600;
}

/* ---- Split layout: ARIA left, patient cards right ---- */
.callpop-split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
    align-items: start;
}

.callpop-split-aria .aria-panel-card {
    margin-top: 0;
}

/* ---- ARIA Panel (inside right panel) ---- */
.aria-panel-card {
    border: 1px solid #0d6efd;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.aria-panel-header {
    padding: 0.6rem 0.75rem;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.aria-panel-body {
    padding: 0.75rem;
}

.aria-title {
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.aria-summary {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.45;
    margin-bottom: 0.5rem;
}

.aria-timestamp {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.4rem;
}

/* Transcript */
.aria-transcript-section {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e9ecef;
}

.aria-transcript {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

/* Chat bubbles */
.aria-turn {
    margin-bottom: 0.5rem;
}

.aria-turn-user {
    text-align: right;
}

.aria-turn-ai {
    text-align: left;
}

.aria-bubble {
    display: inline-block;
    max-width: 90%;
    padding: 0.4rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-word;
}

.aria-bubble-user {
    background: #e9ecef;
    color: #212529;
    border-bottom-right-radius: 0.15rem;
}

.aria-bubble-ai {
    background: #e8f0fe;
    color: #212529;
    border-bottom-left-radius: 0.15rem;
}

.aria-role {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tool calls */
.aria-turn.aria-tool {
    text-align: center;
    margin: 0.35rem 0;
}

.aria-tool-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: #6c757d;
    background: #f0f0f0;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.aria-tool-result {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.15rem;
    font-style: italic;
}

/* Call Pop tab active indicator */
.callpop-tab-active {
    position: relative;
}

.callpop-tab-active::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: callpopPulse 2s ease-in-out infinite;
}

@keyframes callpopPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ARIA Stale Warning */
.aria-stale-warning {
    padding: 0.35rem 0.75rem;
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    color: #664d03;
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.aria-stale-warning i {
    color: #ffc107;
    font-size: 0.9rem;
}

/* Stale ARIA panel */
.aria-panel-stale {
    border-color: #ffc107;
}

.aria-panel-stale .aria-panel-header {
    background: #c29008;
}

/* ARIA Navigation Controls */
.aria-nav-controls {
    white-space: nowrap;
}

.aria-nav-btn {
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    background: transparent;
    border-radius: 0.25rem;
    cursor: pointer;
}

.aria-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
}

.aria-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    color: #fff;
}

.aria-nav-label {
    font-size: 0.7rem;
    opacity: 0.85;
    min-width: 2.5em;
    text-align: center;
    color: #fff;
}

/* ============================================ */
/* CRM Mode — Sections (services, notes, other contacts) */
/* ============================================ */

.callpop-company-subtitle {
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.callpop-section-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.4rem;
}

.callpop-services-section,
.callpop-notes-section,
.callpop-contacts-section {
    padding: 0.6rem 1rem;
    border-top: 1px solid #e9ecef;
}

/* Active Services badges */
.callpop-services-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.callpop-services-badges .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Recent Notes */
.callpop-notes-list {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.5rem;
}

.callpop-note-entry {
    border-left: 3px solid #0d6efd;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.callpop-note-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.callpop-note-meta {
    font-size: 0.72rem;
}

.callpop-note-text {
    font-size: 0.78rem;
    margin-top: 0.15rem;
    line-height: 1.35;
}

/* Other Contacts */
.callpop-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.callpop-other-contact {
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
    line-height: 1.4;
}

.callpop-other-contact:last-child {
    border-bottom: none;
}

.callpop-other-contact small {
    font-size: 0.75rem;
}
