/* ═══════════════════════════════════════════════════════════
   FILECOMPRESS.APP — BASE64 TOOL STYLESHEET
   Extends styles.css (must be linked AFTER it in HTML).
   All tokens (--bg, --accent, --surface, etc.) come from styles.css.
   This file adds only Base64-specific components, prefixed `b64-`.
═══════════════════════════════════════════════════════════ */


/* ─── MODE SWITCH (Encode / Decode tabs) ─────────────────── */
.b64-mode-switch {
  display: inline-flex;
  margin: 0 auto 1.5rem;
  padding: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  gap: 4px;
}

.b64-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}
.b64-mode-btn:hover     { color: var(--text); }
.b64-mode-btn:active    { transform: scale(0.97); }

.b64-mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow, rgba(99, 102, 241, 0.35));
}
.b64-mode-btn .btn-icon {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
}


/* ─── DROPZONE (extends .vt-dropzone with Base64 flavor) ── */
.b64-dropzone {
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.b64-dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.b64-dz-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: grayscale(0.3);
  transition: transform 0.2s, filter 0.2s;
}
.b64-dropzone:hover .b64-dz-icon,
.b64-dropzone.drag-over .b64-dz-icon {
  transform: translateY(-3px);
  filter: grayscale(0);
}

.b64-dz-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 0.35rem;
}

.b64-dz-hint {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}


/* ─── FILE LIST ──────────────────────────────────────────── */
.b64-file-list-wrap {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.b64-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.b64-list-count {
  color: var(--accent);
}

.b64-link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.b64-link-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

.b64-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.b64-file-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background 0.15s;
}
.b64-file-item:last-child { border-bottom: none; }
.b64-file-item:hover      { background: var(--surface2); }

.b64-file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.b64-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.b64-file-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b64-file-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.b64-file-size {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.b64-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.b64-file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.b64-file-remove:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  transform: scale(1.1);
}

/* Per-item status pill (success / error after processing) */
.b64-file-status {
  display: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
}
.b64-file-status.show { display: inline-block; }
.b64-file-status.ok    { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.b64-file-status.err   { background: rgba(239, 68, 68, 0.12); color: #f87171; }


/* ─── PROGRESS WRAPPER ───────────────────────────────────── */
.b64-progress-wrap {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.b64-progress-label {
  font-size: 0.82rem;
  color: var(--text);
}


/* ─── ACTION BUTTONS ROW ─────────────────────────────────── */
.b64-actions {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.b64-actions .btn {
  flex: 1 1 auto;
  min-width: 160px;
}

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


/* ─── TOAST ──────────────────────────────────────────────── */
.b64-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.25rem;
  font-size: 0.86rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
}
.b64-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.b64-toast.ok  { border-color: rgba(34, 197, 94, 0.5);  }
.b64-toast.err { border-color: rgba(239, 68, 68, 0.5); }
.b64-toast .b64-toast-icon { font-size: 1.1rem; }


/* ─── INLINE CODE (in info card) ─────────────────────────── */
code {
  font-family: 'DM Mono', monospace;
  font-size: 0.78em;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}


/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {

  .b64-mode-switch {
    width: 100%;
    flex-direction: row;
  }
  .b64-mode-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .b64-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  .b64-file-item {
    grid-template-columns: 28px 1fr auto;
    grid-template-areas:
      "icon name status"
      "icon sub  status";
    row-gap: 2px;
  }
  .b64-file-icon    { grid-area: icon; }
  .b64-file-meta    { grid-area: name; }
  .b64-file-size    { grid-area: sub; font-size: 0.7rem; }
  .b64-status-cell  { grid-area: status; }

  .b64-dz-hint     { font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .b64-dz-icon  { font-size: 2rem; }
  .b64-dz-title { font-size: 0.92rem; }
}

/* ───────────────────────────────────────────────────────────
   Feature callout cards — matched to the PDF Tools page layout
   so the Base64 page shares the same header + callout structure.
   ─────────────────────────────────────────────────────────── */
.pdf-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 1.5rem;
}
.pdf-feature-card {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--muted);
  transition: border-color 0.15s;
}
.pdf-feature-card:hover { border-color: var(--accent-glow); }
.pdf-feature-card .fc-icon { font-size: 1.1rem; flex-shrink: 0; }
@media (max-width: 768px) { .pdf-feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .pdf-feature-grid { grid-template-columns: 1fr; } }
