/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Custom color variables */
:root {
  /* Primary Colors */
  --primary-500: #0052D9;
  --primary-400: #266FE8;
  --primary-300: #366EF4;
  
  /* Background Colors */
  --bg-gray: #F3F4F6;
  --bg-white: #FFFFFF;
  
  /* Text Colors */
  --text-primary: #1F2329;
  --text-secondary: #646A73;
  
  /* Functional Colors */
  --success: #2BA471;
  --error: #E34D59;
  --warning: #ED7B2F;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

body {
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.nav-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-500);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: var(--bg-gray);
  color: var(--primary-500);
}

.nav-link.active {
  background: var(--primary-500);
  color: white;
}

/* Main Content */
.main-content {
  padding: 40px 0;
  min-height: calc(100vh - 80px);
}

/* Card Styles */
.feature-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-500);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
}

.feature-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--primary-400);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: var(--primary-500);
  background: rgba(0, 82, 217, 0.02);
}

.upload-area.dragover {
  border-color: var(--primary-500);
  background: rgba(0, 82, 217, 0.05);
  transform: scale(1.02);
}

.upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: var(--primary-500);
}

.upload-text {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Button Styles */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
  color: white;
  box-shadow: 0 4px 14px rgba(0, 82, 217, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 82, 217, 0.5);
}

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

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--bg-gray);
}

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

.btn-success {
  background: linear-gradient(135deg, #2BA471, #3DB887);
  color: white;
  box-shadow: 0 4px 14px rgba(43, 164, 113, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 164, 113, 0.5);
}

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

/* Input Styles */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--bg-gray);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.3s ease;
  background: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1);
}

.input-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* File List */
.file-list {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-gray);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(0, 82, 217, 0.05);
}

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

.file-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-500);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 12px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.file-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.file-remove:hover {
  background: rgba(227, 77, 89, 0.1);
  color: var(--error);
}

/* Preview Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 16px;
}

.preview-item {
  aspect-ratio: 1;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.preview-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-item:hover .overlay {
  opacity: 1;
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-gray);
  border-radius: 4px;
  overflow: hidden;
}

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

/* Toast Notification */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-content {
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Drag and Drop Styles */
.draggable {
  cursor: move;
  user-select: none;
}

.dragging {
  opacity: 0.5;
}

.drag-over {
  border: 2px dashed var(--primary-500);
}

/* Page Range Input */
.page-range-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-range-input input {
  flex: 1;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.pending {
  background: rgba(237, 123, 47, 0.1);
  color: var(--warning);
}

.status-badge.processing {
  background: rgba(0, 82, 217, 0.1);
  color: var(--primary-500);
}

.status-badge.completed {
  background: rgba(43, 164, 113, 0.1);
  color: var(--success);
}

/* Glassmorphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.4s ease;
}
