:root {
  --bg: #0f1724;
  --card: #0b1220;
  --accent: #22c55e;
  --accent-glow: rgba(34, 197, 94, 0.5);
  --muted: #9aa4b2;
  --glass: rgba(255, 255, 255, 0.03);
  --white: #e6eef7;
  --shadow-dark: rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #041024, #071428, #081732, #0f1724);
  background-size: 400% 400%;
  animation: bgAnimate 20s ease infinite;
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@keyframes bgAnimate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: 920px;
  max-width: 96%;
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px var(--shadow-dark), 0 0 40px var(--accent-glow);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.04);
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1.2px;
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}

.me {
  display: flex;
  gap: 12px;
  align-items: center;
}

.me input {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--white);
  padding: 10px 12px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 8px rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}

.me input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  outline: none;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 16px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 0 20px rgba(0,0,0,0.4) inset;
}

.controls input {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.03);
  transition: all 0.3s ease;
}

.controls input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  outline: none;
}

.controls button {
  background: var(--accent);
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  color: #072018;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.controls button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px var(--accent-glow);
}

.status-row {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* ========== CALL UI ========== */
.call-ui {
  margin-top: 16px;
  position: relative;
}

.modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.modal p {
  font-size: 1rem;
  margin-bottom: 8px;
  text-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  padding: 8px 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #072018;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

.modal-actions button:hover {
  transform: scale(1.1);
}

/* In-call UI */
.in-call {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.03);
  margin-top: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.call-controls button {
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
}

.call-controls button:hover {
  background: var(--accent);
  color: #072018;
  box-shadow: 0 0 12px var(--accent-glow);
}

.fallback {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.fallback button {
  padding: 8px 14px;
  border-radius: 12px;
  border: none;
  background: #facc15;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px #facc15;
}

#recordStatus {
  color: var(--muted);
  font-size: 13px;
  margin-left: 8px;
}

/* Call History */
.call-history {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-history div {
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 8px rgba(255,255,255,0.05);
}

.call-history div span {
  font-size: 0.85rem;
}

.call-history div button {
  background: red;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.call-history div button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px red;
}

footer {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Hidden class */
.hidden { display:none; }

/* Responsive */
@media(max-width:480px){
  .container { padding:12px; }
  header h1 { font-size:1.6rem; }
  .controls input, .me input { padding:8px; }
  .controls button, .call-controls button { padding:6px 10px; }
}
