:root {
  --bg: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0056b3;
  --primary-hover: #004085;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --panel-shadow: 0 10px 30px -10px rgba(0, 86, 179, 0.05), 0 1px 3px rgba(0, 0, 0, 0.01);
  --glass-blur: blur(20px);
  --border-radius: 16px;
}

html {
  overflow-x: hidden;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  position: relative;
}

/* Background glows */
.glow-sphere {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.glow-sphere-1 {
  top: -200px;
  left: -100px;
}

.glow-sphere-2 {
  bottom: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
}

/* Full App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  z-index: 10;
}

/* Header bar */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  height: 48px;
  object-fit: contain;
}

.header-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.1);
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0, 86, 179, 0.08);
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.2px;
}

/* Workspace container */
.workspace {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: min(640px, 100%);
  height: auto;
  gap: 32px;
  transition: all 0.3s ease;
}

.workspace-grid .queue-panel {
  display: none;
}

.workspace-grid.has-files {
  grid-template-columns: 1.1fr 0.9fr;
  max-width: 1200px;
}

.workspace-grid.has-files .queue-panel {
  display: flex;
}

/* Panels */
.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Left panel upload area adjustments */
.upload-panel {
  justify-content: flex-start;
}

.dropzone {
  flex: 1;
  border: 2px dashed rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 48px 20px;
  min-height: 260px;
  margin-bottom: 20px;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0, 86, 179, 0.02);
}

.dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-3px);
  color: var(--primary);
}

.dropzone-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.browse-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
}

.browse-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Right panel queue area adjustments */
.queue-panel {
  justify-content: space-between;
}

.queue-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.file-list {
  flex: 1;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 12px;
}

/* Empty state styling using :empty */
.file-list:empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

.file-list:empty::before {
  content: "No documents in queue";
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center top;
  padding-top: 36px;
  opacity: 0.65;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
  font-weight: 500;
}

.file-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.file-view {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: opacity 0.15s ease;
}

.file-view:hover {
  opacity: 0.8;
}

.file-remove {
  color: #ef4444;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: opacity 0.15s ease;
}

.file-remove:hover {
  opacity: 0.8;
}

/* Progress bar container */
.progress-container {
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 14px;
}

.progress-bar-wrapper {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.3s ease-out;
}

.progress-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.progress-loader {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 86, 179, 0.15);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.progress-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

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

/* Action button footer */
.action-footer {
  margin-top: auto;
}

.btn {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.15);
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(0, 86, 179, 0.25);
}

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

.btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.status {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.status.success {
  color: #059669;
}

.status.error {
  color: #dc2626;
}

.status.loading {
  color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .workspace {
    padding: 20px;
    overflow-y: auto;
    align-items: flex-start;
  }

  .workspace-grid,
  .workspace-grid.has-files {
    grid-template-columns: 1fr;
    max-height: none;
    height: auto;
  }

  .panel {
    height: auto;
  }

  .dropzone {
    min-height: 200px;
  }

  .file-list {
    min-height: 150px;
  }
}

@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    text-align: center;
  }

  .header-left {
    flex-direction: column;
    gap: 8px;
  }

  .header-divider {
    display: none;
  }

  .workspace {
    padding: 16px 12px;
  }

  .panel {
    padding: 20px 16px;
  }
}