/* ===== Panggilan (masuk & berlangsung) ===== */
.call-screen {
  position: absolute; inset: 0; z-index: 85; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 24px 44px; text-align: center;
  background: linear-gradient(175deg, #7b7463 0%, #5b5f63 45%, #33455a 100%);
  animation: csIn .4s cubic-bezier(.2, .8, .2, 1) both;
  transition: opacity .3s ease, background .4s ease;
}
.call-screen.active { background: linear-gradient(#1b1b1f, #0b0b0d); }
.call-screen.out { opacity: 0; }
@keyframes csIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* Panggilan masuk */
.call-screen.incoming { justify-content: space-between; }
.cs-kind { font-size: 16px; color: rgba(255, 255, 255, .7); }
.cs-name { font-size: 32px; font-weight: 700; margin-top: 6px; }
.cs-extra { display: flex; gap: 70px; }
.cs-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; }
.cs-mini-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 24px;
}
.cs-bottom { width: 100%; display: flex; justify-content: space-around; }
.cs-act { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 15px; }
.cs-circle {
  width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .35);
}
.cs-circle.decline { background: #d92b2b; }
.cs-circle.accept { background: #1e63d6; }
.cs-circle:active { transform: scale(.94); }

/* Panggilan berlangsung */
.cs-top { display: flex; flex-direction: column; align-items: center; }
.cs-timer { font-size: 16px; color: rgba(255, 255, 255, .7); margin-top: 6px; font-variant-numeric: tabular-nums; }
.cs-avatar {
  width: 220px; height: 220px; border-radius: 50%; margin-top: 36px;
  background-size: cover; background-position: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.cs-lines {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; max-width: 320px; min-height: 130px; margin-top: 30px;
}
.cs-line {
  max-width: 100%; background: rgba(255, 255, 255, .14);
  padding: 8px 14px; border-radius: 16px; font-size: 16px; line-height: 1.35;
  animation: lineIn .35s ease both;
}
@keyframes lineIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.cs-controls {
  margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px 10px; width: 100%; max-width: 330px;
}
.cs-ctrl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.cs-ctrl-circle {
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 24px;
}
.cs-ctrl-circle.end { background: #d0021b; }
/* Video call support */
.call-screen.video-call {
  background: #000;
  position: relative;
  overflow: hidden;
}
.call-screen.video-call .cs-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.call-screen.video-call .cs-top,
.call-screen.video-call .cs-lines,
.call-screen.video-call .cs-controls {
  position: relative;
  z-index: 2;
}
.call-screen.video-call .cs-lines {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
}
.call-screen.video-call .cs-line {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 18px;
  max-width: 85%;
  text-align: center;
}

/* ===== Full-screen video call fix ===== */
.call-screen.video-call {
  padding: 0 !important;
  background: #000 !important;
  display: block !important;
  overflow: hidden !important;
}
.call-screen.video-call .cs-video-wrap {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
}
.call-screen.video-call .cs-video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  z-index: 0 !important;
}
.call-screen.video-call .cs-video-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none;
}
.call-screen.video-call .cs-top {
  position: absolute !important;
  top: 54px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  padding: 12px 16px;
}
.call-screen.video-call .cs-lines {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 140px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: auto;
  margin: 0;
  padding: 0 16px;
}
.call-screen.video-call .cs-controls {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 2;
  margin: 0 auto;
  max-width: 340px;
}

/* Pastikan tombol video call bisa diklik */
.call-screen {
  z-index: 200 !important;
  pointer-events: auto !important;
}
.call-screen .cs-circle,
.call-screen .cs-act,
.call-screen .cs-bottom,
.call-screen .cs-ctrl-circle,
.call-screen button {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,255,255,0.3);
  cursor: pointer;
  position: relative;
  z-index: 210;
}
.call-screen .cs-bottom {
  position: relative;
  z-index: 210;
  padding-bottom: 12px;
}

/* Video wajib full layar saat accept */
.call-screen.video-call .cs-video-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #000;
  z-index: 0 !important;
}
.call-screen.video-call .cs-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  background: #000;
  z-index: 0 !important;
}
.call-screen.video-call .cs-video-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 28%, transparent 58%, rgba(0,0,0,0.6) 100%);
}
.call-screen.video-call .cs-top,
.call-screen.video-call .cs-lines,
.call-screen.video-call .cs-controls {
  position: absolute !important;
  z-index: 5 !important;
  pointer-events: none;
}
.call-screen.video-call .cs-controls {
  pointer-events: auto !important;
}
.call-screen.video-call .cs-controls button,
.call-screen.video-call .cs-ctrl-circle {
  pointer-events: auto !important;
}

/* ===== Realistic Video Call UI ===== */
.vcall-root {
  position: absolute;
  inset: 0;
  z-index: 300;
  background: #000;
  animation: vcallIn .35s ease both;
}
.vcall-root.out {
  opacity: 0;
  transition: opacity .25s ease;
}
@keyframes vcallIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
.vcall-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.vcall-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #111;
}
.vcall-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, transparent 28%, transparent 60%, rgba(0,0,0,.65) 100%);
}
.vcall-top {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.vcall-name {
  font-size: 22px;
  font-weight: 700;
}
.vcall-status, .vcall-timer {
  margin-top: 6px;
  font-size: 14px;
  opacity: .9;
}
.vcall-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 140px;
  z-index: 2;
  text-align: center;
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
.vcall-caption.show {
  opacity: 1;
  transform: none;
}
.vcall-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  display: flex;
  justify-content: center;
  gap: 28px;
  z-index: 3;
}
.vcall-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: manipulation;
}
.vcall-btn.end {
  background: #ff3b30;
  font-size: 26px;
}
.vcall-btn:active {
  transform: scale(.94);
}

.line-vcall-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 20;
  border: none;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #06c755;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  pointer-events: auto;
  touch-action: manipulation;
}
.line-vcall-btn:active {
  transform: scale(.96);
}

.vcall-root {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  background: #000 !important;
  pointer-events: auto !important;
}
.vcall-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #111 !important;
  z-index: 0 !important;
}
.vcall-controls,
.vcall-btn {
  pointer-events: auto !important;
  z-index: 5 !important;
}

/* ===== UI Video Call lebih jelas (FaceTime-like) ===== */
.vcall-root {
  position: absolute !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: #0a0a0a !important;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.vcall-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.vcall-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  background: #1a1a1a !important;
}
.vcall-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 22%, transparent 40%),
    linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.25) 28%, transparent 50%);
  z-index: 1;
}
.vcall-top {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  padding: 0 20px;
}
.vcall-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}
.vcall-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.vcall-status,
.vcall-timer {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.vcall-selfcam {
  position: absolute;
  top: 118px;
  right: 16px;
  width: 96px;
  height: 132px;
  border-radius: 16px;
  background: #1c1c1e;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 3;
  overflow: hidden;
}
.vcall-selfcam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
  background: #111;
}
.vcall-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 168px;
  z-index: 3;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 10px 14px;
  max-width: 320px;
  margin: 0 auto;
}
.vcall-caption.show {
  opacity: 1;
  transform: none;
}
.vcall-caption:empty {
  display: none;
}
.vcall-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  pointer-events: auto;
}
.vcall-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}
.vcall-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: transparent;
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  pointer-events: auto !important;
  touch-action: manipulation;
}
.vcall-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 26px;
  background: #fff;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
/* mic */
.vcall-btn.mute::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14a3 3 0 003-3V6a3 3 0 10-6 0v5a3 3 0 003 3zm5-3a5 5 0 01-10 0H5a7 7 0 0014 0h-2zm-5 9a1 1 0 01-1-1v-2h2v2a1 1 0 01-1 1z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14a3 3 0 003-3V6a3 3 0 10-6 0v5a3 3 0 003 3zm5-3a5 5 0 01-10 0H5a7 7 0 0014 0h-2zm-5 9a1 1 0 01-1-1v-2h2v2a1 1 0 01-1 1z'/%3E%3C/svg%3E");
}
/* end */
.vcall-btn.end {
  background: #ff3b30;
  width: 76px;
  height: 76px;
}
.vcall-btn.end::before {
  width: 28px;
  height: 28px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.6 10.8c1.3 2.6 3.4 4.7 6 6l2-2a1 1 0 011.1-.2c1.2.4 2.5.6 3.8.6a1 1 0 011 1V20a1 1 0 01-1 1C11.3 21 3 12.7 3 3a1 1 0 011-1h3.8a1 1 0 011 1c0 1.3.2 2.6.6 3.8a1 1 0 01-.2 1.1l-2 2z' transform='rotate(135 12 12)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.6 10.8c1.3 2.6 3.4 4.7 6 6l2-2a1 1 0 011.1-.2c1.2.4 2.5.6 3.8.6a1 1 0 011 1V20a1 1 0 01-1 1C11.3 21 3 12.7 3 3a1 1 0 011-1h3.8a1 1 0 011 1c0 1.3.2 2.6.6 3.8a1 1 0 01-.2 1.1l-2 2z' transform='rotate(135 12 12)'/%3E%3C/svg%3E");
}
/* cam */
.vcall-btn.cam::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 8a4 4 0 100 8 4 4 0 000-8zm8-2h-2.2l-1.2-1.6A2 2 0 0015 3.5H9a2 2 0 00-1.6.9L6.2 6H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 8a4 4 0 100 8 4 4 0 000-8zm8-2h-2.2l-1.2-1.6A2 2 0 0015 3.5H9a2 2 0 00-1.6.9L6.2 6H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2z'/%3E%3C/svg%3E");
}
.vcall-btn:active {
  transform: scale(0.94);
}

/* Voice-only call */
.vcall-root.voice-only .voice-stage {
  background: radial-gradient(ellipse at center, #2a2a40 0%, #0d0d14 70%);
}
.vcall-root.voice-only .voice-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(179,199,255,0.25), transparent 55%);
  pointer-events: none;
}
.vcall-root.voice-only .voice-av {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 18px auto 12px;
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255,255,255,0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.vcall-root.voice-only .vcall-top {
  top: 100px;
}
