/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --success: #16a34a;
  --success-light: #22c55e;
  --warning: #f59e0b;
  --error: #dc2626;
  --error-light: #ef4444;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --sidebar-width: 280px;
  --border-radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-800);
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.sidebar-header {
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--gray-600);
}

.sidebar-header h1 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.sidebar-header .version {
  color: var(--gray-400);
  font-size: 0.85rem;
}

.sidebar-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--gray-700);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 12px;
}

.sidebar .form-group {
  margin-bottom: 12px;
}

.sidebar .form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-300);
  margin-bottom: 4px;
}

.sidebar input,
.sidebar select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-600);
  border-radius: 6px;
  background: var(--gray-700);
  color: white;
  font-size: 0.9rem;
}

.sidebar input::placeholder {
  color: var(--gray-500);
}

.sidebar input:focus,
.sidebar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-200);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 30px 40px;
  max-width: calc(100vw - var(--sidebar-width));
}

/* Stage Navigation */
.stage-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
}

.stage.active {
  opacity: 1;
}

.stage.completed {
  opacity: 0.8;
}

.stage-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-600);
  transition: all 0.2s;
}

.stage.active .stage-number {
  background: var(--primary);
  color: white;
}

.stage.completed .stage-number {
  background: var(--success);
  color: white;
}

.stage-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

.stage.active .stage-label {
  color: var(--primary);
}

.stage-connector {
  width: 60px;
  height: 2px;
  background: var(--gray-300);
  margin: 0 10px;
}

/* Stage Content */
.stage-content {
  display: none;
}

.stage-content.active {
  display: block;
}

.stage-header {
  margin-bottom: 25px;
}

.stage-header h2 {
  font-size: 1.75rem;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.stage-header p {
  color: var(--gray-500);
}

/* Upload Tabs */
.upload-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.upload-tab {
  flex: 1;
  padding: 15px 20px;
  border: 2px solid var(--gray-200);
  background: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.2s;
}

.upload-tab:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.upload-tab.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

.tab-icon {
  font-size: 1.2rem;
}

.upload-content {
  display: none;
  margin-bottom: 25px;
}

.upload-content.active {
  display: block;
}

/* File Drop Zone */
.file-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--border-radius);
  padding: 50px 30px;
  text-align: center;
  background: white;
  transition: all 0.2s;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.02);
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.file-drop-zone h3 {
  font-size: 1.2rem;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.file-drop-zone p {
  color: var(--gray-500);
  margin-bottom: 5px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--primary-dark);
}

.hint {
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* URL Input */
.url-input-section {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.url-input-section textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 200px;
}

.url-input-section textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.url-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

#urlCount {
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* Drive Section */
.drive-section {
  background: white;
  border-radius: var(--border-radius);
  padding: 50px;
  text-align: center;
  box-shadow: var(--shadow);
}

.drive-placeholder .drive-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 15px;
}

.drive-placeholder h3 {
  margin-bottom: 10px;
  color: var(--gray-700);
}

.drive-placeholder p {
  color: var(--gray-500);
  margin-bottom: 20px;
}

/* Uploaded Files List */
.uploaded-files {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.uploaded-files h3 {
  margin-bottom: 15px;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 10px;
}

.uploaded-files h3 span {
  font-weight: normal;
  color: var(--gray-400);
}

.files-container {
  min-height: 100px;
}

.empty-state {
  padding: 30px;
  text-align: center;
  color: var(--gray-400);
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--gray-50);
  gap: 12px;
}

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

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

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 2px;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.file-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 5px;
  font-size: 1.2rem;
}

.file-remove:hover {
  color: var(--error);
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1.1rem;
}

.stage-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

.stage-actions .btn:only-child {
  margin-left: auto;
}

/* Review List */
.review-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.review-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
}

.review-number {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.review-content {
  flex: 1;
}

.review-filename {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.review-label-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.review-label-input:focus {
  outline: none;
  border-color: var(--primary);
}

.review-classification {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-classification select {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 0.85rem;
}

.confidence-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.confidence-high {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.confidence-medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.confidence-low {
  background: rgba(220, 38, 38, 0.1);
  color: var(--error);
}

.review-actions-cell {
  display: flex;
  gap: 8px;
}

/* Reorder List */
.reorder-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

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

.reorder-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  cursor: grab;
  gap: 15px;
  transition: box-shadow 0.2s;
}

.reorder-item:hover {
  box-shadow: var(--shadow-md);
}

.reorder-item.sortable-ghost {
  opacity: 0.4;
}

.reorder-item.sortable-drag {
  box-shadow: var(--shadow-lg);
}

.drag-handle {
  color: var(--gray-400);
  font-size: 1.2rem;
  cursor: grab;
}

.reorder-number {
  min-width: 45px;
  padding: 5px 10px;
  background: var(--gray-100);
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.reorder-label {
  flex: 1;
  font-weight: 500;
}

.reorder-source {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* Generate Summary */
.generate-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.summary-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.summary-card h3 {
  margin-bottom: 15px;
  color: var(--gray-700);
  font-size: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-value {
  font-weight: 600;
  color: var(--gray-700);
}

.exhibit-preview {
  max-height: 300px;
  overflow-y: auto;
}

.preview-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}

.preview-item:last-child {
  border-bottom: none;
}

.preview-number {
  font-weight: 600;
  color: var(--primary);
  min-width: 80px;
}

.preview-label {
  color: var(--gray-600);
}

/* Generate Progress */
.generate-progress {
  margin-top: 30px;
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.generate-progress.hidden {
  display: none;
}

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

.progress-header h3 {
  color: var(--gray-700);
}

#progressPercent {
  font-weight: 600;
  color: var(--primary);
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

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

.progress-status {
  color: var(--gray-500);
  margin-bottom: 15px;
}

.progress-log {
  background: var(--gray-800);
  border-radius: 6px;
  padding: 15px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--gray-300);
}

.log-entry {
  margin-bottom: 4px;
}

.log-entry.success {
  color: var(--success-light);
}

.log-entry.error {
  color: var(--error-light);
}

/* Complete Stage */
.complete-content {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.success-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.delivery-result {
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  margin-bottom: 30px;
}

.complete-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* Notifications */
.notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  padding: 15px 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

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

.notification.success {
  background: var(--success);
  color: white;
}

.notification.error {
  background: var(--error);
  color: white;
}

.notification.info {
  background: var(--primary);
  color: white;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .generate-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
  }

  .app-container {
    flex-direction: column;
  }

  .stage-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .stage-connector {
    display: none;
  }
}

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

  .review-item {
    grid-template-columns: 1fr;
  }

  .complete-stats {
    flex-direction: column;
    gap: 20px;
  }
}
/*Access Google Drive*/
@keyframes driveProgress {
  0% { width: 0%; }
  50% { width: 80%; }
  100% { width: 100%; }
}
.drive-section code {
  background: var(--gray-200);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82rem;
}