/* ========================================
   SUNO EXPLORER - Popup Styles v2
   Clean, informative, configurable
   ======================================== */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-hover: #222222;
  --bg-input: #151515;
  
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #555555;
  
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-dim: rgba(139, 92, 246, 0.15);
  --accent-glow: rgba(139, 92, 246, 0.25);
  
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --border: #2a2a2a;
  --border-focus: #8b5cf6;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --font: 'Segoe UI', -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Monaco', monospace;
}

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

body {
  width: 340px;
  max-height: 580px;
  font-family: var(--font);
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-y: auto;
  overflow-x: hidden;
}

body::-webkit-scrollbar {
  width: 6px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#mainContent {
  display: flex;
  flex-direction: column;
  gap: 6px; /* Gap between cards inside main content */
}

/* ========================================
   HEADER
   ======================================== */

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

.header-right {
  display: flex;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2.4px 8px 3px 8px;
  background: var(--bg-elevated);
  border-radius: 10px;
}

.user-handle {
  color: var(--accent);
  font-weight: 500;
}

.user-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: bold;
  letter-spacing: -2px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.user-menu-btn:hover {
  color: var(--accent);
}

/* User Account Menu */
.user-account-menu {
  position: fixed;
  top: 44px;
  right: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  min-width: 160px;
}

.user-account-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.user-account-menu .menu-item:hover {
  background: var(--accent);
  color: white;
}

.user-account-menu .menu-icon {
  font-size: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 18px;
  height: 30px;
}

.logo-text {
  font-family: monospace;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot.error {
  background: var(--error);
}

.status-dot.syncing {
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title.clickable {
  cursor: pointer;
  user-select: none;
}

.card-title.clickable:hover {
  color: var(--text-secondary);
}

.toggle-icon {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
}

.toggle-icon.open {
  transform: rotate(90deg);
}

.card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ========================================
   CONNECT CARD
   ======================================== */

.connect-card {
  text-align: center;
  padding: 20px;
}

.connect-msg {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 13px;
}

.connect-msg a {
  color: var(--accent);
}

.connect-btn-wrapper {
  display: flex;
  justify-content: center;
}

/* Offline Access (when disconnected but have data) */
.offline-access {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.offline-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.offline-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.offline-actions .btn {
  flex: 1;
}

.unsaved-dot {
  color: #f59e0b;
  font-size: 8px;
  vertical-align: super;
  margin-left: 2px;
}

/* ========================================
   PREVIEW CARD
   ======================================== */

.preview-card {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.preview-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-bottom: 10px;
}

.preview-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.preview-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ========================================
   INPUTS & SELECTS
   ======================================== */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--border-focus);
}

.input-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.input-hint span {
  color: var(--accent);
}

.path-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.path-save-indicator {
  font-size: 10px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.path-save-indicator.saved {
  opacity: 1;
}

.settings-help {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  position: relative;
}

.settings-help-text {
  color: var(--text-muted);
}

.settings-copy-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
}

.settings-copy-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.settings-copy-btn:active {
  transform: scale(0.98);
}

.settings-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.settings-tooltip.show {
  opacity: 1;
}

.download-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.test-result {
  font-size: 11px;
  font-weight: 500;
}

.test-result.success {
  color: var(--success);
}

.test-result.error {
  color: var(--error);
}

.test-result.testing {
  color: var(--text-muted);
}

/* ========================================
   LIBRARY CARD
   ======================================== */

.library-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-color: var(--accent);
}

.library-status {
  margin-bottom: 12px;
}

.library-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

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

.library-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.library-progress-bar {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.library-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.library-progress-fill.indeterminate {
  width: 30%;
  animation: slide 1s ease-in-out infinite;
}

@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.library-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

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

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-link:hover {
  background: var(--accent-dim);
}

.select-group,
.filter-group {
  margin-bottom: 10px;
}

.filter-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
}

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

.select-small {
  width: auto;
  padding: 6px 8px;
  font-size: 11px;
}

/* ========================================
   CHECKBOXES
   ======================================== */

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-text {
  flex: 1;
}

.checkbox-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========================================
   COLLAPSIBLE
   ======================================== */

.collapsible-content {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.filter-note {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.filter-disclaimer {
  font-size: 10px;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ========================================
   PREVIEW MODE
   ======================================== */

.preview-mode-card {
  background: var(--bg-secondary);
}

.preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ========================================
   BUTTONS
   ======================================== */

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

.btn-full-width {
  width: 100%;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--accent);
}

.btn-small {
  flex: none;
  padding: 6px 12px;
  font-size: 11px;
}

.btn-tiny {
  padding: 4px 8px;
  font-size: 10px;
}

.library-backup {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-icon {
  font-size: 14px;
}

/* ========================================
   PROGRESS
   ======================================== */

.progress-card {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-phase {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.progress-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.progress-bar-container {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  width: 0%;
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--bg-primary) 0%,
    var(--accent) 20%,
    var(--accent-hover) 50%,
    var(--accent) 80%,
    var(--bg-primary) 100%
  );
  background-size: 200% 100%;
  animation: indeterminate 1.5s linear infinite;
}

@keyframes indeterminate {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-current {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   ERROR
   ======================================== */

.error-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
}

.error-icon {
  font-size: 14px;
}

.error-message {
  font-size: 12px;
  color: var(--error);
  line-height: 1.4;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
}

.link:hover {
  color: var(--accent);
}

.separator {
  color: var(--text-muted);
  font-size: 10px;
}

/* ========================================
   DOWNLOAD STATS
   ======================================== */

.download-stats {
  display: flex;
  gap: 16px;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.progress-details {
  margin-top: 6px;
}

.progress-skipped {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.progress-errors {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--error);
  margin-top: 6px;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-stop {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
}

/* ========================================
   SPEED CONTROL
   ======================================== */

.speed-card {
  padding-bottom: 12px;
}

.speed-description {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ========================================
   CREATOR FILTER
   ======================================== */

.creator-card {
  padding-bottom: 12px;
}

.creator-card .card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.creator-card .select {
  width: 100%;
}

.speed-toggle-group {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
}

.speed-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.speed-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.speed-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.speed-btn[data-speed="slow"].active {
  background: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.speed-btn[data-speed="fast"].active {
  background: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.speed-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  min-height: 14px;
}

/* ========================================
   DATA MANAGEMENT
   ======================================== */

.data-card {
  padding-bottom: 8px;
}

.backup-summary {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.backup-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
}

.backup-label {
  color: var(--text-secondary);
}

.backup-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
}

.backup-value.backup-never {
  color: var(--warning);
}

.backup-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 11px;
}

.backup-warning.hidden {
  display: none;
}

.warning-icon {
  font-size: 14px;
}

.warning-text {
  color: var(--warning);
  font-weight: 500;
}

.data-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.data-section-title:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.data-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.data-actions .btn {
  flex: 1;
  min-width: 100px;
}

.import-mode-row {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.import-mode-row .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.import-mode-row .toggle-text {
  font-size: 12px;
  color: var(--text-primary);
}

.import-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 22px;
}

/* Backup Success Animation */
.backup-success {
  animation: backupPulse 0.5s ease;
}

@keyframes backupPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); background: rgba(34, 197, 94, 0.1); }
  100% { transform: scale(1); }
}

/* Toast Notification for Backup */
.backup-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: toastSlideUp 0.3s ease;
}

.backup-toast.error {
  background: var(--error);
}

@keyframes toastSlideUp {
  from { 
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Backup Reminder Modal */
.backup-reminder-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.backup-reminder-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.reminder-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.reminder-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.reminder-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.reminder-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.reminder-actions .btn {
  min-width: 90px;
}

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

/* ========================================
   INDEX OPTIONS ROW
   ======================================== */

.index-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.index-option-row .toggle-label.compact {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.index-option-row .option-hint {
  font-size: 10px;
  color: var(--text-muted);
  flex: 1;
  text-align: right;
}

/* ========================================
   FILTER TOGGLE ROW
   ======================================== */

.filter-group.toggle-filter {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.filter-group.toggle-filter .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* ========================================
   CHECK LOCAL FILES BUTTON
   ======================================== */

.check-files-btn {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

/* ========================================
   BACKUP BADGE IN HEADER
   ======================================== */

.backup-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.backup-badge.never {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.backup-badge.old {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.backup-badge.recent {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.backup-badge.unsaved {
  background: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  font-weight: 600;
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.popup-toast {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  text-align: center;
  z-index: 1000;
  animation: toast-in 0.2s ease;
}

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

.popup-toast-info {
  background: rgba(59, 130, 246, 0.9);
  color: white;
}

.popup-toast-success {
  background: rgba(34, 197, 94, 0.9);
  color: white;
}

.popup-toast-error {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.popup-toast-warning {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}
