/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101624;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --bg-input: rgba(13, 18, 30, 0.8);
  
  --accent-red: #ff1a40;
  --accent-red-hover: #ff3355;
  --accent-crimson: #e60026;
  --accent-orange: #ff6b3d;
  --accent-gradient: linear-gradient(135deg, #ff1a40 0%, #ff5238 50%, #ff8442 100%);
  --accent-gradient-glow: linear-gradient(135deg, rgba(255, 26, 64, 0.35) 0%, rgba(255, 82, 56, 0.15) 100%);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #ffffff;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-active: rgba(255, 26, 64, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(255, 26, 64, 0.25);
  
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Ambient Lighting */
.ambient-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.38;
}

.glow-top {
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 26, 64, 0.45) 0%, rgba(255, 107, 61, 0.1) 70%, transparent 100%);
}

.glow-bottom {
  bottom: -150px;
  right: 5%;
  width: 500px;
  height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(255, 26, 64, 0.05) 70%, transparent 100%);
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon-wrapper {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 26, 64, 0.35);
  transition: transform var(--transition-fast);
}

.brand:hover .brand-icon-wrapper {
  transform: scale(1.05);
}

.brand-icon {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 26, 64, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255, 26, 64, 0.4);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  margin-left: 0.35rem;
  vertical-align: middle;
}

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

.engine-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 10px var(--color-success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ==========================================================================
   Main Layout & Hero Section
   ========================================================================== */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-section {
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ==========================================================================
   Card Component
   ========================================================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--border-hover);
}

/* ==========================================================================
   URL Input Form
   ========================================================================== */
.input-card {
  padding: 1.25rem;
}

.url-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .url-form {
    flex-direction: row;
    align-items: center;
  }
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.75rem 0.35rem 1rem;
  transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(255, 26, 64, 0.2);
  background: rgba(18, 24, 38, 0.95);
}

.input-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

.video-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.65rem 0;
  width: 100%;
}

.video-url-input::placeholder {
  color: var(--text-muted);
}

.btn-icon-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
}

/* Error Banner */
.error-banner {
  margin-top: 0.85rem;
  padding: 0.85rem 1.15rem;
  background: var(--color-error-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 1rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-xl);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(255, 26, 64, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(255, 26, 64, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-download {
  width: 100%;
}

/* ==========================================================================
   Loading Spinner (conic-gradient & @property)
   ========================================================================== */
.loading-spinner {
  --size: 20px;
  --thickness: 2.5px;
  --spinner-color: #ffffff;
  --track-color: rgba(255, 255, 255, 0.2);
  
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  appearance: none;
  position: relative;
  background: conic-gradient(from 90deg, var(--spinner-color) 120deg, transparent 0) var(--track-color);
  animation: spinner-rotate 0.9s linear infinite;
  mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black calc(100% - var(--thickness)));
  -webkit-mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black calc(100% - var(--thickness)));
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Video Preview Card
   ========================================================================== */
.preview-card {
  animation: fadeInDown 0.35s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .preview-layout {
    grid-template-columns: 360px 1fr;
  }
}

/* Thumbnail */
.preview-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  box-shadow: var(--shadow-md);
}

.preview-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.preview-thumbnail-wrapper:hover .preview-thumbnail {
  transform: scale(1.03);
}

.duration-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.preview-thumbnail-wrapper:hover .thumbnail-overlay {
  opacity: 1;
}

.play-indicator {
  width: 52px;
  height: 52px;
  background: rgba(255, 26, 64, 0.9);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 26, 64, 0.5);
  transform: scale(0.9);
  transition: transform var(--transition-fast);
}

.preview-thumbnail-wrapper:hover .play-indicator {
  transform: scale(1);
}

/* Details */
.preview-details {
  display: flex;
  flex-direction: column;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.channel-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-separator {
  color: var(--text-muted);
}

.card-divider {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: 1.25rem 0;
}

/* Format Section */
.format-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.format-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.format-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.format-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 26, 64, 0.3);
}

/* Quality Grids */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
}

.quality-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.quality-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quality-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.quality-card.active {
  background: rgba(255, 26, 64, 0.12);
  border-color: var(--accent-red);
  box-shadow: 0 0 14px rgba(255, 26, 64, 0.2);
}

.quality-content {
  display: flex;
  flex-direction: column;
}

.quality-label {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.quality-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.quality-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 26, 64, 0.2);
  color: var(--accent-red);
}

.quality-badge.fast {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.preview-actions {
  margin-top: 1.5rem;
}

/* ==========================================================================
   Progress Card
   ========================================================================== */
.progress-card {
  animation: fadeInDown 0.3s ease-out;
  border-color: rgba(255, 26, 64, 0.3);
  box-shadow: 0 8px 32px rgba(255, 26, 64, 0.15);
}

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

.progress-status-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.status-pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 14px var(--accent-red);
  animation: pulse-ring 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 26, 64, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(255, 26, 64, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 26, 64, 0); }
}

.progress-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

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

.progress-bar-container {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease-out;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 26, 64, 0.5);
}

.progress-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

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

.progress-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .progress-metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Completed Card
   ========================================================================== */
.completed-card {
  text-align: center;
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(18, 24, 38, 0.8) 100%);
  animation: fadeInDown 0.35s ease-out;
}

.completed-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
}

.completed-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
  animation: scaleBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleBounce {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.checkmark-icon {
  width: 36px;
  height: 36px;
}

.completed-heading {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.completed-filename {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  word-break: break-all;
  max-width: 600px;
  margin-bottom: 0.5rem;
}

.completed-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.completed-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

/* ==========================================================================
   Downloads History Section
   ========================================================================== */
.history-section {
  margin-top: 1rem;
}

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

.history-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.history-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.history-file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 26, 64, 0.15);
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-file-icon.audio {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.history-file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-file-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.history-file-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-history {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

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

.toast {
  pointer-events: auto;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  color: #ffffff;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease-out;
  transition: opacity 0.25s, transform 0.25s;
}

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

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   SVG Utility Icons
   ========================================================================== */
.icon-xs {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon {
  width: 20px;
  height: 20px;
}

.icon-lg {
  width: 28px;
  height: 28px;
}
