@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CUSTOM VARIABLES --- */
:root {
  /* Dark Mode Palette (Default) */
  --bg-primary: #070a13;
  --bg-secondary: #0f1322;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0f1426 0%, #070a13 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-rgb: 16, 185, 129;
  --accent-mint: #34d399;
  --accent-cyan: #06b6d4;
  --accent-cyan-rgb: 6, 182, 212;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  
  --surface-bg: rgba(15, 22, 42, 0.6);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-hover: rgba(16, 185, 129, 0.25);
  
  --input-bg: rgba(7, 10, 19, 0.6);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-border: #10b981;
  --input-focus-shadow: rgba(16, 185, 129, 0.15);
  
  --btn-primary-bg: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --btn-primary-glow: rgba(16, 185, 129, 0.45);
  --btn-secondary-bg: rgba(255, 255, 255, 0.05);
  --btn-secondary-border: rgba(255, 255, 255, 0.1);
  --btn-secondary-hover: rgba(255, 255, 255, 0.1);
  
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --glass-blur: blur(24px) saturate(180%);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;
  
  --blob-green-opacity: 0.15;
  --blob-blue-opacity: 0.15;
}

body.light-mode {
  /* Light Mode Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-gradient: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #cbd5e1 100%);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-emerald: #059669;
  --accent-emerald-rgb: 5, 150, 105;
  --accent-mint: #10b981;
  --accent-cyan: #0891b2;
  --accent-cyan-rgb: 8, 145, 178;
  --accent-error: #dc2626;
  --accent-warning: #d97706;
  
  --surface-bg: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(15, 23, 42, 0.08);
  --surface-border-hover: rgba(5, 150, 105, 0.25);
  
  --input-bg: #f1f5f9;
  --input-border: rgba(15, 23, 42, 0.12);
  --input-focus-border: #059669;
  --input-focus-shadow: rgba(5, 150, 105, 0.15);
  
  --btn-primary-bg: linear-gradient(135deg, #059669 0%, #064e3b 100%);
  --btn-primary-glow: rgba(5, 150, 105, 0.35);
  --btn-secondary-bg: #e2e8f0;
  --btn-secondary-border: rgba(15, 23, 42, 0.05);
  --btn-secondary-hover: #cbd5e1;
  
  --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.15);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --glass-blur: blur(20px) saturate(140%);
  
  --blob-green-opacity: 0.12;
  --blob-blue-opacity: 0.12;
}

/* --- RESET & GLOBAL BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-emerald) transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-emerald);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-mint);
}

/* --- ANIMATED BACKDROP GLOWS --- */
.aurora-bg {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  mix-blend-mode: screen;
  animation: floatAround 25s infinite alternate ease-in-out;
}

.glow-blob-green {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-emerald) 0%, rgba(var(--accent-emerald-rgb), 0) 70%);
  opacity: var(--blob-green-opacity);
  top: -10%;
  right: -10%;
}

.glow-blob-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, rgba(var(--accent-cyan-rgb), 0) 70%);
  opacity: var(--blob-blue-opacity);
  bottom: -15%;
  left: -15%;
  animation-duration: 35s;
}

@keyframes floatAround {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(8%, 15%) scale(1.1) rotate(120deg);
  }
  66% {
    transform: translate(-10%, 20%) scale(0.9) rotate(240deg);
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(360deg);
  }
}

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

/* Header Area */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
  animation: fadeInDown 0.8s ease-out;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
}

.logo-section h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons and Toggles */
.btn-icon-toggle {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-icon-toggle:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(var(--accent-emerald-rgb), 0.15);
}

.btn-icon-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.5s ease;
}

.btn-icon-toggle:hover svg {
  transform: rotate(20deg);
}

/* Premium Navigation Segmented Tabs */
.nav-tabs {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  padding: 6px;
  gap: 4px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 2.5rem auto;
  position: relative;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.8s ease-out;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  color: var(--text-secondary);
  border-radius: calc(var(--border-radius-md) - 4px);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent-emerald);
  box-shadow: 0 4px 14px var(--btn-primary-glow);
}

/* Main Layout Grid */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  animation: fadeInUp 1s ease-out;
}

@media (min-width: 992px) {
  main {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* --- COMPONENT CARDS (GLASSMORPHISM) --- */
.glass-card {
  background: var(--surface-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card:focus-within::before {
  opacity: 1;
}

.glass-card:focus-within {
  border-color: var(--surface-border-hover);
  box-shadow: 0 20px 40px -10px rgba(var(--accent-emerald-rgb), 0.12), var(--shadow-lg);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-emerald);
}

/* --- FORMS & INPUTS --- */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Custom Phone Field with Country Code dropdown */
.phone-field-wrapper {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  overflow: visible;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.phone-field-wrapper:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

/* Country Selector Area */
.country-select-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid var(--input-border);
  cursor: pointer;
  user-select: none;
  min-width: 95px;
  transition: background 0.2s ease;
}
.country-select-box:hover {
  background: rgba(255, 255, 255, 0.03);
}

.selected-flag {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

.selected-dial {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.select-arrow {
  width: 12px;
  height: 12px;
  fill: var(--text-muted);
  transition: transform 0.3s ease;
}
.country-select-box.open .select-arrow {
  transform: rotate(180deg);
}

/* Real Number Input Field */
.phone-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 16px 20px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  outline: none;
  letter-spacing: 0.5px;
  width: 100%;
}
.phone-input::placeholder {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* Country Dropdown Panel */
.countries-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.countries-dropdown.open {
  display: flex;
}

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

.dropdown-search-wrapper {
  padding: 12px;
  border-bottom: 1px solid var(--input-border);
  position: relative;
}

.dropdown-search {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px 10px 32px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.dropdown-search:focus {
  border-color: var(--accent-emerald);
}

.search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
  pointer-events: none;
}

.countries-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  max-height: 310px;
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 0.95rem;
}

.country-item:hover, .country-item.highlighted {
  background: rgba(var(--accent-emerald-rgb), 0.12);
  color: var(--accent-emerald);
}

.country-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.country-flag {
  font-size: 1.2rem;
}

.country-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.country-dial {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.country-item:hover .country-dial {
  color: var(--accent-emerald);
}

/* Parse Status Indicator Badge */
.phone-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phone-status-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.phone-status-badge.valid {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-mint);
}

.phone-status-badge.invalid {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-error);
}

/* --- TEXT AREA & TOOLBAR --- */
.textarea-wrapper {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.textarea-wrapper:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

/* Text formatting toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--input-border);
  background: rgba(0, 0, 0, 0.15);
}

.toolbar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-emerald);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.editor-textarea {
  width: 100%;
  height: 120px;
  background: transparent;
  border: none;
  padding: 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}
.editor-textarea::placeholder {
  color: var(--text-muted);
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pre-made Templates Selection Chips */
.templates-container {
  margin-top: 1rem;
}

.chips-scroll-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px 0;
  scrollbar-width: none; /* Hide scrollbar for layout */
}
.chips-scroll-wrapper::-webkit-scrollbar {
  display: none; /* Webkit hide */
}

.template-chip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.template-chip:hover {
  background: rgba(var(--accent-emerald-rgb), 0.1);
  border-color: rgba(var(--accent-emerald-rgb), 0.3);
  color: var(--accent-mint);
  transform: translateY(-1px);
}

/* Target Destination (Web vs App) segmented switch */
.destination-switch {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  padding: 4px;
  gap: 2px;
  margin-bottom: 1.5rem;
  max-width: 250px;
}

.dest-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: calc(var(--border-radius-sm) - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dest-btn.active {
  background: var(--btn-secondary-hover);
  color: var(--text-primary);
}

/* --- BUTTONS --- */
.action-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: #ffffff;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 24px -6px var(--btn-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -2px var(--btn-primary-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-emerald);
}

/* --- QR CODE CARD & DRAWER --- */
.qr-expandable-section {
  margin-top: 1.5rem;
  border-top: 1px dashed var(--surface-border);
  padding-top: 1.5rem;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.qr-expandable-section.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.qr-card-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 576px) {
  .qr-card-layout {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
}

.qr-canvas-container {
  background: #ffffff;
  padding: 12px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: inline-flex;
}

.qr-canvas-container canvas {
  width: 140px;
  height: 140px;
  display: block;
}

.qr-details {
  flex: 1;
}

.qr-details h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.qr-details p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.btn-sm-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sm-action:hover {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

.btn-sm-action svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* --- BULK MODE LAYOUT --- */
.bulk-input-area {
  width: 100%;
  height: 140px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.3s ease;
}
.bulk-input-area:focus {
  border-color: var(--accent-emerald);
}

.bulk-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}

/* Queue List Container */
.bulk-queue-card {
  margin-top: 1.5rem;
  border-top: 1px dashed var(--surface-border);
  padding-top: 1.5rem;
  display: none;
}
.bulk-queue-card.visible {
  display: block;
}

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

.queue-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.queue-progress {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--accent-mint);
  font-weight: 600;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.queue-item.completed {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.15);
}

.queue-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-item-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.queue-item.completed .queue-item-num {
  color: var(--text-muted);
  text-decoration: line-through;
}

.queue-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.queue-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
}
.queue-badge.done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-mint);
}

.btn-queue-action {
  background: var(--accent-emerald);
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-queue-action:hover {
  background: var(--accent-mint);
}

.queue-item.completed .btn-queue-action {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

/* --- RECENTS & HISTORY PANEL --- */
.recents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.recents-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-clear-all {
  background: transparent;
  border: none;
  color: var(--accent-error);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-clear-all:hover {
  opacity: 0.8;
}

.recents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-item {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: itemSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.recent-item:hover {
  border-color: rgba(var(--accent-emerald-rgb), 0.2);
  transform: translateX(4px);
}

.recent-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.recent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--accent-emerald-rgb), 0.15);
  color: var(--accent-mint);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.recent-info-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nickname-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recent-nickname {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.btn-edit-nickname {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.btn-edit-nickname:hover {
  color: var(--accent-emerald);
}

.btn-edit-nickname svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.recent-phone {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recent-timestamp {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.btn-recent-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-recent-icon:hover {
  background: rgba(var(--accent-emerald-rgb), 0.1);
  color: var(--accent-mint);
  border-color: var(--accent-emerald);
}

.btn-recent-icon.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-error);
  border-color: var(--accent-error);
}

.btn-recent-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.empty-recents-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-recents-state svg {
  width: 48px;
  height: 48px;
  fill: var(--input-border);
  margin-bottom: 8px;
}

/* --- GOOGLE ADSENSE CARD DESIGN --- */
.ad-card-wrapper {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  animation: fadeInUp 1s ease-out;
}

.ad-glass-panel {
  width: 100%;
  max-width: 728px;
  background: rgba(15, 22, 42, 0.3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px dashed var(--surface-border);
  border-radius: var(--border-radius-md);
  padding: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-label {
  align-self: flex-start;
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-left: 6px;
}

/* Slot sizes styled nicely */
.ad-slot-container {
  width: 100%;
  min-height: 90px;
  background: transparent;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Collapse empty/unfilled AdSense units using modern CSS :has */
.ad-card-wrapper:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
}

/* Force standard ins tag to transparent background to avoid browser-default or adblocker-default colors */
ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* --- PREMIUM APP PROMO PREVIEW --- */
.premium-promo-card {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(var(--accent-emerald-rgb), 0.15);
}

.promo-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.promo-mockup-wrapper {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 110px;
  height: 200px;
  border: 6px solid #1e293b;
  border-radius: 20px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.phone-mockup::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 8px;
  background: #1e293b;
  border-radius: 10px;
  z-index: 10;
}

.mock-screen {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.5rem;
}
.mock-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-bottom: 4px;
}
.mock-input {
  height: 12px;
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 4px;
  background: rgba(16,185,129,0.05);
}
.mock-btn {
  height: 14px;
  background: var(--accent-emerald);
  border-radius: 4px;
  margin-top: 10px;
}

.promo-details h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--accent-mint);
}

.promo-details p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.promo-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-store-badge {
  background: #000000;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}
.app-store-badge:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-1px);
}

/* Modal Drawer for App Simulation */
.app-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-drawer-overlay.visible {
  display: flex;
}

.app-drawer-card {
  width: 100%;
  max-width: 440px;
  animation: zoomIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-mint);
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.drawer-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.premium-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.premium-feature-item svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-emerald);
}

.premium-pricing-box {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  text-align: center;
  margin: 1rem 0;
}

.pricing-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.pricing-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0;
}

.pricing-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- FOOTER --- */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--surface-border);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: var(--accent-emerald);
  text-decoration: underline;
}

.footer-right {
  display: flex;
  gap: 16px;
}

/* Toast Messages */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-emerald);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border-radius: var(--border-radius-sm);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.toast.toast-error {
  border-color: var(--accent-error);
}

.toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.toast.toast-error .toast-icon {
  fill: var(--accent-error);
}
.toast .toast-icon {
  fill: var(--accent-emerald);
}

/* Animations Helper */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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