/* PDF Tools - Custom Styles */

/* CSS Variables for theming */
:root {
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-secondary: #6366f1;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-bg: #f8fafc;
  --color-bg-card: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-card: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Card hover effects */
.tool-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* Icon styles */
.tool-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--color-border);
  background: var(--color-bg-card);
  transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(14, 165, 233, 0.05);
}

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

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.3s ease;
}

/* File list item */
.file-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.file-item:hover {
  border-color: var(--color-primary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Staggered animation for cards */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.15s; }
.tool-card:nth-child(3) { animation-delay: 0.2s; }
.tool-card:nth-child(4) { animation-delay: 0.25s; }
.tool-card:nth-child(5) { animation-delay: 0.3s; }
.tool-card:nth-child(6) { animation-delay: 0.35s; }
.tool-card:nth-child(7) { animation-delay: 0.4s; }
.tool-card:nth-child(8) { animation-delay: 0.45s; }
.tool-card:nth-child(9) { animation-delay: 0.5s; }
.tool-card:nth-child(10) { animation-delay: 0.55s; }

/* Modal */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  animation: fadeIn 0.3s ease;
}

/* Toast notifications */
.toast {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

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

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

/* Preview thumbnail */
.pdf-thumbnail {
  background: white;
  border: 1px solid var(--color-border);
  aspect-ratio: 210 / 297;
  overflow: hidden;
}

.pdf-thumbnail canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Tab navigation */
.tab-item {
  position: relative;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.tab-item:hover {
  color: var(--color-text);
}

.tab-item.active {
  color: var(--color-primary);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Feature badge */
.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
}

.badge-free {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-new {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-secondary);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive utilities */
@media (max-width: 640px) {
  .tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  
  .tool-icon svg {
    width: 20px;
    height: 20px;
  }
}
