/* ==========================================================================
   PixelPress WebP Studio - WEBP to JPG Converter & Compressor Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Dark Slate & Neon Cyan / Violet Accents */
  --bg-dark: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: rgba(23, 32, 54, 0.7);
  --bg-card-hover: rgba(30, 42, 70, 0.85);
  --bg-glass: rgba(19, 27, 46, 0.65);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.4);

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-secondary: #818cf8;
  --accent-purple: #c084fc;
  --accent-success: #34d399;
  --accent-warning: #fbbf24;
  --accent-danger: #f87171;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
  --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.6);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(129, 140, 248, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Navigation Header */
.app-header {
  height: 70px;
  padding: 0 2rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.brand-tag {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: 0.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Main Container */
.main-layout {
  flex: 1;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero Title Section */
.hero-section {
  text-align: center;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

.feature-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pill span {
  color: var(--accent-primary);
}

/* Drag & Drop Zone */
.dropzone-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 2px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition-normal);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dropzone-container:hover, .dropzone-container.drag-over {
  border-color: var(--accent-primary);
  background: rgba(30, 45, 75, 0.6);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dropzone-container input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon-wrapper {
  width: 72px;
  height: 72px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2.2rem;
  color: var(--accent-primary);
  transition: var(--transition-normal);
}

.dropzone-container:hover .drop-icon-wrapper {
  transform: scale(1.1);
  background: rgba(56, 189, 248, 0.2);
}

.drop-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.drop-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Custom Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #041226;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--accent-danger);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Control Panel Section */
.controls-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.control-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Range Inputs */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Radio & Switch Button Groups */
.btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-group-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.btn-group-btn.active {
  background: var(--accent-primary);
  color: #041226;
  font-weight: 700;
}

/* Swatch Color Pickers */
.swatches {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.swatch.active {
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.swatch-color-picker {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
}

/* Batch Summary & Queue Header */
.queue-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.stats-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-number.saved {
  color: var(--accent-success);
}

/* Image Queue Cards Grid */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.image-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: var(--transition-normal);
  position: relative;
}

.image-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.card-top {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.card-thumb-container {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge-format {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-filename {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.card-dimens {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.card-sizes {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

.size-orig {
  color: var(--text-muted);
  text-decoration: line-through;
}

.size-arrow {
  color: var(--text-dim);
}

.size-new {
  color: var(--accent-primary);
  font-weight: 700;
}

.size-saved-tag {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-success);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.card-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.2rem;
}

/* Split Screen Comparison Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Side by Side Split Slider Container */
.comparison-viewer {
  position: relative;
  width: 100%;
  height: 480px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  border: 1px solid var(--border-color);
}

.comparison-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.comparison-overlay-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid var(--accent-primary);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.comparison-overlay-wrap .comparison-image {
  width: 100%;
  max-width: none;
}

.comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  color: #041226;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: ew-resize;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.8);
  z-index: 10;
}

.badge-label-left, .badge-label-right {
  position: absolute;
  top: 15px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  z-index: 5;
  border: 1px solid var(--border-color);
}

.badge-label-left {
  left: 15px;
}

.badge-label-right {
  right: 15px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  color: var(--text-main);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUp 0.3s ease forwards;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .main-layout {
    padding: 1rem;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .controls-panel {
    grid-template-columns: 1fr;
  }
  .comparison-viewer {
    height: 320px;
  }
}
