/* =====================
   GLOBAL
===================== */
* {
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #020617, #000);
  color: #e5e7eb;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================
   BACKGROUND ORBS
===================== */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  pointer-events: none;
}

.orb1 {
  width: 380px;
  height: 380px;
  background: #2563eb;
  top: -140px;
  left: -140px;
}

.orb2 {
  width: 460px;
  height: 460px;
  background: #22d3ee;
  bottom: -200px;
  right: -200px;
}

/* =====================
   LOGIN / LANDING
===================== */
.glass-card {
  position: relative;
  background: rgba(15, 23, 42, 0.88);
  padding: 42px;
  border-radius: 22px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.85);
  backdrop-filter: blur(14px);
  width: 360px;
  text-align: center;
  z-index: 2;
}

.brand-title {
  font-size: 38px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 26px;
  line-height: 1.6;
}

.footer-text {
  margin-top: 18px;
  font-size: 11px;
  color: #64748b;
}

#login input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 15px;
  margin-bottom: 14px;
}

#login button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  font-weight: 600;
  transition: transform 0.2s ease;
}

#login button:hover {
  transform: translateY(-2px);
}

/* =====================
   APP CONTAINER
===================== */
.app-container {
  width: 94vw;
  max-width: 1250px;
  height: 88dvh;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.96),
    rgba(2, 6, 23, 0.88)
  );
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 50px 140px rgba(0,0,0,0.9);
  backdrop-filter: blur(14px);
}

/* =====================
   HEADER
===================== */
.app-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.subtitle {
  font-size: 12px;
  color: #94a3b8;
}

.status-dot {
  color: #22c55e;
  font-size: 13px;
}

/* =====================
   MAIN LAYOUT
===================== */
.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* =====================
   USERS PANEL
===================== */
.users-panel {
  width: 240px;
  padding: 18px;
  border-right: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.45);
}

.users-panel h3 {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 14px;
}

.users-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.users-panel li {
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.users-panel li:hover {
  background: rgba(30,41,59,0.85);
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #020617;
}

/* =====================
   VIDEO PANEL
===================== */
.video-panel {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at center, #020617, #000);
  overflow: hidden;
}

/* REMOTE VIDEO */
#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* LOCAL VIDEO (PiP) */
#localVideo {
  position: absolute;
  bottom: 110px;
  right: 20px;
  width: 220px;
  height: 140px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  background: black;
  z-index: 4;
}

/* DEFAULT VIDEO HIDDEN */
#remoteVideo,
#localVideo {
  display: none;
}

/* =====================
   CONTROLS
===================== */
.controls {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.controls button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 18px;
  background: #1e293b;
  color: white;
}

.controls .end {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* =====================
   IDLE STATE
===================== */
.idle-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.idle-content {
  max-width: 360px;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.idle-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.idle-content h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.idle-content h2 span {
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.idle-content p {
  font-size: 14px;
  color: #94a3b8;
}

/* =====================
   CALL STATUS OVERLAY
===================== */
.call-status {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  backdrop-filter: blur(6px);
}

.ringing {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ringing p {
  margin-top: 14px;
  font-size: 16px;
}

.pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #60a5fa, #2563eb);
  animation: pulse 1.4s infinite;
}

/* =====================
   CALL TIMER
===================== */
.call-timer {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  background: rgba(0,0,0,0.6);
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 5;
}

/* =====================
   ANIMATIONS
===================== */
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(1.15); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================
   MOBILE RESPONSIVE
===================== */
@media (max-width: 768px) {

  body {
    align-items: stretch;
    justify-content: stretch;
  }

  .app-container {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .main-content {
    flex-direction: column;
  }

  .users-panel {
    width: 100%;
    max-height: 70px;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid #1e293b;
  }

  .users-panel h3 {
    display: none;
  }

  .users-panel ul {
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }

  .video-panel {
    flex: 1;
    min-height: 0;
  }

  #localVideo {
    width: 130px;
    height: 95px;
    bottom: 80px;
    right: 12px;
  }

  .controls {
    bottom: 14px;
  }
}

/* =====================
   EXTRA SMALL
===================== */
@media (max-width: 420px) {

  #localVideo {
    width: 110px;
    height: 80px;
  }

  .controls button {
    width: 46px;
    height: 46px;
    font-size: 16px;
  }
}
