/* Ensure universal sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #475569;
  --card: #f8fafc;
  --input: #e2e8f0;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --border: #e5e7eb;
  --ok: #16a34a;
  --warn: #eab308;
  --error: #dc2626;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --fg: #e5e7eb;
    --muted: #94a3b8;
    --card: #0f172a;
    --input: #1f2937;
    --accent: #3b82f6;
    --accent-contrast: #0b1220;
    --border: #1f2937;
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #475569;
  --card: #f8fafc;
  --input: #e2e8f0;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --border: #e5e7eb;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --card: #0f172a;
  --input: #1f2937;
  --accent: #3b82f6;
  --accent-contrast: #0b1220;
  --border: #1f2937;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.container { max-width: 820px; margin: 0 auto; padding: 24px; }

header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 24px;
}

.brand { display: flex; align-items: baseline; gap: 12px; }
.brand h1 { font-size: 22px; margin: 0; letter-spacing: -0.2px; }
.tagline { color: var(--muted); font-size: 14px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  padding: 0; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--fg);
}
.theme-toggle:hover { background: var(--card); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
}
.h2 { margin: 0 0 8px 0; font-size: 18px; }
.notice { font-size: 13px; color: var(--muted); margin: 6px 0 2px 0; }

form { display: grid; grid-template-columns: 1fr; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }

input[type="url"], select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--input);
  background: transparent; color: var(--fg); border-radius: 10px; font-size: 15px;
}

.terms-check-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.terms-check-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.terms-check-wrap label {
  font-size: 14px;
  color: var(--muted);
}
.terms-check-wrap a {
  color: var(--accent);
  text-decoration: none;
}
.terms-check-wrap a:hover {
  text-decoration: underline;
}

button.primary {
  background: var(--accent); color: var(--accent-contrast);
  border: none; border-radius: 10px; padding: 12px 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s ease;
}
button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status { margin-top: 6px; font-size: 14px; min-height: 22px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.error { color: var(--error); }

/* Video Info Display Section */
.video-info-card {
  display: none; /* Controlled by JS */
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
}
@media (max-width: 600px) {
  .video-info-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
.video-info-card .thumbnail-wrap {
  flex-shrink: 0;
}
.video-info-card .thumbnail-wrap img {
  width: 160px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  background-color: var(--input);
}
.video-info-card .details-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
@media (max-width: 600px) {
  .video-info-card .details-wrap {
    align-items: center;
  }
}
.video-info-card .details-wrap h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.video-info-card .details-wrap p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.video-info-card .details-wrap button {
  margin-top: 10px;
  padding: 10px 16px;
  font-size: 14px;
}

/* Progress Bar (Now inside details-wrap) */
.progress-wrap {
  height: 8px;
  background: var(--input);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
  width: 100%; 
}
.progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width 0.3s ease;
}

.support-section {
    margin-top: 24px;
}
.support-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}
.support-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}
.support-card p {
    font-size: 14px;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 20px;
}
.support-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.support-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.support-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}
.support-button.coffee {
    background-color: #ffdd00;
    color: #0f172a;
}
.support-button.coffee:hover {
    background-color: #ffec4c;
}


footer {
  margin: 24px 0 12px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  color: var(--muted); font-size: 13px;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { text-decoration: underline; }

