/* ============================================================
   Tool Page — Shared CSS (for individual downloader pages)
   ============================================================ */

/* Tool Page Hero */
.tool-hero {
  padding: 60px 0 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tool-hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--tool-from, #6c63ff), var(--tool-to, #4f46e5));
  z-index: 0;
}
.tool-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,.15), transparent 60%);
}
.tool-hero__inner { position: relative; z-index: 1; }
.tool-hero__icon {
  font-size: 3rem;
  color: rgba(255,255,255,.9);
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.2));
}
.tool-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.tool-hero p {
  color: rgba(255,255,255,.8);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Tool Input Box */
.tool-input-section { padding: 0 0 60px; }
.tool-input-card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  max-width: 760px;
  margin: -40px auto 0;
  position: relative;
  z-index: 10;
}
.tool-input-card h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}
.tool-input-box {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.tool-input-box input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border var(--transition);
  background: var(--bg-alt);
  color: var(--text);
}
.tool-input-box input:focus { border-color: var(--primary); background: var(--bg); }
.tool-input-box input::placeholder { color: var(--text-light); }
.tool-input-hint {
  font-size: 12.5px;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Result Area */
.tool-result {
  display: none;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}
.tool-result.visible { display: block; }
.tool-result__media {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.tool-result__thumb {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.tool-result__info h3 { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.tool-result__info p { font-size: 13px; color: var(--text-muted); }
.tool-result__links { display: flex; flex-direction: column; gap: 10px; }
.download-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color var(--transition);
}
.download-option:hover { border-color: var(--primary); }
.download-option__label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.download-option__meta { font-size: 12.5px; color: var(--text-muted); }
.download-option .btn { flex-shrink: 0; }

/* Loading Spinner */
.tool-loading {
  display: none;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}
.tool-loading.visible { display: block; }
.tool-loading__spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tool Info Section */
.tool-info { padding: 60px 0; background: var(--bg-alt); }
.tool-info .container { max-width: 820px; }
.tool-info h2 { font-size: 1.6rem; margin-bottom: 16px; }
.tool-info p { color: var(--text-muted); font-size: 15px; line-height: 1.75; margin-bottom: 16px; }
.tool-info ul { list-style: disc; padding-left: 20px; }
.tool-info ul li {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 8px;
}

/* Related Tools */
.related-tools { padding: 60px 0; }
.related-tools h2 { font-size: 1.6rem; margin-bottom: 32px; text-align: center; }
.related-tools .tools__grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================================
   Cobalt Result UI
   ============================================================ */

/* Result container reveal */
#toolResult {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
#toolResult.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Base card */
.cobalt-result {
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
}

/* Header row */
.cobalt-result__header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--text);
}
.cobalt-result__ok {
  color: #22c55e;
  font-size: 1.25rem;
}

/* Single file item */
.cobalt-result__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-alt, #f8f9fb);
  border-radius: 12px;
}
.cobalt-result__filename {
  font-size: .93rem;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
}
.cobalt-result__meta {
  font-size: .82rem;
  color: var(--text-muted);
}

/* Audio row */
.cobalt-result__audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-alt, #f8f9fb);
  font-size: .9rem;
  color: var(--text-muted);
}
.cobalt-result__audio-row i { color: var(--primary); }
.cobalt-result__audio-row span { flex: 1; }

/* Error state */
.cobalt-result--error {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
}
.cobalt-result--error i {
  font-size: 2.5rem;
  color: #ef4444;
  margin-bottom: 12px;
}

/* ── Picker Grid ────────────────────────────────────────────── */
.cobalt-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.cobalt-picker__item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border, #e5e7eb);
  background: var(--bg-alt, #f8f9fb);
  display: flex;
  flex-direction: column;
}

.cobalt-picker__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.cobalt-picker__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  background: var(--bg-alt);
}

.cobalt-picker__item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: .78rem;
  color: var(--text-muted);
}

.cobalt-picker__badge {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
}
.cobalt-picker__badge--video { background: #6c63ff; }
.cobalt-picker__badge--photo { background: #22c55e; }

.cobalt-picker__dl {
  margin: 0 10px 10px;
  justify-content: center;
}

.cobalt-picker__dl-all {
  width: 100%;
  margin-top: 4px;
}

/* Buttons size variant */
.btn--sm {
  padding: 8px 16px;
  font-size: .85rem;
  border-radius: 10px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cobalt-result__item { flex-direction: column; align-items: flex-start; }
  .cobalt-result__item .btn { width: 100%; justify-content: center; }
  .cobalt-picker__grid { grid-template-columns: repeat(2, 1fr); }
}
