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

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;
  --accent: #8b5cf6;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background: var(--bg-dark);
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(236, 72, 153, 0.1) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

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

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.glass {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .glass {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.container {
  width: 100%;
  max-width: 450px;
  padding: 40px;
  animation: fadeIn 0.8s ease-out;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 20px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

button {
  width: 100%;
  padding: 14px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

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

.link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.link a:hover {
  color: var(--secondary);
}

/* Dashboard Layout */
.dashboard-grid {
  width: 95%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  height: 90vh;
  animation: fadeIn 0.8s ease-out;
}

.sidebar {
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.main-view {
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  margin-bottom: 24px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-connected {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.dot-disconnected {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.qr-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
}

.qr-card img {
  max-width: 100%;
}

.chat-container {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Firefox scrollbar support */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Chrome/Safari/Edge scrollbar support */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.message {
  padding: 12px 18px;
  border-radius: 16px;
  max-width: 80%;
  line-height: 1.5;
  position: relative;
}

.msg-received {
  background: rgba(255, 255, 255, 0.05);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-sent {
  background: var(--gradient);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.msg-sent .msg-meta {
  color: rgba(255, 255, 255, 0.7);
}