/* ===== GLOBAL STYLES ===== */
* { margin:0; padding:0; box-sizing:border-box; }

:root {
  --cyan: #00D9FF;
  --magenta: #FF0050;
  --grad: linear-gradient(135deg,#00D9FF 0%,#FF0050 100%);
  --dark-bg: #0F0F0F;
  --card-bg: #1A1A1A;
  --header-bg: #0A0A0A;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-inv: #FFFFFF;
  --border: #2A2A2A;
  --surface: #FFFFFF;
  --surface2: #F9FAFB;
}

body {
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI','Roboto',sans-serif;
  background: var(--surface2);
  color: var(--text-primary);
  transition: background .3s, color .3s;
  min-height: 100vh;
  overflow-x: hidden;
}

body[data-theme=dark] {
  --surface: #1E2330;
  --surface2: #0F0F0F;
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  background: var(--surface2);
  color: var(--text-primary);
}

/* ─── TOAST ─── */
#toast {
  position: fixed; top: 80px; right: 20px; z-index: 9999;
  background: #111; color: #fff; padding: .65rem 1.1rem;
  border-radius: 8px; font-size: .88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .3s;
  display: flex; align-items: center; gap: .5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; }
#toast.success { border-left: 3px solid #10B981; }
#toast.error   { border-left: 3px solid var(--magenta); }
#toast.info    { border-left: 3px solid var(--cyan); }

/* ─── HEADER ─── */
header {
  background: rgba(255,255,255,.97);
  padding: 1rem 2rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: background .3s;
}
body[data-theme=dark] header { background: rgba(14,18,28,.97); }

.header-content {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-size: 1.45rem; font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; gap: .4rem;
  text-decoration: none;
}
.header-nav { display: flex; gap: 1.8rem; list-style: none; }
.header-nav a {
  text-decoration: none; color: var(--text-primary);
  font-size: .95rem; font-weight: 500; transition: color .2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--cyan); }
.theme-toggle {
  background: transparent; border: 2px solid var(--cyan);
  color: var(--cyan); padding: .45rem .8rem;
  border-radius: 8px; cursor: pointer;
  font-size: .9rem; font-weight: 600; transition: all .2s;
}
.theme-toggle:hover { background: var(--cyan); color: #000; }

.menu-toggle {
  display: none;
  background: transparent; border: none;
  color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer;
  padding: 0.5rem; z-index: 1001;
}
body[data-theme='dark'] .menu-toggle { color: #fff; }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header-nav {
    position: fixed; top: 0; right: -100%; width: 250px; height: 100vh;
    background: var(--surface); flex-direction: column;
    padding: 80px 2rem 2rem; box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease; z-index: 1000;
  }
  .header-nav.active { right: 0; }
  .header-nav li { width: 100%; }
  .header-nav a { display: block; padding: 1rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--border); }
  .header-controls { order: 2; }
  .logo { order: 1; margin-right: auto; }
}

.hero > div, .hero > form, .hero > section { width: 100%; }
.hero .input-section, .hero .batch-toggle-row, .hero #batch-area { width: 100%; max-width: 860px; }
.input-wrapper .btn-clip, .input-wrapper .btn-fetch { width: auto; flex: 0 0 auto; }

/* ─── HERO ─── */
.hero {
  background: var(--grad);
  padding: 1rem 2rem 5rem;
  min-height: 360px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  color: #fff; text-align: center; position: relative; overflow: visible;
}
.hero h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: .7rem; }
.hero p  { font-size: 1.05rem; opacity: .93; margin-bottom: 1.6rem; }

/* ─── INPUT SECTION ─── */
.input-section {
  width: 100%; max-width: 860px;
  margin: 0 auto; padding: 0 1rem;
  position: relative; z-index: 10;
}
.input-wrapper {
  background: #fff; border-radius: 12px;
  padding: .85rem; display: flex; gap: .5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
  border: 2px solid transparent; transition: border .2s, box-shadow .2s;
}
body[data-theme=dark] .input-wrapper { background: #1E2330; }
.input-wrapper:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 10px 40px rgba(0,217,255,.2);
}
.input-wrapper input {
  flex: 1; border: none; outline: none;
  padding: .65rem .9rem; font-size: .98rem;
  background: transparent; color: var(--text-primary);
}
.input-wrapper input::placeholder { color: #9CA3AF; }
.btn-clip {
  background: var(--cyan); border: none; padding: .65rem .9rem;
  border-radius: 8px; cursor: pointer; color: #000; font-size: .9rem;
  font-weight: 600; transition: all .2s; display: flex; align-items: center;
}
.btn-clip:hover { background: #00B8CC; transform: scale(1.05); }
.btn-fetch {
  background: var(--magenta); border: none; padding: .65rem 1.3rem;
  border-radius: 8px; cursor: pointer; color: #fff;
  font-size: .95rem; font-weight: 600;
  transition: all .2s; display: flex; align-items: center; gap: .4rem;
}
.btn-fetch:hover:not(:disabled) { background: #cc0040; transform: scale(1.05); }
.btn-fetch:disabled { opacity: .5; cursor: not-allowed; }

/* ─── BATCH TOGGLE ─── */
.batch-toggle-row {
  max-width: 860px; margin: .6rem auto 0;
  padding: 0 1rem;
  display: flex; align-items: center; gap: .7rem;
  color: rgba(255,255,255,.85); font-size: .85rem;
}
.switch {
  position: relative; display: inline-block; width: 36px; height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider-sw {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,.3); border-radius: 20px; transition: .3s;
}
.slider-sw:before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background: white;
  border-radius: 50%; transition: .3s;
}
.switch input:checked + .slider-sw { background: rgba(255,255,255,.7); }
.switch input:checked + .slider-sw:before { transform: translateX(16px); }

/* ─── BATCH TEXTAREA ─── */
#batch-area {
  display: none; max-width: 860px; margin: .7rem auto 0; padding: 0 1rem;
}
#batch-urls {
  width: 100%; height: 100px; background: #fff;
  border: 2px solid transparent; border-radius: 12px;
  padding: .8rem 1rem; font-size: .9rem;
  resize: vertical; outline: none; transition: border .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  color: var(--text-primary);
}
body[data-theme=dark] #batch-urls { background: #1E2330; }
#batch-urls:focus { border-color: var(--cyan); }
.batch-controls {
  display: flex; gap: .6rem; margin-top: .5rem;
  align-items: center; flex-wrap: wrap;
}
.btn-batch {
  background: var(--magenta); border: none; padding: .6rem 1.2rem;
  border-radius: 8px; cursor: pointer; color: #fff;
  font-size: .88rem; font-weight: 600; transition: all .2s;
  display: flex; align-items: center; gap: .4rem;
}
.btn-batch:hover:not(:disabled) { background: #cc0040; }
.btn-batch:disabled { opacity: .5; cursor: not-allowed; }
.quality-select {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  color: #fff; padding: .5rem .8rem; border-radius: 8px;
  font-size: .88rem; cursor: pointer; outline: none;
}
body[data-theme=dark] .quality-select { background: #1E2330; color: var(--text-primary); border-color: #374151; }

/* ─── MAIN CONTAINER ─── */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ─── BATCH PROGRESS ─── */
#batch-progress { display: none; margin-bottom: 1.5rem; }
.batch-progress-card {
  background: var(--surface); border-radius: 12px;
  padding: 1.3rem 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.batch-progress-card h4 { font-size: 1rem; margin-bottom: .9rem; }
.progress-bar-wrap {
  background: #E5E7EB; border-radius: 99px; height: 10px; overflow: hidden; margin-bottom: .7rem;
}
body[data-theme=dark] .progress-bar-wrap { background: #374151; }
.progress-bar-inner {
  height: 100%; background: var(--grad);
  border-radius: 99px; transition: width .3s; width: 0%;
}
.batch-log { font-size: .82rem; color: var(--text-secondary); max-height: 100px; overflow-y: auto; }
.batch-log p { margin-bottom: .2rem; }
.log-done   { color: #10B981; }
.log-failed { color: var(--magenta); }

/* ─── PREVIEW ─── */
.preview { display: none; margin-bottom: 2rem; animation: fadeUp .4s ease; }

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

.preview-card {
  background: var(--surface); border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.09); overflow: hidden;
}

/* Metadata strip */
.meta-strip {
  display: none; padding: .9rem 1.2rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  gap: .8rem; align-items: center;
}
body[data-theme=dark] .meta-strip { border-color: rgba(255,255,255,.07); }
.meta-strip.show { display: flex; }
.meta-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: .85rem; font-weight: 700;
  flex-shrink: 0;
}
.meta-info { flex: 1; min-width: 0; }
.meta-author { font-weight: 600; font-size: .9rem; }
.meta-title  { font-size: .82rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-stats  { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-secondary); flex-shrink: 0; }
.meta-stats span { display: flex; align-items: center; gap: .3rem; }

.preview-media-container {
  position: relative; width: 100%; max-height: 480px;
  background: #000; display: flex; justify-content: center; align-items: center;
}
.preview-media-container img,
.preview-media-container video {
  max-width: 100%; max-height: 480px; object-fit: contain;
}
.preview-controls {
  padding: 1rem 1.2rem; display: flex; gap: .7rem; flex-wrap: wrap;
}

/* Quality toggle in controls */
.quality-toggle {
  display: flex; background: #F3F4F6; border-radius: 8px; overflow: hidden;
}
body[data-theme=dark] .quality-toggle { background: #374151; }
.quality-toggle button {
  border: none; padding: .55rem 1rem; cursor: pointer; font-size: .85rem;
  font-weight: 600; background: transparent; color: var(--text-secondary);
  transition: all .2s;
}
.quality-toggle button.active {
  background: var(--grad); color: #fff;
}

.btn-dl {
  background: var(--magenta); border: none; padding: .65rem 1.3rem;
  border-radius: 8px; cursor: pointer; color: #fff;
  font-size: .92rem; font-weight: 600; transition: all .2s;
  display: flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.btn-dl:hover:not(:disabled) { background: #cc0040; box-shadow: 0 4px 12px rgba(255,0,80,.3); }
.btn-dl:disabled { opacity: .5; cursor: not-allowed; }
.btn-audio {
  background: transparent; border: 2px solid var(--cyan);
  color: var(--cyan); padding: .6rem 1rem;
  border-radius: 8px; cursor: pointer; font-size: .88rem; font-weight: 600;
  transition: all .2s; display: flex; align-items: center; gap: .35rem;
}
.btn-audio:hover:not(:disabled) { background: var(--cyan); color: #000; }
.btn-audio:disabled { opacity: .5; cursor: not-allowed; }

/* Photo gallery */
.gallery-header {
  padding: 1rem 1.2rem; border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: space-between;
}
body[data-theme=dark] .gallery-header { border-color: rgba(255,255,255,.07); }
.gallery-header h3 { font-size: 1rem; }
.btn-dl-all {
  background: var(--grad); border: none; padding: .55rem 1.1rem;
  border-radius: 8px; cursor: pointer; color: #fff;
  font-size: .85rem; font-weight: 600; transition: all .2s;
  display: flex; align-items: center; gap: .35rem;
}
.btn-dl-all:hover:not(:disabled) { opacity: .88; transform: scale(1.03); }
.btn-dl-all:disabled { opacity: .5; cursor: not-allowed; }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
  gap: 1rem; padding: 1.2rem;
}
.photo-item {
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: transform .2s;
}
.photo-item:hover { transform: translateY(-3px); }
.photo-item img { width: 100%; height: 260px; object-fit: cover; display: block; }
.photo-item-controls {
  padding: .7rem; display: flex; flex-direction: column; gap: .4rem;
  background: var(--surface);
}
.photo-item-controls p { font-size: .78rem; color: var(--text-secondary); text-align: center; margin: 0; }
.photo-item-controls button {
  padding: .5rem; background: var(--magenta); border: none;
  border-radius: 7px; color: #fff; font-weight: 600; cursor: pointer;
  font-size: .82rem; transition: all .2s;
}
.photo-item-controls button:hover:not(:disabled) { background: #cc0040; }
.photo-item-controls button:disabled { opacity: .5; cursor: not-allowed; }

/* Shared spinner */
.spinner-center { display: flex; justify-content: center; padding: 2rem; }
.spinner {
  border: 4px solid rgba(0,217,255,.2);
  border-top: 4px solid var(--cyan);
  border-radius: 50%; width: 40px; height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── HISTORY ─── */
#history-section {
  display: none; margin-bottom: 2rem;
}
.history-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .7rem;
}
.history-header h3 { font-size: 1rem; font-weight: 600; }
.btn-clear-hist {
  background: transparent; border: 1px solid #E5E7EB;
  color: var(--text-secondary); padding: .35rem .8rem;
  border-radius: 7px; cursor: pointer; font-size: .8rem; transition: all .2s;
}
.btn-clear-hist:hover { border-color: var(--magenta); color: var(--magenta); }
.history-grid {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: .8rem;
}
.hist-item {
  background: var(--surface); border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); cursor: pointer; transition: transform .2s;
}
.hist-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.hist-thumb {
  width: 100%; height: 100px; object-fit: cover; background: #E5E7EB; display: block;
}
.hist-info { padding: .5rem .65rem; }
.hist-author { font-size: .78rem; font-weight: 600; }
.hist-time   { font-size: .72rem; color: var(--text-secondary); }

/* ─── FEATURE CARDS ─── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.feature-card {
  background: var(--surface); border-radius: 12px; padding: 1.6rem;
  text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: all .3s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.feature-icon {
  font-size: 2rem; margin-bottom: .8rem;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature-card p  { color: var(--text-secondary); font-size: .88rem; margin: 0; }

/* ─── HOW IT WORKS ─── */
.how-it-works {
  max-width: 900px; margin: 3.5rem auto; padding: 0 1.5rem; text-align: center;
}
.how-it-works h2 {
  font-size: 2rem; margin-bottom: 2rem;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.how-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 1.5rem; }
.how-card {
  background: var(--surface); border-radius: 12px; padding: 2rem 1.5rem;
  box-shadow: 0 3px 12px rgba(0,0,0,.07); transition: all .3s;
  border: 2px solid transparent;
}
.how-card:hover { transform: translateY(-6px); border-color: var(--cyan); }
.icon-circle {
  width: 68px; height: 68px; margin: 0 auto 1.2rem;
  background: var(--grad); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff;
}
.how-card h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.how-card p  { color: var(--text-secondary); font-size: .9rem; margin: 0; line-height: 1.6; }

/* ─── SEO / FEATURES LIST ─── */
.seo-features {
  max-width: 900px; margin: 0 auto 3.5rem; padding: 2.5rem;
  background: linear-gradient(135deg,rgba(0,217,255,.05),rgba(255,0,80,.05));
  border-radius: 14px; border: 1px solid rgba(0,217,255,.12);
}
.seo-features h2 {
  font-size: 1.8rem; margin-bottom: 1.5rem;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.seo-features ul { list-style: none; display: flex; flex-direction: column; gap: .9rem; }
.seo-features li { display: flex; align-items: flex-start; gap: .8rem; font-size: .95rem; line-height: 1.7; }
.seo-features li::before { content: "✓"; color: var(--cyan); font-weight: 700; font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.seo-features strong { color: var(--magenta); }

/* ─── FAQ ─── */
.faq-block {
  max-width: 900px; margin: 0 auto 3.5rem; padding: 0 1.5rem;
}
.faq {
  background: var(--surface); border-radius: 14px;
  padding: 2.5rem; box-shadow: 0 4px 15px rgba(0,0,0,.07);
}
.faq h2 {
  font-size: 1.8rem; margin-bottom: 1.5rem;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.faq p      { line-height: 1.8; margin-bottom: 1.2rem; color: var(--text-primary); }
.faq strong { display: block; margin-bottom: .3rem; font-size: 1rem; }
.hidden     { display: none; }
.hidden.active { display: block; }
.read-more {
  display: inline-block; margin-top: 1rem;
  padding: .65rem 1.4rem; background: var(--grad);
  color: #fff; border-radius: 8px; cursor: pointer;
  font-weight: 600; transition: all .2s;
}
.read-more:hover { opacity: .88; transform: scale(1.04); }

/* ─── FOOTER ─── */
footer {
  background: #0A0A0A; color: #fff; text-align: center;
  padding: 3rem 2rem; font-size: .88rem;
}
footer a { color: var(--cyan); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--magenta); }
footer p { margin-bottom: 0.5rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .hero h1 { font-size: 2rem; }
  .header-nav { gap: .9rem; font-size: .84rem; }
}
@media (max-width: 768px) and (orientation: portrait) {
  .input-wrapper { flex-wrap: wrap; }
  .input-wrapper input { flex: 1; min-width: 160px; }
  .btn-fetch { flex-basis: 100%; justify-content: center; }
  .preview-controls { flex-direction: column; }
  .quality-toggle { align-self: stretch; }
  .quality-toggle button { flex: 1; }
}
@media (max-width: 540px) {
  .meta-stats { display: none; }
  .history-grid { grid-template-columns: repeat(2,1fr); }
}

/* ─── BLOG PAGE OVERRIDES ─── */
.blog-page .hero {
    background: var(--grad);
    padding: 80px 20px;
    min-height: auto;
}

.blog-page .hero h1 { color: #fff !important; }
.blog-page .hero p { color: #fff !important; }
