/* ==========================================================================
   Modern Dark Theme Design System - Downloader App (Mobile Responsive Edition)
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-surface: rgba(18, 24, 38, 0.7);
  --bg-surface-elevated: rgba(28, 36, 56, 0.8);
  --bg-input: rgba(15, 20, 32, 0.85);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7f00ff;
  --accent-pink: #e100ff;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-brand: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #7f00ff 100%);
  --gradient-glow: linear-gradient(135deg, rgba(0,242,254,0.15) 0%, rgba(127,0,255,0.15) 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
  --shadow-glow-purple: 0 0 25px rgba(127, 0, 255, 0.25);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Elements */
.bg-glow-sphere-1 {
  position: fixed;
  top: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-sphere-2 {
  position: fixed;
  bottom: -200px;
  right: -150px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 0, 255, 0.15) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Layout */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #fff;
  flex-shrink: 0;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.nav-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-admin-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--border-active);
  color: var(--accent-cyan);
}

.btn-nav-adminpanel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

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

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Main Container */
.main-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  width: 100%;
  margin: 28px auto;
  padding: 0 16px;
  flex: 1;
}

/* Hero Title Section */
.hero-section {
  text-align: center;
  margin-bottom: 24px;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.75rem, 5vw + 0.8rem, 2.7rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.88rem, 2vw + 0.4rem, 1.05rem);
  max-width: 600px;
  margin: 0 auto;
}

/* Navigation Tabs */
.nav-tabs-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  width: 100%;
}

.nav-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 440px;
  gap: 6px;
  background: rgba(18, 24, 38, 0.85);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-fast);
  min-height: 42px;
  width: 100%;
  text-align: center;
}

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

.nav-tab-btn.active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* Downloader Glass Card */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.card-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.2rem, 3vw + 0.6rem, 1.4rem);
  margin-bottom: 6px;
}

.card-section-desc {
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-size: 0.92rem;
}

/* URL Input Area */
.url-input-container {
  display: flex;
  gap: 10px;
  position: relative;
  width: 100%;
}

.url-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  transition: var(--transition-fast);
  pointer-events: none;
  z-index: 2;
}

.url-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 90px 14px 44px;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-smooth);
  min-height: 48px;
}

.url-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.url-input:focus ~ .input-icon {
  color: var(--accent-cyan);
}

.btn-paste-input {
  position: absolute;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
  min-height: 32px;
  z-index: 3;
}

.btn-paste-input:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-color: var(--border-active);
}

.btn-inspect {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 22px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-glow);
  white-space: nowrap;
  min-height: 48px;
  flex-shrink: 0;
}

.btn-inspect:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

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

/* Supported Platform Pills */
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
  justify-content: center;
}

.platform-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Banned site caution banner */
.banned-site-caution-box {
  margin-top: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #fbbf24;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
  line-height: 1.4;
}

.caution-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Media Inspection Preview Card */
.media-preview-card {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  animation: fadeIn 0.4s ease;
}

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

.media-preview-grid {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: start;
}

.media-thumbnail-box {
  width: 260px;
  max-width: 100%;
  height: auto;
  min-height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #080b12;
  position: relative;
  border: 1px solid var(--border-active);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.media-thumbnail-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: opacity 0.25s ease;
}

.media-thumbnail-video {
  width: 100%;
  height: 100%;
  min-height: 160px;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #000;
}

.btn-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.95);
  color: #05070c;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.7);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 5;
}

.btn-play-overlay:hover {
  transform: translate(-50%, -50%) scale(1.12);
  background: #00f2fe;
  box-shadow: 0 0 32px rgba(0, 242, 254, 0.9);
}

.player-audio-sync-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00f2fe;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.2);
  z-index: 6;
  pointer-events: none;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
  animation: pulseDotAnim 1.5s infinite ease-in-out;
}

@keyframes pulseDotAnim {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #00f2fe; }
}

.media-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 4;
}

.media-meta-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.media-meta-title {
  font-size: clamp(1.05rem, 2vw + 0.6rem, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.media-meta-author {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.format-selection-group {
  margin-top: 8px;
}

.format-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.active-quality-pill {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.15));
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00f2fe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 9999px;
}

.format-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.format-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.format-option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.format-option-btn:hover {
  border-color: var(--accent-blue);
  background: rgba(79, 172, 254, 0.1);
}

.format-option-btn.selected {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(79, 172, 254, 0.4);
}

/* Direct Link Container */
.direct-link-container {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.4);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-active);
}

.direct-link-header {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.selected-format-badge {
  font-size: 0.78rem;
  color: var(--accent-blue);
}

.direct-link-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.direct-link-input {
  flex: 1;
  min-width: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.82rem;
  outline: none;
}

.direct-link-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-copy-link {
  cursor: pointer;
  white-space: nowrap;
}

.btn-open-link {
  cursor: pointer;
  white-space: nowrap;
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  text-decoration: none;
}

/* Photo Gallery Section */
.photo-gallery-section {
  margin-top: 24px;
}

.photo-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

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

.photo-gallery-title span {
  color: var(--accent-cyan);
}

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

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.photo-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: 0 10px 25px rgba(0, 242, 254, 0.15);
}

.photo-card-img-wrapper {
  width: 100%;
  background: #05070c;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.photo-card-img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.photo-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.photo-card-badge {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.75rem;
}

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

.btn-photo-action {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: var(--transition-fast);
  min-height: 38px;
}

.btn-photo-open {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
}

.btn-photo-open:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-glow);
}

.btn-photo-copy {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-photo-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* File Converter Drag/Drop Zone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  text-align: center;
  background: rgba(15, 20, 32, 0.5);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.dropzone-icon {
  width: 42px;
  height: 42px;
  color: var(--accent-cyan);
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dropzone-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.selected-files-list {
  margin-top: 16px;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.converter-actions-wrapper {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.target-format-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
  min-height: 48px;
  cursor: pointer;
}

.btn-convert-act {
  font-size: 0.95rem;
}

/* History Section */
.history-section {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}

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

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

.btn-clear-act {
  cursor: pointer;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
  transition: var(--transition-fast);
}

.btn-clear-act:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
}

.btn-refresh-act {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.btn-delete-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-row:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fff;
}

.history-table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.history-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.item-title {
  color: var(--text-primary);
  display: block;
}

.item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-type {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
}

.badge-type.video { background: rgba(79, 172, 254, 0.15); color: var(--accent-blue); }
.badge-type.audio { background: rgba(225, 0, 255, 0.15); color: var(--accent-pink); }
.badge-type.file { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-type.image_pdf { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.btn-file-dl {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  transition: var(--transition-fast);
  min-height: 34px;
}

.btn-file-dl:hover {
  background: var(--accent-cyan);
  color: #000;
}

.empty-history-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

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

/* Spinner Loader */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
}

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

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.nowrap {
  white-space: nowrap;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 768px) {
  .media-preview-grid {
    flex-direction: column;
  }

  .media-thumbnail-box {
    width: 100%;
    min-height: 200px;
  }

  .direct-link-controls {
    flex-direction: column;
  }

  .direct-link-input {
    width: 100%;
  }

  .direct-link-buttons {
    width: 100%;
  }

  .direct-link-buttons button,
  .direct-link-buttons a {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 12px 14px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .main-wrapper {
    margin: 20px auto;
    padding: 0 12px;
  }

  .glass-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .url-input-container {
    flex-direction: column;
  }

  .url-input {
    padding-right: 80px;
    font-size: 0.9rem;
  }

  .btn-inspect {
    width: 100%;
  }

  .format-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .format-option-btn {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .converter-actions-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .target-format-select {
    width: 100%;
  }

  .btn-convert-act {
    width: 100%;
  }

  /* History Table Card Transformation on Mobile */
  .history-section {
    padding: 18px 14px;
  }

  .history-table, 
  .history-table thead, 
  .history-table tbody, 
  .history-table th, 
  .history-table td, 
  .history-table tr {
    display: block;
  }

  .history-table thead {
    display: none;
  }

  .history-table tr {
    margin-bottom: 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
  }

  .history-table tr:hover td {
    background: transparent;
  }

  .history-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
  }

  .history-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 4px;
  }

  .history-table td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: left;
    padding-right: 12px;
  }

  .history-table td[data-label="Sarlavha & Sana"] {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .history-table td[data-label="Sarlavha & Sana"]::before {
    margin-bottom: 4px;
  }

  .history-table td.empty-history-cell {
    display: block;
    text-align: center;
  }

  .history-table td.empty-history-cell::before {
    content: none;
  }

  .photo-gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .nav-tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .platform-pill {
    font-size: 0.72rem;
    padding: 4px 8px;
  }

  .format-options-grid {
    grid-template-columns: 1fr;
  }
}

/* Header Admin Info Brand Badge (NexusDown Logo Style) */
.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid rgba(0, 242, 254, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-smooth);
}

.admin-nav-brand:hover {
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
  background: rgba(28, 36, 56, 0.8);
}

.admin-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #ffffff;
  flex-shrink: 0;
}

.admin-nav-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}


/* Admin Info Section Card (NexusDown Logo Theme) */
.admin-info-section {
  margin-top: 36px;
}

.admin-info-card {
  position: relative;
  background: rgba(18, 24, 38, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm), 0 0 30px rgba(0, 242, 254, 0.05);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  overflow: hidden;
}

.admin-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
}

.admin-info-card:hover {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.admin-info-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-avatar-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.admin-title-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-info-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.admin-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.admin-detail-item {
  background: rgba(15, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.admin-detail-item:hover {
  border-color: rgba(0, 242, 254, 0.3);
  background: rgba(28, 36, 56, 0.8);
  transform: translateY(-1px);
}

.admin-detail-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.admin-detail-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.admin-detail-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
  transition: all var(--transition-fast);
  width: fit-content;
}

.admin-telegram-link:hover {
  box-shadow: var(--shadow-glow);
  transform: scale(1.04);
}

/* User Auth Header Component */
.user-auth-wrapper {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.btn-google-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
}

.btn-google-auth:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px 4px 6px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-cyan);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: 2px;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.35);
  color: #ffffff;
  transform: scale(1.08);
}

/* ==========================================================================
   Header Auth Navigation Buttons
   ========================================================================== */
.btn-nav-login, .btn-nav-signup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-nav-login {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-nav-login:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-nav-signup {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-nav-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
  opacity: 0.95;
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-back-home:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ==========================================================================
   Auth Page Layout & Glassmorphism Card
   ========================================================================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #0a0d14;
}

.auth-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 21, 37, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #00f2fe);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #a855f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Tab Switcher Controls
   ========================================================================== */
.auth-tabs-group {
  display: flex;
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 24px;
  position: relative;
}

.auth-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab-btn svg {
  transition: transform 0.25s ease;
}

.auth-tab-btn:hover {
  color: var(--text-primary);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}

.auth-tab-btn.active svg {
  transform: scale(1.1);
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeInForm 0.35s ease forwards;
}

.auth-form.hidden-form {
  display: none !important;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

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

.form-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-forgot-link {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-forgot-link:hover {
  text-decoration: underline;
  color: #a855f7;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.92rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-input:focus {
  outline: none;
  border-color: #a855f7;
  background: rgba(12, 18, 34, 0.9);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.form-input:focus ~ .input-icon {
  color: #a855f7;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.btn-toggle-password:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Custom Checkbox
   ========================================================================== */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-left: 26px;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-secondary);
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: rgba(8, 12, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: #a855f7;
}

.custom-checkbox input:checked ~ .checkmark {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-color: transparent;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-text a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.checkbox-text a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Buttons & Divider
   ========================================================================== */
.btn-auth-primary {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.35);
  transition: all 0.25s ease;
  margin-top: 6px;
}

.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.5);
}

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

.btn-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;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 10px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.social-auth-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-google-auth-full {
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.btn-google-auth-full:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ==========================================================================
   Password Strength Meter
   ========================================================================== */
.pwd-meter-box {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pwd-meter-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.pwd-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-none { width: 0%; background-color: transparent; }
.strength-weak { width: 25%; background-color: #ef4444; }
.strength-fair { width: 50%; background-color: #f59e0b; }
.strength-good { width: 75%; background-color: #3b82f6; }
.strength-strong { width: 100%; background-color: #10b981; }

.pwd-meter-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pwd-meter-text strong {
  color: var(--text-primary);
}

.pwd-criteria-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.crit-item {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;

}

.crit-item.valid {
  color: #10b981;
}

.crit-item.valid .crit-icon {
  color: #10b981;
}

.pwd-match-hint {
  font-size: 0.78rem;
  margin-top: 4px;
  font-weight: 600;
}

.pwd-match-hint.match-success {
  color: #10b981;
}

.pwd-match-hint.match-error {
  color: #ef4444;
}

/* ==========================================================================
   Alert Notifications
   ========================================================================== */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDownAlert 0.3s ease;
}

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

.auth-alert.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-alert.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ==========================================================================
   Image to PDF & Converter Enhanced Component Styles
   ========================================================================== */
.converter-main-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.converter-header-block {
  margin-bottom: 4px;
}

.converter-options-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.converter-options-summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -12px 0;
}

.converter-options-summary::-webkit-details-marker {
  display: none;
}

.converter-options-summary::after {
  content: "▾";
  margin-left: auto;
  transition: transform 0.2s ease;
}

.converter-options-panel[open] > .converter-options-summary {
  margin-bottom: 16px;
}

.converter-options-panel[open] > .converter-options-summary::after {
  transform: rotate(180deg);
}

.summary-hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.options-group-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.option-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.converter-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition-fast);
  cursor: pointer;
}

.converter-select option {
  background: #0f172a;
  color: #f8fafc;
}

.converter-select:focus, .converter-select:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

.btn-toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.btn-toggle-pill {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-toggle-pill.active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 242, 254, 0.3);
}

.options-extra-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.converter-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Manager Toolbar */
.converter-manager-section {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.converter-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 14px;
}

.manager-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.manager-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.manager-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-manager-act {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-manager-act:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-manager-act.btn-add-more {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
}

.btn-manager-act.btn-add-more:hover {
  background: rgba(0, 242, 254, 0.22);
}

.btn-manager-act.btn-clear-all {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.btn-manager-act.btn-clear-all:hover {
  background: rgba(244, 63, 94, 0.2);
}

/* Image Thumbnail Cards Grid */
.image-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.image-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.image-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.image-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}

.image-card-page-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  background: rgba(10, 13, 20, 0.85);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  z-index: 5;
  backdrop-filter: blur(4px);
}

.image-card-thumb-wrapper {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-card-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.image-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.image-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-card-meta-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.image-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-card-act {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.btn-card-act:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-card-act.btn-del-card:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.converter-bottom-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   Pop-up Modals & Search Quota Pill Styles
   ========================================================================== */
.search-limit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #00f2fe;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.15);
  margin: 0;
}

.popup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.popup-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 242, 254, 0.15);
}

.popup-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.popup-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.popup-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(121, 40, 202, 0.15));
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.2);
}

.popup-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.popup-modal-sub {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 22px;
}

.telegram-contact-box {
  background: rgba(0, 136, 204, 0.12);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 22px;
}

.telegram-icon {
  font-size: 1.8rem;
}

.telegram-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telegram-text span {
  font-size: 0.78rem;
  color: #94a3b8;
}

.telegram-text strong {
  font-size: 1rem;
  color: #38bdf8;
}

.popup-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-popup-primary {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.btn-popup-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(168, 85, 247, 0.5);
}

.btn-popup-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-popup-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-popup-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #00a2f3 100%);
  color: #ffffff;
  padding: 13px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 136, 204, 0.4);
  transition: all 0.2s ease;
}

.btn-popup-telegram:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 136, 204, 0.6);
}

.format-option-card.locked {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}
.format-option-card.locked:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Comprehensive Mobile Responsive Media Queries (< 768px and < 480px)
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 12px;
  }

  .header-container {
    gap: 6px;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Icon-only buttons were unreadable and under 44px. Keep one labelled "Kirish"
     button; signup and Google sign-in are both offered on the /login/ page. */
  .nav-admin-btn,
  .btn-nav-signup,
  .btn-google-auth {
    display: none;
  }

  .search-limit-pill {
    padding: 5px 8px;
    font-size: 0.76rem;
    margin-left: 0;
    gap: 3px;
  }

  .btn-nav-login {
    min-height: 44px;
    padding: 0 16px;
    font-size: 0.88rem;
  }

  .btn-logout {
    width: 36px;
    height: 36px;
  }

  .user-profile-badge {
    padding: 4px 8px;
    gap: 6px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
  }

  .user-name {
    font-size: 0.78rem;
    max-width: 80px;
  }

  .user-email {
    display: none;
  }

  .main-wrapper {
    margin: 16px auto;
    padding: 0 12px;
  }

  .hero-section {
    margin-bottom: 18px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .glass-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
  }

  .url-input-container {
    flex-direction: column;
    gap: 10px;
  }

  /* >=16px stops iOS Safari auto-zooming on focus now that pinch-zoom is allowed. */
  .url-input,
  .form-input,
  .converter-select,
  .admin-search-input {
    font-size: 16px;
  }

  .url-input {
    padding: 12px 85px 12px 38px;
    min-height: 44px;
  }

  .input-icon {
    left: 12px;
    width: 18px;
    height: 18px;
  }

  .btn-paste-input {
    right: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 28px;
  }

  .btn-inspect {
    width: 100%;
    min-height: 44px;
    font-size: 0.95rem;
  }

  .media-preview-grid {
    flex-direction: column;
    gap: 14px;
  }

  .media-thumbnail-box {
    width: 100%;
    max-width: 100%;
    min-height: 140px;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .history-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .history-actions-header {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .history-actions-header .btn-file-dl {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 6px 8px;
  }

  .history-title {
    font-size: 1.2rem;
  }

  .admin-details-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-detail-item {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 8px 10px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  /* Safety net only: with the 768px pass above the header fits on one row. */
  .header-container {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-tabs {
    max-width: 100%;
  }

  .nav-tab-btn {
    font-size: 0.8rem;
    padding: 8px 6px;
    gap: 4px;
    min-height: 38px;
  }

  .nav-tab-btn svg {
    width: 15px;
    height: 15px;
  }

  .platform-pill {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .banned-site-caution-box {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .caution-icon {
    font-size: 1rem;
  }

  .converter-manager-actions {
    flex-direction: column;
    width: 100%;
  }

  .converter-manager-actions .btn-manager-act {
    width: 100%;
    justify-content: center;
  }

  .popup-modal-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .popup-modal-title {
    font-size: 1.2rem;
  }
}

/* Touch devices: give small controls a ~44px hit area without changing how they look on desktop. */
@media (pointer: coarse) {
  .btn-paste-input,
  .btn-clear-act,
  .btn-refresh-act,
  .nav-tab-btn,
  .admin-telegram-link,
  .btn-back-home {
    min-height: 44px;
  }

  .form-forgot-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .btn-toggle-password {
    min-width: 44px;
    min-height: 44px;
    right: 2px;
  }

  .brand {
    min-height: 44px;
    align-items: center;
  }
}
