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

:root {
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  --accent-start: #3b82f6; /* Electric blue */
  --accent-end: #8b5cf6; /* Deep violet */
  --success: #10b981;
  --error: #ef4444;
  --font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

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

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: linear-gradient(-45deg, #090a0f, #130f1c, #0a1118, #050505);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  overflow-x: hidden;
  position: relative;
}

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

/* Blurred orbs for background depth and glass refraction */
body::before, body::after {
  content: '';
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.3;
  animation: float 20s infinite alternate ease-in-out;
  pointer-events: none;
}

body::before {
  background: var(--accent-start);
  top: -10%;
  left: -10%;
}

body::after {
  background: var(--accent-end);
  bottom: -10%;
  right: -10%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 100px); }
}

/* Glass Panel Container */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateZ(0); /* Hardware acceleration for smooth blur */
}

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

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

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

.controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.join-group {
  display: flex;
  gap: 12px;
}

/* Premium Inputs */
.glass-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0; /* Prevents flex blowout */
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.glass-input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 12px rgba(139, 92, 246, 0.25);
  background: rgba(0, 0, 0, 0.3);
}

/* Premium Buttons */
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-highlight);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Room Info */
.room-info {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.room-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.room-info h2 {
  font-size: 2.5rem;
  letter-spacing: 0.2em;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  margin: 8px 0;
}

/* Connection Status Indicator */
.status {
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.status.info { color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
.status.success { color: var(--success); border-color: rgba(16, 185, 129, 0.3); }
.status.error { color: var(--error); border-color: rgba(239, 68, 68, 0.3); }

/* File Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.drop-zone:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.drop-zone.dragover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-end);
  animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
  0% { border-color: rgba(139, 92, 246, 0.4); }
  50% { border-color: rgba(139, 92, 246, 1); }
  100% { border-color: rgba(139, 92, 246, 0.4); }
}

.drop-zone.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(100%);
}

.drop-zone svg {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drop-zone:hover:not(.disabled) svg {
  transform: scale(1.05);
  color: var(--text-primary);
}

.drop-zone p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Transfer Progress Bar */
.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.hidden {
  display: none !important;
}
