/* SaveGrab — custom styles over Tailwind CDN */

/* ── Form controls ─────────────────────────────────────────── */
.sg-input {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: .75rem;
  padding: .75rem 1.25rem;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.sg-input::placeholder { color: #6b7280; }
.sg-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

.sg-btn-primary {
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
  padding: .75rem 1.75rem;
  border-radius: .75rem;
  transition: background .15s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.sg-btn-primary:hover { background: #6d28d9; }

.sg-btn-secondary {
  background: #374151;
  color: #fff;
  font-weight: 600;
  padding: .75rem 1.25rem;
  border-radius: .75rem;
  transition: background .15s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.sg-btn-secondary:hover { background: #4b5563; }

/* ── Platform hero badges ──────────────────────────────────── */
.badge-ig, .badge-fb, .badge-tw {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .9rem;
  border-radius: 999px;
  letter-spacing: .01em;
}
.badge-ig {
  background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
  color: #fff;
}
.badge-fb { background: #1877F2; color: #fff; }
.badge-tw { background: #000; border: 1px solid #333; color: #fff; }

/* ── Platform quick-link cards ─────────────────────────────── */
.platform-card {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #1f2937;
  border: 1px solid #374151;
  color: #d1d5db;
  padding: .5rem 1rem;
  border-radius: .75rem;
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s, color .15s;
}
.platform-card:hover { background: #374151; color: #fff; }

/* ── How-it-works steps ────────────────────────────────────── */
.step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(124,58,237,.12);
  border: 2px solid rgba(124,58,237,.35);
  color: #a78bfa;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
}

/* ── Loading spinner ───────────────────────────────────────── */
.sg-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #374151;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: sg-spin .65s linear infinite;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }

/* ── Result thumbnail ──────────────────────────────────────── */
.result-thumb {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: .75rem;
  margin-bottom: 1rem;
  display: block;
}

/* ── Download split-button ─────────────────────────────────── */
.dl-wrapper {
  position: relative;
  display: inline-block;
}

.dl-group {
  display: inline-flex;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(124,58,237,.3);
}

.dl-main {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #7c3aed;
  color: #fff;
  font-weight: 700;
  padding: .75rem 1.4rem;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  transition: background .15s;
  letter-spacing: .01em;
}
.dl-main:hover { background: #6d28d9; }
.dl-main:active { background: #5b21b6; }

.dl-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6d28d9;
  color: #fff;
  border: none;
  border-left: 1px solid rgba(255,255,255,.18);
  padding: .75rem .85rem;
  cursor: pointer;
  transition: background .15s;
}
.dl-arrow:hover { background: #5b21b6; }
.dl-arrow:active { background: #4c1d95; }

/* ── Dropdown quality panel ────────────────────────────────── */
.dl-dropdown {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 210px;
  background: #1a2030;
  border: 1px solid #374151;
  border-radius: .85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  overflow: hidden;
  z-index: 100;
  animation: dl-fade-in .12s ease;
}
@keyframes dl-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dl-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .65rem 1rem;
  background: none;
  border: none;
  color: #d1d5db;
  font-size: .9rem;
  cursor: pointer;
  text-align: left;
  transition: background .1s, color .1s;
  line-height: 1.3;
}
.dl-option:hover { background: #273044; color: #fff; }
.dl-option.is-default { color: #a78bfa; font-weight: 700; }
.dl-option.is-image   { color: #34d399; }

.dl-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #a78bfa;
}
.dl-check-space {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
}
.dl-img-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}

.dl-divider {
  height: 1px;
  background: #2d3748;
  margin: .3rem 0;
}

/* ── Single image block ────────────────────────────────────── */
.single-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
}

.single-img-thumb {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: .85rem;
  border: 1px solid #2d3748;
  display: block;
  background: #111827;
}

.dl-img-btn-single {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  padding: .7rem 1.4rem;
  border: none;
  border-radius: .75rem;
  cursor: pointer;
  font-size: .92rem;
  transition: background .15s;
  box-shadow: 0 2px 10px rgba(15,118,110,.35);
}
.dl-img-btn-single:hover  { background: #0d9488; }
.dl-img-btn-single:active { background: #0a7c72; }
.dl-img-btn-single:disabled { opacity: .6; cursor: default; }

/* ── Image grid (carousel / multiple) ─────────────────────── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-top: .25rem;
}

.img-card {
  display: flex;
  flex-direction: column;
  background: #111827;
  border: 1px solid #2d3748;
  border-radius: .85rem;
  overflow: hidden;
  transition: border-color .15s;
}
.img-card:hover { border-color: #4b5563; }
.img-card.is-video-card { border-color: #3730a3; }

.img-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #1f2937;
  position: relative;
}

.img-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.img-card:hover .img-card-thumb { transform: scale(1.04); }

.img-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  color: #6b7280;
  font-size: .8rem;
  font-weight: 600;
  background: #1f2937;
}

.img-card-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  color: #818cf8;
  font-size: .75rem;
  font-weight: 600;
  background: #1e1b4b;
}

.img-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .55rem .5rem;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  border: none;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .01em;
}
.img-card-btn:hover  { background: #0d9488; }
.img-card-btn:active { background: #0a7c72; }
.img-card-btn.is-video-btn            { background: #4f46e5; }
.img-card-btn.is-video-btn:hover      { background: #4338ca; }
.img-card-btn:disabled { opacity: .6; cursor: default; }

/* ── Legacy format buttons (kept for fallback) ──────────────── */
.format-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
  padding: .6rem 1.2rem;
  border-radius: .75rem;
  text-decoration: none;
  transition: background .15s;
  font-size: .9rem;
}
.format-btn:hover { background: #6d28d9; }
.format-btn.is-image { background: #0f766e; }
.format-btn.is-image:hover { background: #0d9488; }
