@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0a0b0f;
  --card-bg: rgba(22, 24, 33, 0.7);
  --accent-primary: #4f7cff;
  --accent-secondary: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-dark);
  background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark)),
    radial-gradient(circle at bottom left, #1e1b4b, var(--bg-dark));
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  z-index: 1;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, var(--accent-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

.call-timer {
  margin-top: 15px;
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-secondary);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

/* Visualizer Section */
.visualizer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  margin-bottom: 40px;
  position: relative;
}

.visualizer-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(79, 124, 255, 0.1);
  border: 2px solid var(--accent-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.3s ease;
}

.visualizer-circle.active {
  box-shadow: 0 0 30px var(--accent-primary);
  transform: scale(1.05);
}

.visualizer-circle.speaking {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 40px var(--accent-secondary);
}

.wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0;
}

.active .wave {
  animation: ripple 2s infinite;
}

.speaking .wave {
  border-color: var(--accent-secondary);
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.mic-icon {
  font-size: 3rem;
  z-index: 2;
}

/* Status Section */
.status-section {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.ready {
  background: var(--success);
}

.status-dot.connecting {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.status-dot.connected {
  background: var(--accent-primary);
}

.status-dot.listening {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-dot.speaking {
  background: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-secondary);
}

.status-dot.error {
  background: var(--danger);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.btn {
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 10px 20px -5px rgba(79, 124, 255, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(79, 124, 255, 0.5);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* Info Section */
.info-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  padding-top: 30px;
  border-top: 1px solid var(--glass-border);
}

.info-item {
  text-align: center;
}

.info-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.info-value {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Credits Badge */
.credits-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(79, 124, 255, 0.1);
  border: 1px solid var(--glass-border);
  padding: 6px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
}

.admin-badge {
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-badge {
  color: #94a3b8;
  font-weight: 400;
  border-right: 1px solid var(--glass-border);
  padding-right: 10px;
}

/* Logout */
.logout-form {
  position: absolute;
  top: 20px;
  left: 20px;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-logout:hover {
  color: var(--text-main);
}

/* Form Styles */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.1);
}

.error-message {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 6px;
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.form-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .card {
    padding: 30px 20px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .info-section {
    grid-template-columns: 1fr;
  }
}

/* Loading */
.loading {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}