:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --border: #333;
  --text: #e5e5e5;
  --text-muted: #888;
  --accent: #6366f1;
  --accent-hover: #5558e3;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Top bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.features-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.features-link:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 0.35rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

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

.lang-btn.active {
  background: var(--accent);
  color: white;
}

/* Session bar */
.session-bar {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--orange);
}

.session-icon {
  font-size: 1rem;
}

.session-text {
  color: var(--text-muted);
}

.register-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.register-link:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* Coming soon modal */
.coming-soon-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.coming-soon-content {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
}

.coming-soon-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.coming-soon-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.coming-soon-content button {
  padding: 0.75rem 2rem;
}

/* Help section */
.help-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.help-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.help-item {
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.help-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.help-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.help-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone.dragover {
  transform: scale(1.01);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-zone h2 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.upload-zone p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-zone input[type="file"] {
  display: none;
}

/* Options */
.options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.options h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.option-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.option-row:last-child {
  margin-bottom: 0;
}

.option-group {
  flex: 1;
}

.option-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.option-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.option-group input:focus {
  outline: none;
  border-color: var(--accent);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  padding: 0.5rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Result Card */
.result {
  background: var(--surface);
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: none;
}

.result.show {
  display: block;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-header .icon {
  font-size: 1.25rem;
}

.result-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
}

.result-url {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-url input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: monospace;
}

.result-url input:focus {
  outline: none;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.result-actions a {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

.btn-live {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  border: none;
}

.btn-live:hover {
  background: linear-gradient(135deg, #dc2626, #ea580c);
}

.result-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Documents List */
.documents {
  margin-top: 2rem;
}

.documents h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}

.doc-item:hover {
  border-color: var(--accent);
}

.doc-icon {
  font-size: 1.5rem;
}

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

.doc-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.doc-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.doc-actions {
  display: flex;
  gap: 0.5rem;
}

.doc-actions a,
.doc-actions button {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-protected {
  background: rgba(245, 158, 11, 0.15);
  color: var(--orange);
}

.badge-expires {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

/* Loading */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  color: var(--text-muted);
}

.loading.show {
  display: flex;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--green);
}

.toast.error {
  border-color: var(--red);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .option-row {
    flex-direction: column;
  }
  
  .result-url {
    flex-direction: column;
  }
  
  .doc-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .doc-actions {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .doc-actions a,
  .doc-actions button {
    flex: 1;
    text-align: center;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
}

.recording-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.recording-item:last-child {
  margin-bottom: 0;
}

.recording-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.recording-info span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Browse Mode */
.browse-section {
  margin-bottom: 1.5rem;
}

.browse-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.browse-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.browse-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.browse-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.browse-form {
  display: flex;
  gap: 0.75rem;
}

.browse-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.browse-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.browse-form button {
  white-space: nowrap;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 1rem;
}

@media (max-width: 600px) {
  .browse-form {
    flex-direction: column;
  }

  .session-bar {
    flex-direction: column;
    text-align: center;
  }
}
