/*
Theme Name: All Social Video Downloader
Theme URI: https://example.com/all-social-video-downloader
Author: Codex
Author URI: https://example.com
Description: A clean landing interface for preparing public social video download requests.
Version: 1.0.9
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: all-social-video-downloader
*/

:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #64717f;
  --panel: #ffffff;
  --line: #d9e1e8;
  --soft: #edf4f2;
  --accent: #0d7f74;
  --accent-strong: #095c58;
  --gold: #d99c2b;
  --danger: #b64237;
  --shadow: 0 18px 50px rgba(22, 35, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 127, 116, 0.13), rgba(217, 156, 43, 0.12)),
    #f6f8f7;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 18px;
}

.topbar,
.download-panel,
.preview-pane,
.options-pane,
.history-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark,
.play-badge {
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--accent);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex: 0 0 auto;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-badge svg {
  fill: currentColor;
  stroke: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.35rem, 1.9vw, 2rem);
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
  line-height: 1.4;
}

p,
label,
select,
input,
button {
  font-size: 0.95rem;
}

.brand p,
.video-meta p,
.notice,
.empty {
  color: var(--muted);
}

.status-pill,
#platformBadge,
.history-title span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-strong);
  background: var(--soft);
  white-space: nowrap;
  font-weight: 600;
}

.status-pill[data-mode="error"] {
  color: #8a2a22;
  background: #fff0ee;
  border-color: rgba(182, 66, 55, 0.3);
}

.download-panel {
  padding: 18px;
}

.url-form {
  display: grid;
  gap: 10px;
}

.url-form label,
.field {
  color: #304050;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  gap: 10px;
  align-items: center;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 127, 116, 0.14);
}

.icon-button,
.primary-action,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  min-height: 44px;
}

.icon-button {
  width: 44px;
  color: var(--muted);
  background: #f8faf9;
  border-color: var(--line);
}

.icon-button:hover {
  color: var(--ink);
  background: #fff;
}

.primary-action,
.download-button {
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.primary-action:hover,
.download-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.download-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.platform-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.platform-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.platform-strip span.active {
  color: var(--accent-strong);
  border-color: rgba(13, 127, 116, 0.35);
  background: rgba(13, 127, 116, 0.09);
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
}

.preview-pane,
.options-pane,
.history-panel {
  padding: 16px;
}

.video-preview {
  position: relative;
  min-height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(23, 33, 43, 0.82), rgba(9, 92, 88, 0.42)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1200&q=80");
  background-size: cover;
  background-position: center;
}

.video-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
}

.play-badge {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.video-meta,
.option-header,
.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.video-meta div {
  min-width: 0;
}

.notice {
  margin-top: 14px;
  border-left: 3px solid var(--gold);
  background: #fff9e9;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.8;
}

.options-pane {
  display: grid;
  align-content: start;
  gap: 16px;
}

.option-header {
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf9;
}

.segmented button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  color: #fff;
  background: var(--accent);
}

.field {
  display: grid;
  gap: 8px;
}

.toggle {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: #304050;
  line-height: 1.7;
}

.toggle input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.download-button {
  width: 100%;
}

.download-help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.history-panel {
  box-shadow: none;
}

.history-title {
  margin-top: 0;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.history-item strong,
.history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  direction: ltr;
  text-align: left;
  color: var(--muted);
  font-size: 0.86rem;
}

.history-item small {
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

.empty {
  padding: 16px 0;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 16px 0;
  }

  .topbar,
  .brand,
  .video-meta {
    align-items: flex-start;
  }

  .topbar,
  .video-meta,
  .history-title {
    flex-direction: column;
  }

  .input-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .input-row input {
    grid-column: 1 / -1;
  }

  .primary-action {
    width: 100%;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .video-preview {
    min-height: 230px;
  }
}
