/* ============================================================================
   CALLS MODULE — Unified Voice + Video Calling UI
   Senior-optimized calling interface with Jitsi Meet + SMS invitations
   ============================================================================ */

/* Main container */
.calls-module {
    padding: 0.5rem 0;
}

.calls-module h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #2e7d32;
    margin: 0 0 0.75rem 0;
    padding: 0 0.25rem;
}

/* ── Contact Cards ────────────────────────────────────────────────────────── */

.calls-contacts-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calls-contact-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fdf9;
    border: 1px solid #e8f5e9;
    border-radius: 14px;
    transition: all 0.2s;
}

.calls-contact-card:hover {
    background: #f1f8e9;
    border-color: #c8e6c9;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.08);
}

.calls-contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

.calls-contact-info {
    flex: 1;
    min-width: 0;
}

.calls-contact-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calls-contact-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.calls-contact-badges {
    margin-top: 2px;
}

.calls-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 8px;
    display: inline-block;
}

.calls-badge-sos {
    background: #fff3e0;
}

/* Call Action Buttons */
.calls-contact-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.calls-action-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calls-action-btn:active {
    transform: scale(0.92);
}

.calls-action-audio {
    background: #e8f5e9;
    color: #2e7d32;
}

.calls-action-audio:hover {
    background: #c8e6c9;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.calls-action-video {
    background: #e3f2fd;
    color: #1565c0;
}

.calls-action-video:hover {
    background: #bbdefb;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.2);
}

/* ── Add/Manage Contacts Button ───────────────────────────────────────────── */

.calls-btn {
    border: none;
    border-radius: 14px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calls-btn:active {
    transform: scale(0.97);
}

.calls-btn-secondary {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e0e0e0;
}

.calls-btn-secondary:hover {
    background: #eeeeee;
}

.calls-btn-end {
    background: #ef4444;
    color: white;
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 1rem;
}

.calls-btn-end:hover {
    background: #dc2626;
}

.calls-add-btn {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
}

.calls-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

.calls-empty p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* ── Active Call ──────────────────────────────────────────────────────────── */

.calls-active-call {
    background: #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.calls-active-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
}

.calls-active-pulse {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    animation: callsPulse 1.5s infinite;
}

@keyframes callsPulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.calls-timer {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.calls-jitsi-container {
    width: 100%;
    height: 400px;
    background: #0a0a1a;
}

.calls-jitsi-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.calls-active-actions {
    padding: 0.75rem 1rem;
}

/* ── Call History ─────────────────────────────────────────────────────────── */

.calls-history-section {
    margin-top: 1.5rem;
}

.calls-history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.calls-history-item:last-child {
    border-bottom: none;
}

.calls-history-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.calls-history-name {
    flex: 1;
    font-weight: 500;
    color: #444;
}

.calls-history-time {
    color: #999;
    font-size: 0.8rem;
}

.calls-history-duration {
    color: #666;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    min-width: 3em;
    text-align: right;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .calls-contact-card {
        padding: 0.6rem 0.75rem;
    }

    .calls-action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .calls-jitsi-container {
        height: 300px;
    }

    .calls-contact-avatar {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
}

@media (max-width: 375px) {
    .calls-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
}
