:root {
  --bg-app: #060913;
  --bg-card: #0d1527;
  --bg-card-sub: #131f38;
  --bg-input: #0a1020;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-cyan: #06b6d4;
  --telegram-blue: #229ED9;
  --telegram-hover: #0284c7;
  --whatsapp-green: #25D366;
  --success: #10b981;
  --danger: #ef4444;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --plyr-color-main: #6366f1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* MOBILE-FIRST WRAPPER (Max 520px on desktop, 100% on phone) */
.mobile-app-wrapper {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  position: relative;
}

@media (min-width: 521px) {
  .mobile-app-wrapper {
    box-shadow: 0 0 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin: 1.5rem auto;
    border-radius: 32px;
    overflow: hidden;
    min-height: calc(100vh - 3rem);
  }
}

/* STICKY MOBILE APP HEADER */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
}

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

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 3px 9px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-radius: var(--radius-full);
}

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

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* APP MAIN CONTENT */
.app-content {
  flex: 1;
  padding: 1.25rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* HERO TAGLINE (COMPACT FOR MOBILE) */
.mobile-hero {
  text-align: center;
  padding: 0.5rem 0.25rem 0.25rem;
}

.mobile-hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.text-gradient {
  background: linear-gradient(135deg, #a5b4fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-hero p {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* MOBILE CARD CONTAINER */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* INPUT FORM */
.input-box {
  position: relative;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #090e1c;
}

.input-icon {
  color: var(--text-muted);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.mobile-text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  width: 100%;
}

.mobile-text-input::placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.btn-paste {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-paste:active {
  transform: scale(0.95);
  background: rgba(99, 102, 241, 0.25);
}

/* SEPARATE ADD BUTTON (LEBAR & LEGA) */
.btn-add-queue-bar {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px dashed rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-add-queue-bar:hover, .btn-add-queue-bar:active {
  background: rgba(99, 102, 241, 0.24);
  border-style: solid;
  border-color: var(--accent-primary);
  color: #ffffff;
  transform: scale(0.98);
}

/* QUEUE BUILDER LIST (1 to 5 Links) */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.5rem 0 0.25rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.queue-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.725rem;
  font-weight: 700;
  flex-shrink: 0;
}

.queue-url-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.queue-url-domain {
  font-size: 0.775rem;
  font-weight: 600;
  color: #f8fafc;
}

.queue-url-full {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

.btn-remove-queue {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-remove-queue:hover, .btn-remove-queue:active {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* PRIMARY BUTTON (THUMB-FRIENDLY) */
.btn-submit-mobile {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.95rem 1.25rem;
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 6px 20px -3px var(--accent-glow);
  transition: all 0.15s ease;
}

.btn-submit-mobile:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-submit-mobile:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* SAMPLE CHIPS */
.sample-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.sample-bar::-webkit-scrollbar {
  display: none;
}

.sample-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.725rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chip:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
}

/* STATUS PROGRESS ALERT & BATCH PROGRESS */
.progress-alert {
  display: none;
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: #c7d2fe;
  align-items: center;
  gap: 0.5rem;
}

.batch-progress-wrapper {
  display: none;
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  flex-direction: column;
  gap: 0.45rem;
}

.batch-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #c7d2fe;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* RESULTS FEED */
.results-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.batch-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.25rem 0.5rem;
}

/* RESULTS SECTION (CINEMA CARD) */
.results-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* VIDEO PLAYER WRAPPER (TOP OF RESULTS) */
.mobile-player-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
}

.mobile-player-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* DETAILS & ACTION AREA */
.results-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.video-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.video-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge-format {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* BIG TELEGRAM BUTTON (HERO ACTION) */
.btn-telegram-mobile {
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, var(--telegram-blue), var(--telegram-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 18px rgba(34, 158, 217, 0.35);
  transition: all 0.15s ease;
}

.btn-telegram-mobile:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(34, 158, 217, 0.2);
}

.btn-telegram-mobile:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* SECONDARY ACTION GRID (2 COLS ON MOBILE) */
.action-grid-mobile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.btn-action-mobile {
  padding: 0.75rem 0.9rem;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action-mobile:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.08);
}

.btn-whatsapp-mobile {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #4ade80;
}

.btn-whatsapp-mobile:active {
  background: rgba(37, 211, 102, 0.2);
}

/* SHARE LINK BAR */
.share-link-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
}

.share-link-text {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.825rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-copy-mini:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

/* APP FOOTER */
.mobile-footer {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* SPINNER */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

/* PLYR OVERRIDES FOR MOBILE */
.plyr {
  --plyr-color-main: #6366f1;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

.plyr--video {
  background: #000 !important;
}
