/* Stremin - Audio streaming module
   Integrado con diseño global MP3 Library */

/* Card principal */
.stremin-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
}

.stremin-section {
    padding: 4px 0;
}

.stremin-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botones */
.stremin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

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

.stremin-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.stremin-btn.primary:hover {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.stremin-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c4b5fd;
    flex-shrink: 0;
    padding: 10px 14px;
}

.stremin-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stremin-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    width: 100%;
}

.stremin-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.stremin-btn.mute {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: #34d399;
    width: 100%;
}

.stremin-btn.mute:hover {
    background: rgba(52, 211, 153, 0.2);
}

.stremin-btn.mute.muted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.stremin-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Divider */
.stremin-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

.stremin-divider::before,
.stremin-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

/* Join row */
.stremin-join-row {
    display: flex;
    gap: 8px;
}

.stremin-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    min-width: 0;
    transition: border-color 0.2s;
}

.stremin-input:not(:placeholder-shown) {
    border-color: #8b5cf6;
}

.stremin-input::placeholder {
    letter-spacing: 3px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.stremin-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

/* Info pills */
.stremin-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.stremin-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Room view */
.room-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.room-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.room-badge.broadcaster {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.room-badge.listener {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.room-code-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.room-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-code-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Input nombre de sala */
.stremin-input-name {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 10px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.stremin-input-name::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.stremin-input-name:focus {
    border-color: #8b5cf6;
}

.room-code {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 5px;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

#visualizer {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.room-status {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-align: center;
}

.room-status.live {
    color: #34d399;
}

.room-peers-mini {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 12px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Volume control */
.volume-control {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.volume-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.volume-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.volume-value {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a78bfa;
    font-family: 'Courier New', monospace;
}

.volume-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2px solid #a78bfa;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2px solid #a78bfa;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.volume-marks {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
}

/* Audio output toggle (altavoz/auricular) */
.audio-output-section {
    margin-bottom: 12px;
}

.audio-output-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.audio-output-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.audio-output-btn.active {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.audio-output-btn.active[data-output="earpiece"] {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
}

.audio-output-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.room-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Pulse animation for live */
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.room-status.live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse-live 1.5s infinite;
}

/* Share button (header) */
.stremin-btn-share {
    margin-left: auto;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.stremin-btn-share:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
}

/* Share link box */
.share-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.share-link-row {
    display: flex;
    gap: 6px;
}

.share-link-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    color: #a78bfa;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    outline: none;
    min-width: 0;
    -webkit-user-select: all;
    user-select: all;
}

/* Modal nombre de sala */
.stremin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 16px;
}

.stremin-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.stremin-modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.2rem;
}

.stremin-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.stremin-modal-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.stremin-modal .stremin-input-name {
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.stremin-modal-btns {
    display: flex;
    gap: 8px;
}

/* Visibility toggle (privada/abierta) */
.stremin-visibility-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vis-option {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.vis-option.active {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.vis-option:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

/* Live rooms list */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse-live 1.5s infinite;
    flex-shrink: 0;
}

.live-room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.live-room-item:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

.live-room-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-room-icon i {
    color: #f87171;
    font-size: 0.85rem;
}

.live-room-info {
    flex: 1;
    min-width: 0;
}

.live-room-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-room-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.live-room-join {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.live-room-join:hover {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

/* Main container: centered lobby, wide room */
.stremin-main {
    max-width: 32rem; /* max-w-lg default for lobby */
    margin: 0 auto;
    transition: max-width 0.3s;
}

.stremin-main:has(#room[style*="display: none"]),
.stremin-main:has(#room[style="display:none"]) {
    max-width: 32rem;
}

.stremin-main:has(#room:not([style*="display: none"]):not([style="display:none"])) {
    max-width: 56rem;
}

/* Room two-column layout */
.room-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

/* Sidebar - lista de personas */
.room-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.peer-count-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Peer list */
.peer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 60vh;
    overflow-y: auto;
}

.peer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.peer-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.peer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.peer-avatar.broadcaster-avatar {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.peer-avatar.listener-avatar {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.peer-name {
    font-size: 0.78rem;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Peer controls (mic + speaker icons) */
.peer-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.peer-ctrl-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.peer-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Mic activo = verde */
.peer-ctrl-btn.mic-toggle:not(.off) {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.peer-ctrl-btn.mic-toggle:not(.off):hover {
    background: rgba(52, 211, 153, 0.2);
}

/* Mic apagado = rojo */
.peer-ctrl-btn.mic-toggle.off {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.peer-ctrl-btn.mic-toggle.off:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Mic granted (broadcaster otorgo mic a listener) = verde */
.peer-ctrl-btn.mic-toggle.granted {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.2);
}

.peer-ctrl-btn.mic-toggle.granted:hover {
    background: rgba(52, 211, 153, 0.2);
}

/* Speaker activo = cyan */
.peer-ctrl-btn.speaker-toggle:not(.off) {
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.1);
}

.peer-ctrl-btn.speaker-toggle:not(.off):hover {
    background: rgba(6, 182, 212, 0.2);
}

/* Speaker muteado = rojo */
.peer-ctrl-btn.speaker-toggle.off {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.peer-ctrl-btn.speaker-toggle.off:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Indicador (no clickeable) */
.peer-ctrl-indicator {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
}

.peer-ctrl-indicator:not(.disabled):not(.off) {
    color: rgba(52, 211, 153, 0.5);
}

.peer-ctrl-indicator.off {
    color: rgba(239, 68, 68, 0.4);
}

/* Room content takes remaining space */
.room-content {
    min-width: 0;
}

/* Desktop: hide mini counter (sidebar visible) */
@media (min-width: 641px) {
    .room-peers-mini {
        display: none;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .room-layout {
        grid-template-columns: 1fr;
    }

    .room-sidebar {
        position: static;
        order: -1;
    }

    .peer-list {
        max-height: 25vh;
    }

    .room-peers-mini {
        display: flex;
    }

    .stremin-main:has(#room:not([style*="display: none"]):not([style="display:none"])) {
        max-width: 32rem;
    }
}

@media (max-width: 480px) {
    .stremin-info {
        gap: 10px;
    }
    .share-link-input {
        font-size: 0.65rem;
    }
}

/* ========================================
   TABS: Stremin / Contactos
   ======================================== */
.stremin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.stremin-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.stremin-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.stremin-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
}

/* Sub-tabs: Contactos / Historial */
.contacts-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.contacts-subtab {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.contacts-subtab.active {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}

.contacts-subtab:not(.active):hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   CONTACTS LIST
   ======================================== */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contacts-loading {
    text-align: center;
    padding: 32px 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.contact-item,
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}

.contact-item:hover,
.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Avatar */
.contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 2px solid rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.contact-avatar.online {
    border-color: rgba(52, 211, 153, 0.4);
}

.contact-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34d399;
    border: 2px solid #0a0a0f;
}

.contact-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Contact info */
.contact-info {
    flex: 1;
    min-width: 0;
}

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

.contact-status {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.contact-status.online {
    color: #34d399;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    flex-shrink: 0;
}

/* Action buttons */
.contact-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.contact-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-action-btn.chat-btn {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
}

.contact-action-btn.chat-btn:hover {
    background: rgba(6, 182, 212, 0.25);
    color: #fff;
}

.contact-action-btn.call-btn {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.contact-action-btn.call-btn:hover {
    background: rgba(52, 211, 153, 0.25);
    color: #fff;
}

/* History meta */
.history-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.history-icon {
    font-size: 0.65rem;
}

.history-icon.incoming {
    color: #34d399;
}

.history-icon.outgoing {
    color: #67e8f9;
}

.history-icon.missed {
    color: #f87171;
}

.history-dur {
    color: rgba(255, 255, 255, 0.25);
}

/* ========================================
   CALL SCREEN - Fullscreen overlay
   ======================================== */
.call-screen-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #0f0a1e 0%, #1a0e2e 50%, #0d0817 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 24px;
    width: 100%;
    max-width: 320px;
}

.call-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.2));
    border: 3px solid rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #c4b5fd;
    text-transform: uppercase;
    animation: call-pulse 2s ease-in-out infinite;
}

@keyframes call-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 0 20px rgba(139, 92, 246, 0); }
}

.call-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.call-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.call-timer {
    font-size: 1.1rem;
    font-weight: 600;
    color: #34d399;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Active call controls (mic, speaker) */
.call-active-controls {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.call-ctrl-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s;
}

.call-ctrl-btn span {
    font-size: 0.55rem;
    font-weight: 600;
    opacity: 0.6;
}

.call-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.call-ctrl-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Call action buttons (hang up, accept, decline) */
.call-actions {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.call-btn-hang,
.call-btn-decline {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
}

.call-btn-hang:hover,
.call-btn-decline:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(239, 68, 68, 0.5);
}

.call-btn-accept {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    transition: all 0.2s;
    animation: call-accept-pulse 1.5s ease-in-out infinite;
}

@keyframes call-accept-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(34, 197, 94, 0.6); }
}

.call-btn-accept:hover {
    transform: scale(1.05);
}

/* Call screen responsive */
@media (max-height: 600px) {
    .call-screen {
        padding: 20px 24px;
        gap: 8px;
    }
    .call-avatar {
        width: 72px;
        height: 72px;
        font-size: 1.5rem;
    }
    .call-actions {
        margin-top: 20px;
    }
}
