/* ═══════════════════════════════════════════════
   GLOBAL CALL SYSTEM — v1.0
   Incoming overlay · Mini widget · Ended toast
═══════════════════════════════════════════════ */

/* ───────────────────────────────────────────────
   1. GELEN ARAMA OVERLAY  (tüm sayfalarda)
─────────────────────────────────────────────── */
#gcall-incoming {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;          /* Varsayılan: gizli — JS ile açılır */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
/* Sadece gerçek arama varken JS gcall-visible ekler */
#gcall-incoming.gcall-visible {
    display: flex;
    animation: gcall-fade-in .22s ease;
}

.gcall-card {
    position: relative;
    background: linear-gradient(145deg, #131320 0%, #0d0d1a 100%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 28px;
    padding: 36px 32px 32px;
    width: 320px;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 40px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
    animation: gcall-slide-up .3s cubic-bezier(.34,1.56,.64,1);
}

/* Üst parlayan çizgi */
.gcall-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,107,43,.6), transparent);
    border-radius: 999px;
}

/* Avatar + ring animasyonu */
.gcall-ava-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
}
.gcall-ava-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,107,43,.5);
    animation: gcall-ring-pulse 1.4s ease-in-out infinite;
}
.gcall-ava-ring-2 {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 2px solid rgba(255,107,43,.2);
    animation: gcall-ring-pulse 1.4s ease-in-out .35s infinite;
}
.gcall-ava-img,
.gcall-ava-ph {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #ff6b2b, #ff3d00);
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255,107,43,.4);
}

/* Tip rozeti */
.gcall-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,107,43,.12);
    border: 1px solid rgba(255,107,43,.25);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 700;
    color: #ff8b52;
    margin-bottom: 10px;
    letter-spacing: .02em;
}

/* İsim */
.gcall-caller-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    letter-spacing: -.02em;
}
.gcall-caller-sub {
    font-size: .8rem;
    color: rgba(255,255,255,.4);
    margin: 0 0 24px;
}

/* Buton grubu */
.gcall-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}
.gcall-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.gcall-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, box-shadow .15s;
    outline: none;
}
.gcall-circle:active { transform: scale(.92); }
.gcall-accept .gcall-circle {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 24px rgba(34,197,94,.35);
    animation: gcall-accept-pulse 2s ease-in-out infinite;
}
.gcall-accept .gcall-circle:hover { box-shadow: 0 12px 32px rgba(34,197,94,.5); }
.gcall-decline .gcall-circle {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 24px rgba(239,68,68,.3);
}
.gcall-decline .gcall-circle:hover { box-shadow: 0 12px 32px rgba(239,68,68,.45); }
.gcall-btn-label {
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    letter-spacing: .02em;
}

/* E2E badge */
.gcall-e2e {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .68rem;
    color: rgba(255,255,255,.25);
}

/* ───────────────────────────────────────────────
   2. AKTİF ARAMA MİNİ WIDGET  (aynı sayfa - minimize)
─────────────────────────────────────────────── */
#gcall-mini {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9998;
    display: none;          /* Varsayılan: gizli */
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(10,10,20,.92);
    border: 1px solid rgba(255,107,43,.3);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    min-width: 200px;
    max-width: 280px;
}
/* Sadece arama aktifken göster */
#gcall-mini.gcall-visible {
    display: flex;
    animation: gcall-slide-down .3s cubic-bezier(.34,1.56,.64,1);
}
#gcall-mini:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(0,0,0,.6); }

.gcall-mini-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(34,197,94,.7);
    animation: gcall-dot-pulse 1.5s ease-in-out infinite;
}
.gcall-mini-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,107,43,.4);
}
.gcall-mini-ava-ph {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg,#ff6b2b,#ff3d00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,107,43,.4);
}
.gcall-mini-info {
    flex: 1;
    min-width: 0;
}
.gcall-mini-name {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.gcall-mini-timer {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.gcall-mini-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.gcall-mini-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
}
.gcall-mini-btn:active { transform: scale(.88); }
.gcall-mini-btn-max {
    background: rgba(255,107,43,.18);
    color: #ff8b52;
}
.gcall-mini-btn-max:hover { background: rgba(255,107,43,.3); }
.gcall-mini-btn-end {
    background: rgba(239,68,68,.18);
    color: #f87171;
}
.gcall-mini-btn-end:hover { background: rgba(239,68,68,.3); }

/* ───────────────────────────────────────────────
   3. ARAMA BİTTİ TOAST
─────────────────────────────────────────────── */
#gcall-ended-toast {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(15,15,25,.96);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    max-width: 280px;
    animation: gcall-slide-down .3s cubic-bezier(.34,1.56,.64,1);
    transition: opacity .4s;
}
#gcall-ended-toast.gcall-hidden {
    opacity: 0;
    pointer-events: none;
}
.gcall-toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.gcall-toast-body {
    flex: 1;
    min-width: 0;
}
.gcall-toast-title {
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
}
.gcall-toast-sub {
    font-size: .7rem;
    color: rgba(255,255,255,.4);
}
.gcall-toast-retry {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255,107,43,.15);
    border: 1px solid rgba(255,107,43,.3);
    color: #ff8b52;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.gcall-toast-retry:hover { background: rgba(255,107,43,.3); color: #fff; }
.gcall-toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
}
.gcall-toast-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ───────────────────────────────────────────────
   4. ANIMATIONS
─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gcall-fade-in  { from { opacity:0 } to { opacity:1 } }
@keyframes gcall-fade-out { to   { opacity:0 } }
@keyframes gcall-slide-up {
    from { opacity:0; transform: translateY(28px) scale(.95) }
    to   { opacity:1; transform: translateY(0)     scale(1)  }
}
@keyframes gcall-slide-down {
    from { opacity:0; transform: translateY(-20px) scale(.94) }
    to   { opacity:1; transform: translateY(0)     scale(1)  }
}
@keyframes gcall-ring-pulse {
    0%,100% { transform: scale(1);    opacity:.7; }
    50%      { transform: scale(1.12); opacity:.3; }
}
@keyframes gcall-accept-pulse {
    0%,100% { box-shadow: 0 8px 24px rgba(34,197,94,.35); }
    50%      { box-shadow: 0 8px 36px rgba(34,197,94,.6);  }
}
@keyframes gcall-dot-pulse {
    0%,100% { box-shadow: 0 0 8px  rgba(34,197,94,.7); }
    50%      { box-shadow: 0 0 14px rgba(34,197,94,1);  }
}

/* ───────────────────────────────────────────────
   5. MINIMIZE BUTONU (conversation.php içinde)
─────────────────────────────────────────────── */
#call-minimize-btn {
    position: absolute;
    top: 14px;
    right: 60px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    z-index: 10;
}
#call-minimize-btn:hover { background: rgba(255,255,255,.12); color:#fff; }

/* Mobil — overlay ve widget ayarları */
@media (max-width: 480px) {
    .gcall-card { padding: 28px 20px 24px; width: 300px; }
    #gcall-mini { top: 10px; right: 10px; min-width: 180px; }
    #gcall-ended-toast { right: 10px; left: 10px; max-width: none; }
}
