/* Main styles — WebTools */

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

:root {
    --bg: #ffffff; --bg-gray: #f7f8fa; --bg-card: #ffffff;
    --text: #1a1a2e; --text-muted: #6b7280;
    --accent: #2563eb; --accent-dark: #1d4ed8;
    --success: #059669; --error: #dc2626;
    --border: #e5e7eb; --shadow: rgba(0,0,0,0.06);
    --radius: 12px; --radius-sm: 8px;
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 960px; --transition: 0.2s ease;
}

body { font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg-gray); min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.header__logo { font-size: 20px; font-weight: 700; color: var(--accent); text-decoration: none; }
.header__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.header__nav::-webkit-scrollbar { display: none; }
.nav__link { padding: 6px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: var(--transition); }
.nav__link:hover { color: var(--accent); background: var(--bg-gray); }
.nav__link--active { color: var(--accent); background: #eff6ff; }
.header__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.header__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* Main */
.main { flex: 1; padding: 32px 0; }

/* Service Card */
.service-card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: 32px; max-width: 640px; margin: 0 auto; }
.service-card__title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.service-card__desc { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }

/* URL Input */
.url-input-group { display: flex; gap: 8px; margin-bottom: 20px; }
.url-input { flex: 1; padding: 14px 18px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; font-family: var(--font); outline: none; transition: var(--transition); }
.url-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.url-input::placeholder { color: #9ca3af; }

/* Buttons */
.btn { padding: 14px 28px; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); }
.btn--primary { background: var(--accent); color: white; }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--primary:disabled { background: #93c5fd; cursor: not-allowed; transform: none; }
.btn--success { background: var(--success); color: white; }
.btn--success:hover { background: #047857; }
.btn--outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn--outline:hover { background: var(--accent); color: white; }
.btn--full { width: 100%; justify-content: center; }

/* Quality Selector */
.quality-selector { display: flex; gap: 8px; margin-bottom: 20px; }
.quality-option { flex: 1; padding: 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); text-align: center; cursor: pointer; font-size: 14px; font-weight: 500; transition: var(--transition); background: var(--bg); }
.quality-option:hover { border-color: var(--accent); }
.quality-option.active { border-color: var(--accent); background: #eff6ff; color: var(--accent); }

/* Video Preview */
.video-preview { display: none; gap: 16px; padding: 16px; background: var(--bg-gray); border-radius: var(--radius-sm); margin-bottom: 20px; align-items: center; }
.video-preview.visible { display: flex; }
.video-preview__thumb { width: 120px; height: 68px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.video-preview__info { flex: 1; min-width: 0; }
.video-preview__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-preview__meta { font-size: 13px; color: var(--text-muted); }

/* Loading */
.loading-spinner { display: none; text-align: center; padding: 20px; color: var(--text-muted); }
.loading-spinner.visible { display: block; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Messages */
.message { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; display: none; }
.message.visible { display: block; }
.message--error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.message--success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }

/* Download Result */
.download-result { display: none; text-align: center; padding: 24px; background: #ecfdf5; border-radius: var(--radius-sm); border: 1px solid #a7f3d0; }
.download-result.visible { display: block; }

/* Interstitial */
.interstitial { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.interstitial__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.interstitial__content { position: relative; background: var(--bg); border-radius: var(--radius); padding: 32px 24px; max-width: 420px; width: 100%; text-align: center; overflow: hidden; }
.interstitial__text { font-size: 16px; margin-bottom: 16px; color: var(--text-muted); }
.interstitial__timer { font-size: 48px; font-weight: 700; color: var(--accent); margin-bottom: 24px; }
.interstitial__ad { min-height: 80px; margin-bottom: 20px; background: var(--bg-gray); border-radius: var(--radius-sm); }
.interstitial__btn { display: block; width: 100%; padding: 14px 16px; background: var(--success); color: white; text-decoration: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; box-sizing: border-box; }
.interstitial__btn:hover { background: #047857; }

/* Privacy Block */
.privacy-block { padding: 24px 0; background: var(--bg); border-top: 1px solid var(--border); }
.privacy-block__inner { display: flex; align-items: center; gap: 16px; padding: 20px 24px; background: #f0f9ff; border-radius: var(--radius); border: 1px solid #bae6fd; }
.privacy-block__icon { font-size: 28px; flex-shrink: 0; }
.privacy-block__text { flex: 1; }
.privacy-block__title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.privacy-block__desc { font-size: 13px; color: var(--text-muted); }
.privacy-block__link { padding: 10px 20px; background: var(--accent); color: white; text-decoration: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* Cross Links */
.cross-links { padding: 32px 0; background: var(--bg-gray); }
.cross-links__title { font-size: 18px; font-weight: 600; margin-bottom: 16px; text-align: center; }
.cross-links__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cross-link { padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: 13px; font-weight: 500; text-align: center; transition: var(--transition); }
.cross-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Footer */
.footer { padding: 24px 0; background: var(--bg); border-top: 1px solid var(--border); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; }
.footer__copy { font-size: 13px; color: var(--text-muted); }
.footer__nav { display: flex; gap: 16px; }
.footer__link { font-size: 13px; color: var(--text-muted); text-decoration: none; }

/* Ad blocks */
.ad-block { padding: 8px 0; text-align: center; }

/* SEO content */
.seo-content { max-width: 640px; margin: 40px auto 0; }
.seo-content h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.seo-content p { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 768px) {
    .header__nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); }
    .header__nav.open { display: flex; }
    .header__burger { display: flex; }
    .service-card { padding: 24px 16px; }
    .service-card__title { font-size: 22px; }
    .url-input-group { flex-direction: column; }
    .privacy-block__inner { flex-direction: column; text-align: center; }
    .footer__inner { flex-direction: column; gap: 12px; text-align: center; }
    .video-preview { flex-direction: column; }
    .video-preview__thumb { width: 100%; height: 160px; }
}
