/**
 * Universal Web Video, Audio & Image Downloader
 * Retains the exact mockup design & layout (side-by-side desktop stage,
 * quality radios, checkable multi-image grid, and ZIP downloads),
 * while using the platform's native dark slate & cyan color system.
 */

.ccdl-tool--universal {
  --uv-primary: #00aeef;
  --uv-primary-hover: #0284c7;
  --uv-primary-light: rgba(0, 174, 239, 0.15);
  --uv-primary-glow: rgba(0, 174, 239, 0.35);
  --uv-bg-card: rgba(15, 23, 42, 0.92);
  --uv-bg-sub: rgba(30, 41, 59, 0.7);
  --uv-bg-input: rgba(2, 6, 23, 0.65);
  --uv-border: rgba(148, 163, 184, 0.18);
  --uv-border-strong: rgba(148, 163, 184, 0.32);
  --uv-border-active: #00aeef;
  --uv-text-main: #f8fafc;
  --uv-text-sub: #cbd5e1;
  --uv-text-muted: #94a3b8;
  --uv-radius-card: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--uv-text-main);
  font-family: inherit;
}

.ccdl-tool--universal [hidden] {
  display: none !important;
}

/* ==========================================================================
   Hero Section matching mockup (Platform dark theme)
   ========================================================================== */
.ccdl-hero {
  text-align: center;
  padding: 2.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px solid var(--uv-border);
  background:
    radial-gradient(800px 200px at 50% -10%, rgba(0, 174, 239, 0.18), transparent 70%),
    radial-gradient(600px 180px at 100% 0%, rgba(99, 102, 241, 0.15), transparent 60%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(8, 14, 26, 0.94));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.ccdl-hero-content {
  max-width: 44rem;
  margin: 0 auto;
}

.ccdl-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--uv-primary);
}

.ccdl-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ccdl-title-highlight {
  color: var(--uv-primary);
  background: linear-gradient(135deg, #38bdf8, #00aeef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ccdl-sub {
  margin: 0 0 1.25rem;
  color: var(--uv-text-sub);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.5;
  font-weight: 500;
}

.ccdl-hero-features {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ccdl-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--uv-text-sub);
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--uv-border);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.ccdl-card {
  padding: 1.25rem 1.4rem;
  border-radius: var(--uv-radius-card);
  border: 1px solid var(--uv-border);
  background: var(--uv-bg-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   URL Input Card
   ========================================================================== */
.ccdl-input-card {
  background: var(--uv-bg-card);
  border: 1px solid var(--uv-border);
}

/* Input stack: [URL + Paste] → [Fetch + Clear] */
.ccdl-tool--universal .ccdl-url-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.ccdl-tool--universal .ccdl-url-row,
.ccdl-tool--universal .ccdl-action-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
}

.ccdl-tool--universal .ccdl-url-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  background: var(--uv-bg-input);
  border: 1.5px solid var(--uv-border-strong);
  border-radius: 12px;
  min-height: 52px;
  height: 52px;
  padding: 0 1rem 0 2.85rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ccdl-tool--universal .ccdl-url-field:focus-within {
  border-color: var(--uv-primary);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.25), 0 0 20px rgba(0, 174, 239, 0.15);
}

.ccdl-tool--universal .ccdl-url-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--uv-primary);
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

/* Beat .tool-widget input chrome so the field is one clean rectangle */
.ccdl-tool--universal .ccdl-url-field .ccdl-url-input,
.tool-widget .ccdl-tool--universal .ccdl-url-field .ccdl-url-input,
.tool-widget .ccdl-tool--universal #ccdlUrl {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #ffffff !important;
  background: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.ccdl-tool--universal .ccdl-url-field .ccdl-url-input:focus,
.tool-widget .ccdl-tool--universal .ccdl-url-field .ccdl-url-input:focus,
.tool-widget .ccdl-tool--universal #ccdlUrl:focus {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ccdl-tool--universal .ccdl-url-field .ccdl-url-input::placeholder,
.tool-widget .ccdl-tool--universal #ccdlUrl::placeholder {
  color: #64748b !important;
}

.ccdl-tool--universal .ccdl-paste-btn,
.ccdl-tool--universal .ccdl-fetch-btn,
.ccdl-tool--universal .ccdl-clear-btn {
  flex: 0 0 auto;
  min-width: 7.5rem;
  min-height: 52px;
  height: 52px;
  appearance: none;
  border-radius: 12px;
  padding: 0 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ccdl-tool--universal .ccdl-fetch-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.ccdl-tool--universal .ccdl-paste-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid var(--uv-border-strong);
  color: var(--uv-text-sub);
}

.ccdl-tool--universal .ccdl-paste-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: var(--uv-primary);
  color: #ffffff;
}

.ccdl-tool--universal .ccdl-fetch-btn {
  background: linear-gradient(135deg, #00aeef, #0284c7);
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 174, 239, 0.35);
}

.ccdl-tool--universal .ccdl-fetch-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #00aeef);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 174, 239, 0.5);
}

.ccdl-tool--universal .ccdl-fetch-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.ccdl-tool--universal .ccdl-clear-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid var(--uv-border);
  color: #94a3b8;
}

.ccdl-tool--universal .ccdl-clear-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

@media (max-width: 640px) {
  .ccdl-tool--universal .ccdl-url-row,
  .ccdl-tool--universal .ccdl-action-row {
    flex-direction: column;
  }

  .ccdl-tool--universal .ccdl-paste-btn,
  .ccdl-tool--universal .ccdl-fetch-btn,
  .ccdl-tool--universal .ccdl-clear-btn {
    width: 100%;
    min-width: 0;
  }
}

/* ==========================================================================
   Live Download HUD & Progress
   ========================================================================== */
.ccdl-progress {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ccdl-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--uv-text-sub);
}

.ccdl-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(2, 6, 23, 0.8);
  border-radius: 999px;
  overflow: hidden;
}

.ccdl-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00aeef, #38bdf8);
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.6);
  transition: width 0.2s ease;
}

.ccdl-live-hud {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--uv-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ccdl-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.ccdl-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00aeef;
  display: inline-block;
  margin-right: 0.4rem;
  animation: ccdl-pulse 1.4s ease infinite;
}

.ccdl-live-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .ccdl-live-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ccdl-live-metric {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--uv-border);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}

.ccdl-live-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--uv-text-muted);
  font-weight: 800;
}

.ccdl-live-val {
  display: block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.ccdl-status {
  margin-top: 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--uv-text-sub);
}
.ccdl-status.is-error { color: #f87171; }
.ccdl-status.is-ok { color: #4ade80; }

/* ==========================================================================
   RESULT CARD - EXACT MOCKUP HIERARCHY (Platform Dark Theme)
   ========================================================================== */
.ccdl-result-card {
  border: 1px solid var(--uv-border);
  padding: 1.5rem;
  background: var(--uv-bg-card);
}

/* Header */
.ccdl-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--uv-border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.ccdl-result-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.ccdl-demo-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--uv-border);
  color: var(--uv-text-sub);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

.ccdl-res-title-box {
  display: flex;
  flex-direction: column;
}

.ccdl-res-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.ccdl-res-sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--uv-text-muted);
}

.ccdl-media-counters {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ccdl-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  background: var(--uv-primary-light);
  color: var(--uv-primary);
  border: 1px solid rgba(0, 174, 239, 0.3);
}

.ccdl-result-header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ccdl-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.ccdl-ready-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.ccdl-open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--uv-primary);
  text-decoration: none;
}

.ccdl-open-link:hover {
  text-decoration: underline;
  color: #38bdf8;
}

/* ==========================================================================
   MAIN STAGE: Side-by-Side on Desktop, Stacked on Mobile/Tablet
   ========================================================================== */
.ccdl-main-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ccdl-main-stage {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Left Column: Player / Viewport */
.ccdl-stage-left {
  width: 100%;
}

.ccdl-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 440px;
  background: #020617;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--uv-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ccdl-video-player,
.ccdl-cover-viewer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
  border-radius: 12px;
}

.ccdl-center-play-btn {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ccdl-center-play-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 174, 239, 0.9);
  border-color: #fff;
}

.ccdl-preview-overlay-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--uv-border);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Sub-bar under video player matching mockup */
.ccdl-player-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.35rem 0.25rem;
  font-size: 0.78rem;
  color: var(--uv-text-muted);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ccdl-meta-ratio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--uv-text-sub);
}

.ccdl-meta-dims {
  font-weight: 600;
  color: var(--uv-text-sub);
}

.ccdl-meta-note {
  font-size: 0.74rem;
  color: var(--uv-text-muted);
  margin-left: auto;
}

/* Right Column: Download Control Panel */
.ccdl-stage-right {
  display: flex;
  flex-direction: column;
}

/* Tabs */
.ccdl-tabs {
  display: flex;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 1.15rem;
}

.ccdl-tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--uv-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.15s ease;
}

.ccdl-tab-btn:hover {
  color: var(--uv-text-main);
}

.ccdl-tab-btn.is-active {
  color: var(--uv-primary);
  border-bottom-color: var(--uv-primary);
}

/* Tab Panes */
.ccdl-tab-pane {
  display: flex;
  flex-direction: column;
}

.ccdl-pane-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.ccdl-pane-head-row .ccdl-pane-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.ccdl-pane-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ccdl-options-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--uv-text-muted);
}

.ccdl-ext-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ccdl-ext-select {
  appearance: none;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--uv-border);
  border-radius: 6px;
  padding: 0.22rem 1.6rem 0.22rem 0.65rem;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.ccdl-ext-select:focus {
  outline: none;
  border-color: var(--uv-primary);
}

.ccdl-select-arrow {
  position: absolute;
  right: 0.45rem;
  pointer-events: none;
  color: var(--uv-text-sub);
}

.ccdl-pane-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--uv-text-sub);
}

/* Quality Table Header matching mockup */
.ccdl-quality-table-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 0.35rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--uv-text-muted);
  margin-bottom: 0.4rem;
}

.ccdl-th-col.is-quality {
  text-align: left;
}

.ccdl-th-col.is-dims {
  text-align: center;
}

.ccdl-th-col.is-size {
  text-align: right;
}

/* Quality Radio List */
.ccdl-quality-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ccdl-quality-radio-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: center;
  padding: 0.72rem 0.95rem;
  border-radius: 10px;
  border: 1.5px solid var(--uv-border);
  background: var(--uv-bg-input);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.ccdl-quality-radio-row:hover {
  border-color: rgba(0, 174, 239, 0.5);
  background: rgba(30, 41, 59, 0.6);
}

.ccdl-quality-radio-row.is-active {
  border-color: var(--uv-primary);
  background: rgba(0, 174, 239, 0.12);
  box-shadow: 0 0 0 1px var(--uv-primary), 0 0 16px rgba(0, 174, 239, 0.18);
}

.ccdl-quality-radio-row.is-active .ccdl-quality-res {
  color: var(--uv-primary);
}

.ccdl-quality-radio-row.is-active .ccdl-quality-dims {
  color: #38bdf8;
}

.ccdl-quality-radio-row.is-active .ccdl-quality-size {
  color: #ffffff;
  font-weight: 800;
}

.ccdl-radio-row-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ccdl-custom-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ccdl-quality-radio-row.is-active .ccdl-custom-radio {
  border-color: var(--uv-primary);
  background: var(--uv-primary);
  box-shadow: inset 0 0 0 3px #0f172a;
}

.ccdl-quality-res {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.ccdl-format-tag {
  background: rgba(148, 163, 184, 0.15);
  color: var(--uv-text-sub);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.ccdl-best-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.ccdl-quality-dims {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--uv-text-sub);
  text-align: center;
}

.ccdl-quality-size {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--uv-text-muted);
  text-align: right;
}

/* More qualities accordion toggle */
.ccdl-more-qualities-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--uv-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0;
  margin-bottom: 0.85rem;
  width: 100%;
  transition: color 0.15s ease;
}

.ccdl-more-qualities-btn:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.ccdl-more-qualities-btn svg {
  transition: transform 0.2s ease;
}

.ccdl-more-qualities-btn.is-expanded svg {
  transform: rotate(180deg);
}

/* Primary Action Button */
.ccdl-primary-action-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00aeef, #0284c7);
  color: #ffffff !important;
  border: none !important;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 174, 239, 0.35);
  transition: all 0.15s ease;
}

.ccdl-primary-action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #00aeef);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 174, 239, 0.5);
}

.ccdl-primary-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ccdl-pane-footnote {
  font-size: 0.75rem;
  color: var(--uv-text-muted);
  margin: 0.75rem 0 0;
  line-height: 1.4;
}

.ccdl-link-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--uv-primary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.75rem;
  text-align: center;
}

.ccdl-link-btn:hover {
  color: #38bdf8;
}

/* Audio Widget inside Audio Tab */
.ccdl-audio-widget {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--uv-bg-input);
  border: 1px solid var(--uv-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.ccdl-audio-widget-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ccdl-audio-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 174, 239, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--uv-primary);
}

.ccdl-audio-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.ccdl-audio-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--uv-text-muted);
}

.ccdl-audio-player {
  width: 100%;
  height: 36px;
  border-radius: 6px;
}

/* ==========================================================================
   IMAGES SECTION (Multi-Item Gallery below stage - Platform Dark Theme)
   ========================================================================== */
.ccdl-images-section {
  border-top: 1px solid var(--uv-border);
  margin-top: 1.75rem;
  padding-top: 1.25rem;
}

.ccdl-images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ccdl-images-heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ccdl-images-heading-row svg {
  color: var(--uv-primary);
}

.ccdl-images-heading-row h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.ccdl-badge-pill {
  background: rgba(30, 41, 59, 0.85);
  color: var(--uv-text-sub);
  border: 1px solid var(--uv-border);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.ccdl-images-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--uv-text-muted);
}

.ccdl-images-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.ccdl-select-all-btn {
  appearance: none;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: #ffffff;
  font-weight: 700;
}

.ccdl-checkbox-box {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.9);
  transition: all 0.15s;
}

.ccdl-checkbox-box.is-checked {
  background: var(--uv-primary);
  border-color: var(--uv-primary);
  color: #fff;
}

.ccdl-checkbox-box.is-checked::after {
  content: '✓';
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.ccdl-selected-count-text {
  color: var(--uv-text-sub);
  font-weight: 600;
}

.ccdl-clear-selection-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--uv-primary);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}

.ccdl-clear-selection-btn:hover {
  color: #38bdf8;
}

/* Images Grid (6 columns on desktop matching mockup) */
.ccdl-images-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1100px) {
  .ccdl-images-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .ccdl-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Image Card */
.ccdl-img-card {
  position: relative;
  border: 1.5px solid var(--uv-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--uv-bg-input);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ccdl-img-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 174, 239, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ccdl-img-card.is-active-preview {
  border-color: var(--uv-primary) !important;
  box-shadow: 0 0 0 2px rgba(0, 174, 239, 0.35) !important;
}

.ccdl-img-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #020617;
}

.ccdl-img-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.ccdl-img-card:hover .ccdl-img-card-thumb {
  transform: scale(1.04);
}

.ccdl-img-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ccdl-img-card-checkbox.is-checked {
  background: var(--uv-primary);
  border-color: var(--uv-primary);
  color: #fff;
}

.ccdl-img-card-checkbox.is-checked::after {
  content: '✓';
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.ccdl-img-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--uv-border);
}

.ccdl-img-card-name {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.ccdl-img-card-name strong {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ccdl-img-card-name small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--uv-text-muted);
}

.ccdl-img-card-size {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 600;
}

.ccdl-img-card-dl-btn {
  appearance: none;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--uv-border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--uv-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ccdl-img-card-dl-btn:hover {
  background: var(--uv-primary);
  color: #fff;
  border-color: var(--uv-primary);
}

/* Bottom Action Bar */
.ccdl-images-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background: var(--uv-bg-input);
  border: 1px solid var(--uv-border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-top: 1rem;
  gap: 0.85rem 1.25rem;
}

.ccdl-bottom-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
}

.ccdl-bottom-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--uv-primary-light);
  border: 1px solid rgba(0, 174, 239, 0.35);
  color: var(--uv-primary);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.ccdl-bottom-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--uv-text-sub);
  font-weight: 500;
  line-height: 1.35;
}

.ccdl-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.ccdl-btn-secondary {
  appearance: none;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(0, 174, 239, 0.5);
  border-radius: 8px;
  padding: 0.55rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--uv-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ccdl-btn-secondary:hover {
  background: rgba(0, 174, 239, 0.15);
  border-color: var(--uv-primary);
  color: #ffffff;
}

.ccdl-btn-text {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--uv-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.ccdl-btn-text:hover {
  color: #38bdf8;
}

.ccdl-btn-download-selected {
  appearance: none;
  background: linear-gradient(135deg, #00aeef, #0284c7);
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 3px 12px rgba(0, 174, 239, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ccdl-btn-download-selected:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #00aeef);
}

.ccdl-btn-download-selected:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .ccdl-images-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .ccdl-bottom-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
  }
  .ccdl-bottom-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 0;
  }
  .ccdl-btn-download-active,
  .ccdl-btn-secondary,
  .ccdl-btn-download-selected {
    width: 100%;
    justify-content: center;
  }
}

@keyframes ccdl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
