/* Reset & Variables */
:root {
  --bg-color: #f8fafc;
  --text-color: #0f172a;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-panel: #ffffff;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #10b981;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --bg-panel: #1e293b;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.3s,
    color 0.3s;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links a,
.nav-links button {
  margin-left: 1rem;
  text-decoration: none;
  background: transparent;
  color: var(--text-color);
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff !important;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff !important;
}

.btn-danger {
  background-color: var(--error);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.text-center {
  text-align: center;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-4 {
  margin-top: 2rem;
}

/* Landing Page Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(147, 51, 234, 0.1) 100%
  );
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

/* Auth Cards */
.auth-card {
  max-width: 400px;
  margin: 4rem auto;
  background: var(--bg-panel);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease forwards;
  max-width: 300px;
}

.toast.success {
  background: var(--success);
}
.toast.error {
  background: var(--error);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 300px 1fr;
  }
}

.panel {
  background: var(--bg-panel);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Call UI */
.call-ui {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: var(--bg-panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.call-ui.active {
  display: flex;
}

.audio-waves {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 100px;
  margin-bottom: 2rem;
}

.bar {
  width: 8px;
  background: var(--primary);
  border-radius: 4px;
  animation: bounce 1s ease-in-out infinite;
}

.bar:nth-child(1) {
  height: 20px;
  animation-delay: 0s;
}
.bar:nth-child(2) {
  height: 50px;
  animation-delay: 0.1s;
}
.bar:nth-child(3) {
  height: 80px;
  animation-delay: 0.2s;
}
.bar:nth-child(4) {
  height: 50px;
  animation-delay: 0.3s;
}
.bar:nth-child(5) {
  height: 20px;
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1);
  }
}

.call-controls {
  display: flex;
  gap: 1rem;
}

.call-controls button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: white;
}

.btn-mute {
  background: #64748b;
}
.btn-mute.muted {
  background: var(--error);
}
.btn-hangup {
  background: var(--error);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-panel);
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 1.5rem;
}

.hidden {
  display: none !important;
}

/* Features section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
}

.feature-card {
  background: var(--bg-panel);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.feature-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
