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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  --gradient-1: #6c63ff;
  --gradient-2: #ff6584;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(108, 99, 255, 0.08) 0%, transparent 60%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

input {
  font-family: inherit;
  outline: none;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, background 0.3s;
}

.glass-card:hover {
  border-color: var(--border-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(108, 99, 255, 0.5);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

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

.btn-danger:hover {
  background: rgba(255, 71, 87, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.3s, background 0.3s;
}

.input-field:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.header {
  text-align: center;
  padding: 60px 20px 40px;
}

.header-title {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 400px;
  margin: 0 auto;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 0 60px;
}

.landing-card {
  padding: 36px;
  text-align: center;
}

.landing-card h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.landing-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.landing-card .btn {
  width: 100%;
}

.landing-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-card .input-field {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.room-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.room-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.room-code-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-code-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.room-code-value {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.room-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.room-meta .dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(46, 213, 115, 0.5);
}

.room-meta .dot.offline {
  background: var(--text-muted);
}

.dropzone {
  position: relative;
  padding: 48px 24px;
  text-align: center;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 24px;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.05);
}

.dropzone.drag-over {
  transform: scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.15);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.dropzone.drag-over .dropzone-icon {
  opacity: 1;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.dropzone-text {
  color: var(--text-secondary);
  font-size: 1rem;
}

.dropzone-text strong {
  color: var(--accent);
}

.dropzone-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 8px;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.progress-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.progress-filename {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-percent {
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.files-section {
  margin-bottom: 40px;
}

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

.files-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.files-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 1rem;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.file-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.file-actions .btn {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
  max-width: 360px;
  backdrop-filter: blur(12px);
}

.toast-success {
  background: rgba(46, 213, 115, 0.15);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: var(--success);
}

.toast-error {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--danger);
}

.toast-info {
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: var(--accent);
}

.toast-exit {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 640px) {
  .header-title {
    font-size: 2rem;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }

  .landing-card {
    padding: 24px 20px;
  }

  .room-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .room-code-section {
    width: 100%;
    justify-content: space-between;
  }

  .room-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .file-item {
    flex-wrap: wrap;
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .dropzone {
    padding: 32px 16px;
  }

  .toast-container {
    left: 24px;
    right: 24px;
    bottom: 16px;
  }

  .toast {
    max-width: none;
  }
}
