/* Samida Download — UI Styles */
:root {
    --primary: #002460;
    --primary-light: #003a85;
    --accent: #0C9CA6;
    --bg: #F4F7FB;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #64748B;
    --success: #10B981;
    --error: #EF4444;
    --shadow-sm: 0 1px 2px rgba(0,36,96,0.06);
    --shadow: 0 4px 14px rgba(0,36,96,0.08);
    --shadow-lg: 0 12px 32px rgba(0,36,96,0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; }
body { position: relative; overflow-x: hidden; }
.bg-gradient { position: fixed; inset: 0; background: linear-gradient(135deg, #002460 0%, #003875 35%, #0C9CA6 100%); z-index: -2; }
.bg-pattern { position: fixed; inset: 0; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 30%), radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05) 0%, transparent 30%); z-index: -1; pointer-events: none; }
.container { max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; }
.header { margin-bottom: 28px; text-align: center; }
.brand { display: flex; align-items: center; justify-content: center; gap: 14px; }
.brand-logo { flex-shrink: 0; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2)); }
.brand-text h1 { font-size: 26px; font-weight: 700; color: white; letter-spacing: -0.02em; }
.brand-text p { font-size: 14px; color: rgba(255,255,255,0.75); margin-top: 2px; }
.card-main { background: var(--surface); border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow-lg); margin-bottom: 28px; }
.form-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.label-icon { font-size: 18px; }
.input-group { display: flex; gap: 8px; margin-bottom: 8px; }
.url-input { flex: 1; padding: 14px 18px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; color: var(--text); background: var(--surface-alt); transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1); font-family: inherit; }
.url-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(12,156,166,0.12); }
.url-input::placeholder { color: #94A3B8; }
.btn-fetch { padding: 14px 24px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; border: none; border-radius: var(--radius); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 200ms; display: flex; align-items: center; gap: 8px; min-width: 120px; justify-content: center; font-family: inherit; }
.btn-fetch:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,36,96,0.25); }
.btn-fetch:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-loader { display: flex; align-items: center; }
.error-msg { margin-top: 8px; padding: 10px 14px; background: #FEF2F2; color: var(--error); border-left: 3px solid var(--error); border-radius: var(--radius-sm); font-size: 14px; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.example-label { font-size: 13px; color: var(--text-muted); }
.example-chip { padding: 6px 14px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 100px; font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all 200ms; font-family: inherit; }
.example-chip:hover { background: var(--accent); color: white; border-color: var(--accent); transform: translateY(-1px); }
.result-section { margin-top: 28px; }
.result-section[hidden] { display: none; }
.video-card { display: flex; gap: 16px; padding: 16px; background: var(--surface-alt); border-radius: var(--radius); margin-bottom: 24px; }
.video-thumb { flex-shrink: 0; width: 160px; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; position: relative; background: var(--border); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duration-badge { position: absolute; bottom: 6px; right: 6px; padding: 2px 6px; background: rgba(0,0,0,0.8); color: white; font-size: 11px; font-weight: 600; border-radius: 4px; }
.video-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.video-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-site { background: var(--primary); color: white; }
.format-section { margin-bottom: 12px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.section-title-sm { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; text-align: center; }
.format-tabs { display: flex; gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: var(--radius); margin-bottom: 14px; }
.tab-btn { flex: 1; padding: 10px; background: transparent; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 200ms; display: flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; }
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.format-list { display: none; flex-direction: column; gap: 8px; }
.format-list.active { display: flex; }
.format-item { padding: 14px 16px; background: var(--surface-alt); border: 2px solid transparent; border-radius: var(--radius); cursor: pointer; transition: all 200ms; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.format-item:hover { background: var(--surface); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.format-info { flex: 1; min-width: 0; }
.format-quality { font-weight: 600; font-size: 14px; color: var(--text); }
.format-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.format-size { font-size: 13px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.format-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; background: var(--surface-alt); border-radius: var(--radius); }
.progress-section { margin-top: 24px; }
.progress-section[hidden] { display: none; }
.progress-card { padding: 20px; background: var(--surface-alt); border-radius: var(--radius); }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.progress-header h3 { font-size: 15px; font-weight: 600; }
.btn-cancel { padding: 6px 12px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all 200ms; font-family: inherit; }
.btn-cancel:hover { background: var(--error); color: white; border-color: var(--error); }
.progress-bar { height: 8px; background: var(--border); border-radius: 100px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); border-radius: 100px; width: 0%; transition: width 300ms ease; }
.progress-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.progress-log { padding: 10px 12px; background: var(--surface); border-radius: var(--radius-sm); font-family: "SF Mono", "Monaco", monospace; font-size: 11px; color: var(--text-muted); max-height: 120px; overflow-y: auto; border: 1px solid var(--border); }
.progress-log-line { padding: 2px 0; }
.done-section { margin-top: 24px; }
.done-section[hidden] { display: none; }
.done-card { text-align: center; padding: 32px 20px; background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(12,156,166,0.06)); border-radius: var(--radius); border: 1px solid rgba(16,185,129,0.2); }
.done-icon { font-size: 48px; margin-bottom: 12px; }
.done-card h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.done-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.btn-download-final { padding: 12px 24px; background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%); color: white; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 200ms; }
.btn-download-final:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,185,129,0.3); }
.btn-new { padding: 12px 24px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; transition: all 200ms; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; }
.btn-new:hover { border-color: var(--accent); color: var(--accent); }
.done-expire { font-size: 12px; color: #94A3B8; margin-top: 8px; }
.sites-section { margin-top: 32px; padding: 24px 20px; background: rgba(255,255,255,0.1); backdrop-filter: blur(8px); border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,0.15); }
.sites-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.site-item { padding: 10px 14px; background: rgba(255,255,255,0.12); border-radius: var(--radius-sm); text-align: center; color: white; font-size: 13px; font-weight: 500; transition: all 200ms; }
.site-item:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }
.footer { margin-top: 32px; text-align: center; color: rgba(255,255,255,0.7); font-size: 13px; }
.footer p + p { margin-top: 4px; font-size: 12px; }
.footer a { color: white; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-note { opacity: 0.7; }
@media (max-width: 540px) {
    .container { padding: 24px 16px 40px; }
    .card-main { padding: 24px 18px; }
    .brand-text h1 { font-size: 22px; }
    .input-group { flex-direction: column; }
    .btn-fetch { width: 100%; }
    .video-card { flex-direction: column; }
    .video-thumb { width: 100%; }
    .sites-grid { grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); }
}
