/* ==========================================================
   AllDownload - Modern Dark Mode Theme
   Inspired by Minimalist Clean Design
   ========================================================== */

:root {
  --bg-color: #08090d;
  --card-bg: #0d0f15;
  --card-border: #1a1d27;
  --input-bg: #12141d;
  --input-border: #232736;
  --input-focus-border: #3b82f6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-btn-bg: #ffffff;
  --primary-btn-text: #08090d;
  --primary-btn-hover: #e2e8f0;
  
  --status-bg: #091424;
  --status-border: #162b48;
  --status-text: #93c5fd;
  --status-accent: #38bdf8;

  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.ambient-glow.top {
  width: 500px;
  height: 350px;
  background: #3b82f6;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
}

.ambient-glow.bottom {
  width: 400px;
  height: 300px;
  background: #6366f1;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
}

/* ==========================================================
   Splash Loading Screen
   ========================================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  animation: splashFadeIn 0.8s ease-out;
}

.splash-logo-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.splash-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1e2230, #13151f);
  border: 1px solid #2a2e40;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
  animation: logoPulse 2s infinite ease-in-out;
}

.splash-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  animation: glowPulse 2s infinite ease-in-out;
}

.splash-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.splash-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.splash-progress-bar {
  width: 180px;
  height: 4px;
  background-color: #1a1d27;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.splash-progress-inner {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 99px;
  animation: progressFill 1.4s ease-in-out forwards;
}

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

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

@keyframes progressFill {
  0% { width: 0%; }
  50% { width: 65%; }
  100% { width: 100%; }
}

/* ==========================================================
   Main Wrapper & Central Card
   ========================================================== */
.main-wrapper {
  width: 100%;
  max-width: 490px;
  z-index: 10;
  margin: auto 0;
}

.card-container {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 36px 30px 28px 30px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top Logo Badge (Matches "WQ" in reference image) */
.logo-badge-wrapper {
  margin-bottom: 16px;
}

.logo-badge {
  width: 58px;
  height: 58px;
  background: linear-gradient(145deg, #1c1f2a, #13151d);
  border: 1px solid #282c3c;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.logo-badge:hover {
  transform: translateY(-2px);
}

/* Header Text */
.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.app-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.app-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 380px;
}

/* Downloader Form */
.downloader-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.input-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Detected Platform Tag */
.detected-pill {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  animation: fadeIn 0.2s ease-in;
}

/* Input Group */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.url-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  padding: 14px 105px 14px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.url-input::placeholder {
  color: #4b5563;
}

.url-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background-color: #151822;
}

.input-actions {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-input-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-input-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-paste {
  background: #1e2230;
  border: 1px solid #2d3246;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-paste:hover {
  background: #282d40;
  color: #ffffff;
  border-color: #3b425b;
}

/* Primary Action Button (White contrast like reference image) */
.btn-primary {
  width: 100%;
  background-color: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background-color: var(--primary-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.25);
}

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

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

/* Status Notification Box (Matches blue info pill in reference) */
.status-box {
  background-color: var(--status-bg);
  border: 1px solid var(--status-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.25s ease;
}

.status-icon {
  color: var(--status-accent);
  font-size: 14px;
  margin-top: 1px;
}

.status-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#status-text {
  font-size: 12.5px;
  color: var(--status-text);
  line-height: 1.4;
  font-weight: 500;
}

.status-box.error {
  background-color: #240b0f;
  border-color: #4a151d;
}

.status-box.error .status-icon,
.status-box.error #status-text {
  color: #fca5a5;
}

.status-box.success {
  background-color: #0b221a;
  border-color: #144634;
}

.status-box.success .status-icon,
.status-box.success #status-text {
  color: #6ee7b7;
}

.status-progress-track {
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.status-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--status-accent), transparent);
  animation: indeterminate 1.5s infinite linear;
}

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

/* ==========================================================
   Results Card
   ========================================================== */
.result-card {
  width: 100%;
  background: #11141c;
  border: 1px solid #1f2330;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 4px;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-header {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.thumbnail-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background-color: #181b26;
  border: 1px solid #292e40;
}

.res-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.res-platform-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.res-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-author-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.author-avatar-wrap {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1f2433;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.res-author-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Downloads Section */
.downloads-section {
  border-top: 1px solid #1a1e2a;
  padding-top: 14px;
}

.downloads-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-item-btn {
  width: 100%;
  background: #181c27;
  border: 1px solid #282f42;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #f8fafc;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.download-item-btn:hover {
  background: #202636;
  border-color: #3b82f6;
  transform: translateX(2px);
}

.dl-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #232838;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 13px;
}

.dl-item-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dl-item-label {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.dl-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.dl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.dl-badge.hd {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.dl-badge.audio {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.3);
}

/* Secondary Button (Like "Docs" pill button in reference image) */
.sub-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.btn-sub {
  background-color: #12141c;
  border: 1px solid #202432;
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.btn-sub:hover {
  background-color: #1a1e2a;
  border-color: #30374b;
  color: #ffffff;
}

/* Footer (Matches "Developed by Dimass • v2.0" in reference) */
.app-footer {
  margin-top: 32px;
  text-align: center;
}

.app-footer p {
  font-size: 12px;
  color: #4b5563;
  letter-spacing: 0.02em;
}

.author-name {
  color: #9ca3af;
  font-weight: 600;
}

/* ==========================================================
   Supported Platforms Modal
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #0e1118;
  border: 1px solid #222736;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38bdf8;
  font-size: 16px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for modal */
.platforms-grid::-webkit-scrollbar {
  width: 4px;
}
.platforms-grid::-webkit-scrollbar-thumb {
  background: #252b3b;
  border-radius: 4px;
}

.platform-card-item {
  background: #141722;
  border: 1px solid #22283a;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  transition: all 0.2s ease;
}

.platform-card-item:hover {
  background: #1b2030;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.platform-card-item i {
  font-size: 16px;
}

/* ==========================================================
   Toast Notification
   ========================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  background: #161a24;
  border: 1px solid #2b3246;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  animation: toastUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast i {
  color: #10b981;
}

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

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 520px) {
  .card-container {
    padding: 28px 18px 22px 18px;
  }

  .url-input {
    font-size: 12.5px;
    padding: 13px 95px 13px 12px;
  }

  .platforms-grid {
    grid-template-columns: 1fr;
  }

  .thumbnail-wrapper {
    width: 80px;
    height: 80px;
  }
}
