/* public/css/call/call-base.css */
/* ============================================= */
/* CALL MODULE – BASE STYLES (с премиальными анимациями) */
/* ============================================= */

:root {
    /* Размеры и отступы */
    --call-pip-width: 180px;
    --call-pip-height: 240px;
    --call-pip-mobile-width: 100px;
    --call-pip-mobile-height: 120px;
    --call-grid-min: 320px;
    --call-controls-gap: 24px;
    --call-btn-size: 56px;
    --call-btn-mobile-size: 48px;

    /* Цвета (стеклянные) */
    --call-overlay-bg: rgba(0, 0, 0, 0.85);
    --call-container-bg: #0a0a0a;
    --call-glass-bg: rgba(255, 255, 255, 0.08);
    --call-glass-border: rgba(255, 255, 255, 0.15);
    --call-glass-hover: rgba(255, 255, 255, 0.2);

    /* Анимации */
    --call-transition: 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    --call-transition-slow: 0.3s ease;
}

body.light-theme {
    --call-overlay-bg: rgba(255, 255, 255, 0.9);
    --call-container-bg: #f5f5f5;
    --call-glass-bg: rgba(0, 0, 0, 0.04);
    --call-glass-border: rgba(0, 0, 0, 0.1);
    --call-glass-hover: rgba(0, 0, 0, 0.08);
}

/* Оверлей */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--call-overlay-bg);
    backdrop-filter: blur(20px);
    z-index: calc(var(--z-modal) + 1000);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: callFadeIn 0.25s ease;
}

/* Контейнер */
.call-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--call-container-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Кнопка сворачивания */
.minimize-btn {
    position: absolute;
    top: 16px;
    left: 20px;
    background: var(--call-glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--call-glass-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 30;
    transition: all var(--call-transition);
}

.minimize-btn:hover {
    background: var(--call-glass-hover);
    transform: scale(1.05);
}

/* Видео-элементы */
.call-remote-video {
    flex: 1;
    background: #1a1a1a;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remote-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-local-pip {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: var(--call-pip-width);
    height: var(--call-pip-height);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--call-glass-border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: #000;
    cursor: pointer;
    transition: transform var(--call-transition), border-color var(--call-transition);
    z-index: 10;
}

.call-local-pip:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

/* Плейсхолдер */
.call-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    text-align: center;
}

.placeholder-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.placeholder-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.placeholder-status {
    font-size: 16px;
    opacity: 0.8;
}

/* Анимации */
@keyframes callFadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(20px); }
}

@keyframes callPulse {
    0% { transform: scale(1); opacity: 0.7; text-shadow: 0 0 0 rgba(76, 154, 255, 0); }
    50% { transform: scale(1.02); opacity: 1; text-shadow: 0 0 12px rgba(76, 154, 255, 0.5); }
    100% { transform: scale(1); opacity: 0.7; text-shadow: 0 0 0 rgba(76, 154, 255, 0); }
}

@keyframes btnPulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 154, 255, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(76, 154, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 154, 255, 0); }
}

.call-overlay--incoming .call-placeholder {
    animation: callPulse 1.5s infinite;
}

.call-btn.accept {
    animation: btnPulse 1.5s infinite;
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .call-overlay, .call-local-pip, .call-btn, .minimize-btn {
        animation: none;
        transition: none;
    }
    .call-overlay--incoming .call-placeholder { animation: none; }
    .call-btn.accept { animation: none; }
}

.call-btn {
    position: relative;
}
.btn-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}
.call-btn:hover .btn-tooltip {
    opacity: 1;
}