/* ============================================
   SEO Panel — Premium Dark UI
   kubahku.com & kubahmasjidmurah.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
    --bg:           #0d1117;
    --bg-2:         #161b22;
    --bg-3:         #1c2230;
    --border:       rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.13);
    --text:         #e2e8f0;
    --text-muted:   #64748b;
    --text-dim:     #94a3b8;
    --accent:       #10b981;
    --accent-glow:  rgba(16,185,129,0.15);
    --accent-2:     #6366f1;
    --danger:       #ef4444;
    --warning:      #f59e0b;
    --info:         #3b82f6;
    --sidebar-w:    260px;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 4px 24px rgba(0,0,0,0.3);
    --transition:   0.2s ease;
    --font:         'Inter', -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; transition: margin var(--transition); }

/* ── Sidebar ── */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 28px; }
.brand-name { display: block; font-weight: 700; font-size: 1rem; color: var(--text); }
.brand-sub  { display: block; font-size: 0.72rem; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 12px 12px; overflow-y: auto; }
.nav-section-label { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 8px 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--accent); border-radius: 0 4px 4px 0;
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto;
    font-size: 0.6rem; font-weight: 700;
    background: var(--bg-3); color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 1px 7px; border-radius: 20px;
}
.nav-logout { color: var(--danger); margin-top: 4px; }
.nav-logout:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-dim); }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-glow); border: 1px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: var(--accent);
}

/* ── Topbar ── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 16px;
    padding: 0 28px;
    height: 60px;
    background: rgba(13,17,23,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.sidebar-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.sidebar-toggle span { display: block; width: 22px; height: 2px; background: var(--text-dim); border-radius: 2px; transition: var(--transition); }
.topbar-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.topbar-right { margin-left: auto; }
.topbar-time { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── Page Content ── */
.page-content { padding: 28px; flex: 1; max-width: 1400px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-desc  { color: var(--text-muted); font-size: 0.875rem; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Cards ── */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.card-desc { padding: 12px 20px; color: var(--text-muted); font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }
.card-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-bottom: 24px; }

/* Site Cards */
.site-card { border-top: 3px solid var(--site-color, var(--accent)); }
.site-info { display: flex; align-items: flex-start; gap: 12px; }
.site-icon { font-size: 1.4rem; }
.site-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.site-url  { font-size: 0.75rem; color: var(--text-muted); display: block; }

.card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { background: var(--bg-2); padding: 16px; text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-value.stat-sm { font-size: 0.8rem; font-weight: 500; }
.stat-value small { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.card-actions { display: flex; gap: 8px; padding: 14px 20px; flex-wrap: wrap; background: rgba(0,0,0,0.1); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap; text-decoration: none;
    font-family: var(--font);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #0ea572; box-shadow: 0 0 16px var(--accent-glow); }
.btn-secondary{ background: var(--bg-3); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--border-hover); }
.btn-ghost    { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.btn-sm  { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg  { padding: 12px 24px; font-size: 0.95rem; }
.btn-full{ width: 100%; justify-content: center; }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    white-space: nowrap;
}
.badge-green  { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.badge-red    { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.badge-yellow { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.badge-blue   { background: rgba(59,130,246,0.12); color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }
.badge-gray   { background: rgba(100,116,139,0.12);color: #64748b; border: 1px solid rgba(100,116,139,0.2); }
.status-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 20px; }

/* ── Tables ── */
.table-section  { overflow: hidden; }
.table-wrapper  { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.data-table th { background: var(--bg-3); color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 16px; text-align: left; white-space: nowrap; }
.data-table td { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.td-num  { width: 50px; color: var(--text-muted); }
.td-url a { color: var(--text-dim); font-size: 0.8rem; display: block; max-width: 450px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-url a:hover { color: var(--accent); }
.td-date { white-space: nowrap; font-size: 0.78rem; }

.table-toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--bg-2); }
.table-search { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 7px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-family: var(--font); width: 240px; }
.table-search:focus { outline: none; border-color: var(--accent); }
.type-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500;
    background: var(--bg-3); color: var(--text-muted);
    border: 1px solid var(--border); cursor: pointer;
    transition: all var(--transition); font-family: var(--font);
}
.filter-btn.active, .filter-btn:hover { background: var(--accent-glow); color: var(--accent); border-color: rgba(16,185,129,0.3); }

/* Type badges */
.type-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
.type-post      { background: rgba(99,102,241,0.15); color: #818cf8; }
.type-page      { background: rgba(59,130,246,0.15); color: #60a5fa; }
.type-portfolio { background: rgba(245,158,11,0.15); color: #fbbf24; }
.type-category  { background: rgba(16,185,129,0.15); color: #34d399; }
.type-tag       { background: rgba(236,72,153,0.15); color: #f472b6; }
.type-service   { background: rgba(168,85,247,0.15); color: #c084fc; }
.type-homepage  { background: rgba(239,68,68,0.15);  color: #f87171; }
.type-product   { background: rgba(234,179,8,0.15);  color: #facc15; }
.priority-badge { font-size: 0.78rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* ── Sitemap Actions ── */
.sitemap-actions { display: flex; gap: 8px; padding: 14px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group-full { grid-column: 1 / -1; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); }
.form-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-input {
    background: var(--bg-3); border: 1px solid var(--border);
    color: var(--text); padding: 9px 14px;
    border-radius: var(--radius-sm); font-size: 0.875rem;
    font-family: var(--font); transition: border-color var(--transition);
    width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.82rem; }
.form-input::placeholder { color: var(--text-muted); }
.form-footer { padding: 20px; border-top: 1px solid var(--border); background: var(--bg-3); }
.input-wrapper { position: relative; }
.input-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1rem; opacity: 0.6;
}
.copy-group { display: flex; gap: 8px; }
.copy-group .form-input { flex: 1; }

/* ── Alerts ── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 14px 16px; border-radius: var(--radius-sm);
    font-size: 0.875rem; border: 1px solid transparent;
}
.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.2);  color: #f87171; }
.alert-info    { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.2); color: #60a5fa; }
.alert strong { color: inherit; }
.alert p { margin-top: 4px; opacity: 0.8; font-size: 0.82rem; }

/* ── Test Result ── */
.test-result { padding: 10px 20px; font-size: 0.83rem; border-top: 1px solid var(--border); }
.test-loading { color: var(--text-muted); }
.test-ok  { color: #34d399; background: rgba(16,185,129,0.05); }
.test-err { color: #f87171; background: rgba(239,68,68,0.05); }

/* ── Quick Guide ── */
.quick-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--border); }
.guide-step { background: var(--bg-2); padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.step-num {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent-glow); color: var(--accent);
    border: 1px solid rgba(16,185,129,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.guide-step strong { display: block; font-size: 0.875rem; color: var(--text); margin-bottom: 4px; }
.guide-step p { font-size: 0.8rem; color: var(--text-muted); }

/* ── GSC ── */
.gsc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gsc-stat  { background: var(--bg-2); padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.gsc-stat-icon { font-size: 1.5rem; }
.gsc-stat-value { display: block; font-size: 1.4rem; font-weight: 700; color: var(--text); }
.gsc-stat-label { font-size: 0.72rem; color: var(--text-muted); }
.table-overlay { position: relative; }
.gsc-table { filter: blur(4px); pointer-events: none; user-select: none; }
.table-section { position: relative; }
.overlay-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; z-index: 10; padding: 40px;
    background: rgba(13,17,23,0.85); backdrop-filter: blur(2px);
}
.overlay-icon { font-size: 3rem; margin-bottom: 12px; }
.overlay-content h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.overlay-content p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; max-width: 320px; }
.placeholder-row td { padding: 14px 16px; }
.placeholder-bar { height: 12px; background: var(--bg-3); border-radius: 4px; display: inline-block; }
.w-80 { width: 80%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-25 { width: 25%; }

/* ── Cron Section ── */
.cron-info { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.cron-url-box { display: flex; flex-direction: column; gap: 8px; }
.cron-presets  { display: flex; flex-direction: column; gap: 10px; }
.preset-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.preset-item   { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.preset-label  { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.preset-item code { font-size: 0.82rem; color: var(--accent); font-family: 'SF Mono', monospace; }
.cron-result { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-top: 16px; }
.cron-result-ok  { background: rgba(16,185,129,0.08); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.cron-result-err { background: rgba(239,68,68,0.08);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* ── Login ── */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, rgba(16,185,129,0.08) 0%, transparent 60%), var(--bg); }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: var(--shadow); }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-icon  { font-size: 3rem; margin-bottom: 12px; }
.login-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-sub   { color: var(--text-muted); font-size: 0.875rem; }
.login-sites { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; margin-top: 4px; }
.login-form  { display: flex; flex-direction: column; gap: 18px; }
.login-note  { text-align: center; font-size: 0.73rem; color: var(--text-muted); margin-top: 20px; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; font-size: 0.875rem; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    min-width: 280px; max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
    border: 1px solid transparent;
}
.toast-success { background: var(--bg-2); border-color: rgba(16,185,129,0.3); color: #34d399; }
.toast-error   { background: var(--bg-2); border-color: rgba(239,68,68,0.3);  color: #f87171; }
.toast-warning { background: var(--bg-2); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.toast-info    { background: var(--bg-2); border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.toast-close   { margin-left: auto; cursor: pointer; opacity: 0.5; font-size: 1rem; line-height: 1; background: none; border: none; color: inherit; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Utilities ── */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .cards-grid { grid-template-columns: 1fr; }
    .card-stats { grid-template-columns: repeat(3, 1fr); }
    .gsc-stats { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .table-search { width: 100%; }
}
@media (max-width: 480px) {
    .card-stats { grid-template-columns: 1fr 1fr; }
    .gsc-stats { grid-template-columns: 1fr 1fr; }
    .quick-guide { grid-template-columns: 1fr; }
}
