/* Facebook Video Downloader Online - Core Styles */
:root {
  --primary: #1877f2;
  --primary-dark: #0d65d9;
  --primary-light: #e7f0ff;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --text: #1c1e21;
  --text-muted: #65676b;
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #dadde1;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--primary); color: #fff; padding: .5rem 1rem;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: .6rem;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 40px; height: 40px; background: var(--primary);
  color: #fff; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 1.1rem;
}
.logo-text { font-size: .85rem; line-height: 1.2; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; flex-direction: column;
  justify-content: center; gap: 5px; padding: 8px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text); border-radius: 1px;
  transition: transform .2s;
}
.main-nav ul { display: flex; gap: .25rem; }
.main-nav a {
  display: block; padding: .5rem .9rem; border-radius: 8px;
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--primary-light); color: var(--primary); text-decoration: none;
}

/* Hero / Tool section */
.hero {
  background: linear-gradient(180deg, #e7f0ff 0%, var(--bg) 100%);
  padding: 2.5rem 0 1.5rem;
}
.hero-content { text-align: center; max-width: 720px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800; color: var(--text); margin-bottom: .75rem;
  letter-spacing: -0.02em;
}
.hero .lead {
  color: var(--text-muted); font-size: 1.05rem; margin-bottom: 1.75rem;
}

/* Downloader card */
.downloader-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.75rem;
  border: 1px solid var(--border); max-width: 680px; margin: 0 auto;
}
.input-group {
  display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.input-wrapper {
  flex: 1; min-width: 200px; position: relative; display: flex;
}
.input-wrapper input {
  width: 100%; padding: .85rem 2.5rem .85rem 1rem;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 1rem; transition: border-color .2s;
  background: #fafbfc;
}
.input-wrapper input:focus {
  outline: none; border-color: var(--primary);
  background: #fff; box-shadow: 0 0 0 3px rgba(24,119,242,.15);
}
.btn-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 1.2rem; padding: 4px; line-height: 1; display: none;
}
.btn-clear.visible { display: block; }
.btn-clear:hover { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .85rem 1.4rem; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
  background: #a0c4f8; cursor: not-allowed; transform: none;
}
.btn-secondary {
  background: var(--primary-light); color: var(--primary);
}
.btn-secondary:hover { background: #d0e3ff; }
.btn-download {
  background: var(--success); color: #fff; width: 100%;
}
.btn-download:hover { background: #218838; }

/* Status / Results */
.status-area {
  min-height: 24px; margin-top: .75rem; text-align: center;
  font-size: .95rem;
}
.status-area.error { color: var(--danger); }
.status-area.success { color: var(--success); }
.status-area.loading {
  color: var(--primary); display: flex; align-items: center;
  justify-content: center; gap: .5rem;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-card {
  display: none; margin-top: 1.25rem; padding: 1.25rem;
  background: #f8f9fa; border-radius: 10px; border: 1px solid var(--border);
  text-align: left;
}
.result-card.visible { display: block; }
.result-meta {
  display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem;
  align-items: center;
}
.result-thumb {
  width: 120px; height: 80px; object-fit: cover; border-radius: 8px;
  background: #ddd;
}
.result-info { flex: 1; min-width: 160px; }
.result-info h3 { font-size: 1rem; margin-bottom: .25rem; word-break: break-all; }
.result-info p { font-size: .9rem; color: var(--text-muted); }

/* How-to tabs */
.section { padding: 2.5rem 0; }
.section-title {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem;
  text-align: center;
}
.tabs {
  display: flex; justify-content: center; gap: .5rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.tab-btn {
  padding: .6rem 1.2rem; border: 2px solid var(--border);
  background: var(--card); border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .95rem; color: var(--text-muted);
  transition: all .2s;
}
.tab-btn:hover, .tab-btn.active {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary);
}
.tab-panel {
  display: none; background: var(--card); border-radius: var(--radius);
  padding: 1.5rem; border: 1px solid var(--border); max-width: 800px;
  margin: 0 auto; box-shadow: var(--shadow);
}
.tab-panel.active { display: block; }
.tab-panel ol { list-style: decimal; padding-left: 1.25rem; }
.tab-panel li { margin-bottom: .75rem; }
.tab-panel h3 { margin-bottom: .75rem; font-size: 1.15rem; }

/* Content sections */
.content-block {
  background: var(--card); border-radius: var(--radius);
  padding: 1.75rem; margin-bottom: 1.5rem;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.content-block h2 {
  font-size: 1.35rem; margin-bottom: 1rem; color: var(--text);
  padding-bottom: .5rem; border-bottom: 2px solid var(--primary-light);
}
.content-block h3 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.content-block p { margin-bottom: .9rem; color: #333; }
.content-block ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; }
.content-block li { margin-bottom: .4rem; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border); padding: 1rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 {
  font-size: 1.05rem; margin-bottom: .4rem; color: var(--primary-dark);
}
.faq-item p { color: var(--text-muted); font-size: .95rem; }

/* Benefits grid */
.benefits-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem; margin-top: 1rem;
}
.benefit-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
  box-shadow: var(--shadow);
}
.benefit-card .icon {
  width: 48px; height: 48px; margin: 0 auto .75rem;
  background: var(--primary-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--primary);
}
.benefit-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.benefit-card p { font-size: .9rem; color: var(--text-muted); }

/* Footer */
.site-footer {
  background: #1c1e21; color: #b0b3b8; padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.footer-col h3, .footer-col h4 {
  color: #fff; margin-bottom: .75rem; font-size: 1rem;
}
.footer-col p { font-size: .9rem; line-height: 1.5; }
.footer-col a { color: #b0b3b8; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-col ul li { margin-bottom: .35rem; }
.footer-bottom {
  border-top: 1px solid #3a3b3c; padding-top: 1.25rem;
  font-size: .8rem; text-align: center; line-height: 1.5;
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1.5rem; }
.notice {
  background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px;
  padding: 1rem; font-size: .95rem; margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 1rem; box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { padding: .75rem 1rem; }
  .input-group { flex-direction: column; }
  .btn { width: 100%; }
  .hero { padding: 1.75rem 0 1rem; }
  .downloader-card { padding: 1.25rem; }
}
