/* Minimalist Design System for 64Base Studio */

:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-hover: #111827;
  
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dark: #9ca3af;
  
  --color-primary: #111827;
  --color-secondary: #4b5563;
  --color-accent: #3b82f6;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Main Container Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .app-container {
    padding: 3rem 2rem;
  }
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
  .app-header {
    flex-direction: row;
    align-items: center;
  }
}

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

.logo-container {
  background: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  color: #ffffff;
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  width: 100%;
}

@media (min-width: 640px) {
  .header-actions {
    width: auto;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.btn-primary:hover:not(:disabled) {
  background: #27272a;
  border-color: #27272a;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.btn-danger {
  background: #fef2f2;
  color: var(--color-danger);
  border-color: #fecaca;
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #f87171;
}

.btn-icon {
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.btn-block {
  width: 100%;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f5;
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.badge-success {
  background: #f0fdf4;
  color: var(--color-success);
  border-color: #bbf7d0;
}

/* Tabs Navigation */
.app-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar on Firefox */
}

.app-tabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar on Chrome/Safari */
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  border-bottom-color: #d1d5db;
}

.tab-btn.active {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--text-main);
}

/* Tab Contents */
.tab-content {
  display: none;
}

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

/* Workspace Layout Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 992px) {
  .workspace-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* Workspace Panel */
.workspace-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.panel-header h2 i {
  color: var(--text-main);
  width: 16px;
  height: 16px;
}

.panel-body {
  padding: 1.25rem;
}

/* Dropzone Styles */
.dropzone {
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  padding: 2.5rem 1rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  background: #f9fafb;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dropzone:hover {
  border-color: var(--text-main);
  background: #f3f4f6;
}

.file-input {
  display: none; /* Hidden input, resolved double click conflict */
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
}

.dropzone-icon i {
  width: 20px;
  height: 20px;
}

.dropzone-text {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.dropzone-text span {
  text-decoration: underline;
  cursor: pointer;
}

.dropzone-subtext {
  font-size: 0.75rem;
  color: var(--text-dark);
}

.dropzone-subtext-paste {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.inline-icon {
  width: 12px;
  height: 12px;
}

/* Edit Workspace details */
.workspace-edit {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.image-preview-wrapper {
  position: relative;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 320px;
}

#encoder-image-preview {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.image-overlay-dimensions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(17, 25, 40, 0.8);
  color: #ffffff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* Tools Row */
.transform-tools {
  display: flex;
  gap: 0.25rem;
  background: #f9fafb;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  align-items: center;
  flex-wrap: wrap;
}

.ml-auto {
  margin-left: auto;
}

/* Custom settings card */
.settings-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  background: #ffffff;
}

.settings-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.settings-card h3 i {
  color: var(--text-main);
  width: 14px;
  height: 14px;
}

.setting-row {
  margin-bottom: 1rem;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-row label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Custom Select & Range */
.custom-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.custom-select:focus {
  border-color: var(--text-main);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.slider-header label {
  margin-bottom: 0;
}

.slider-header span {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.custom-range {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-main);
  transition: transform var(--transition-fast);
}

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

/* Resize Controls */
.resize-settings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resize-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resize-title label {
  margin-bottom: 0;
}

.btn-lock {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-lock.active {
  color: var(--text-main);
  background: #f3f4f6;
}

.btn-lock i {
  width: 14px;
  height: 14px;
}

.resize-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.x-divider {
  color: var(--text-dark);
  font-size: 0.8rem;
}

.input-with-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.input-with-label input {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.input-with-label input:focus {
  border-color: var(--text-main);
}

.input-with-label span {
  font-size: 0.7rem;
  color: var(--text-dark);
}

.resize-presets {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.preset-btn {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  background: #f9fafb;
  color: var(--text-main);
  border-color: #d1d5db;
}

/* Color Palette UI */
.palette-colors {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.palette-placeholder {
  font-size: 0.75rem;
  color: var(--text-dark);
  width: 100%;
  text-align: center;
  padding: 0.25rem 0;
}

.palette-color-item {
  flex: 1;
  min-width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.palette-color-block {
  width: 100%;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin-bottom: 0.25rem;
}

.palette-color-hex {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* File Size Tracker */
.file-size-tracker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.size-original {
  color: var(--text-muted);
}

.size-arrow {
  width: 12px;
  height: 12px;
  color: var(--text-dark);
}

.size-base64 {
  color: var(--text-main);
  font-weight: 700;
}

/* Output Code Panel */
.output-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.output-tabs::-webkit-scrollbar {
  display: none;
}

.output-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

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

.output-tab.active {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--text-main);
}

.code-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#base64-output-textarea {
  width: 100%;
  height: 200px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  color: #1f2937;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: none;
  outline: none;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

#base64-output-textarea:focus {
  border-color: var(--text-main);
  background: #ffffff;
}

.textarea-actions {
  display: flex;
  gap: 0.5rem;
}

.textarea-actions button {
  flex: 1;
}

/* Metadata Info Grid */
.metadata-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .metadata-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #f9fafb;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ================= BATCH VIEW ================= */
.full-width-panel {
  grid-column: 1 / -1;
}

.batch-actions-header {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.batch-list-container {
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.batch-list-header {
  display: none;
}

@media (min-width: 640px) {
  .batch-list-header {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1fr;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    gap: 1rem;
    align-items: center;
  }
}

.batch-items-queue {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
}

.batch-item-row {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .batch-item-row {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
  }
}

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

.batch-item-preview {
  width: 60px;
  height: 45px;
  background: #f3f4f6;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.batch-item-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.batch-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.batch-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item-dims {
  font-size: 0.7rem;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.batch-item-sizes {
  display: flex;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .batch-item-sizes {
    flex-direction: column;
    gap: 0.15rem;
  }
}

.batch-item-orig-size {
  color: var(--text-muted);
}

.batch-item-b64-size {
  color: var(--text-main);
  font-weight: 600;
}

.batch-item-actions {
  display: flex;
  gap: 0.25rem;
}

.batch-item-actions button {
  flex: 1;
}

@media (min-width: 640px) {
  .batch-item-actions button {
    flex: none;
  }
}

/* ================= DECODER VIEW ================= */
.section-intro-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.decoder-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#decoder-input-textarea {
  width: 100%;
  height: 180px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  color: #1f2937;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: none;
  outline: none;
  line-height: 1.5;
}

#decoder-input-textarea:focus {
  border-color: var(--text-main);
  background: #ffffff;
}

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

.decoder-helper-card {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
}

.decoder-helper-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.decoder-helper-card ul {
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.decoder-empty-state {
  text-align: center;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.empty-state-icon i {
  width: 20px;
  height: 20px;
}

.decoder-empty-state h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.decoder-empty-state p {
  font-size: 0.75rem;
  color: var(--text-dark);
}

.decoder-workspace-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.decoded-image-box {
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 280px;
  overflow: hidden;
}

.decoded-image-box img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.decoded-info-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  background: #ffffff;
}

.decoded-info-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.action-buttons-row {
  margin-top: 1rem;
}

/* ================= HISTORY DRAWER ================= */
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
  transition: visibility var(--transition-fast);
}

.history-drawer.active {
  visibility: visible;
  pointer-events: auto;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.history-drawer.active .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
  transform: translateX(100%);
  transition: transform var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.history-drawer.active .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.drawer-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-header h2 i {
  color: var(--text-main);
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-drawer:hover {
  color: var(--text-main);
}

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

.history-actions-row {
  margin-bottom: 0.25rem;
}

.w-full {
  width: 100%;
}

.history-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  padding: 3rem 1rem;
  gap: 0.5rem;
  text-align: center;
}

.history-empty i {
  width: 24px;
  height: 24px;
}

.history-empty p {
  font-size: 0.75rem;
}

.history-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.history-item-card:hover {
  border-color: var(--text-main);
}

.history-item-thumb {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.history-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.history-item-name {
  font-size: 0.75rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
}

.history-item-size {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.history-item-time {
  font-size: 0.65rem;
  color: var(--text-dark);
}

.history-item-actions {
  display: flex;
  gap: 0.15rem;
}

/* ================= TOASTS ================= */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: slideIn 0.2s ease-out, fadeOut 0.2s ease-out 2.8s forwards;
  border-left: 3px solid var(--text-main);
}

.toast-success {
  border-left-color: var(--color-success);
}
.toast-success i {
  color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-danger);
}
.toast-error i {
  color: var(--color-danger);
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

/* Footer & Portfolio Link styling */
.app-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
  }
}

.portfolio-link a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-fast);
}

.portfolio-link a:hover {
  text-decoration: underline;
}

