/* ================================
   SEO247 · Main Stylesheet
   Mobile-first, dark theme, minimal
   ================================ */

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

:root {
    --bg-primary:   #0a0e1a;
    --bg-secondary: #131826;
    --bg-card:      #1a2033;
    --bg-hover:     #232940;
    --border:       #2a3149;
    --text-primary: #e8eaf0;
    --text-muted:   #8b92a8;
    --text-dim:     #5a6178;
    --accent:       #6366f1;
    --accent-hover: #818cf8;
    --success:      #10b981;
    --warning:      #f59e0b;
    --danger:       #ef4444;
    --radius:       10px;
    --radius-sm:    6px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.3);
    --shadow:       0 4px 12px rgba(0,0,0,0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { line-height: 1.25; margin-bottom: 0.5em; }
h1 { font-size: 1.875em; font-weight: 700; }
h2 { font-size: 1.5em; font-weight: 600; }
h3 { font-size: 1.25em; font-weight: 600; }
p { margin-bottom: 1em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1em; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 1em; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 1em; }

/* ============ NAV ============ */
.nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.8em 0;
    position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.nav-brand { font-size: 1.25em; font-weight: 700; color: var(--text-primary); }
.nav-brand .accent { color: var(--accent); }
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.95em; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

@media (max-width: 640px) {
    .nav-links { gap: 0.8em; font-size: 0.85em; }
    .nav-links a { font-size: 0.85em; }
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 0.7em 1.4em;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95em;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 0.45em 0.9em; font-size: 0.85em; }
.btn-lg { padding: 0.9em 1.8em; font-size: 1.05em; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1.2em; }
.form-label { display: block; margin-bottom: 0.4em; font-size: 0.9em; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.7em 0.9em;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 0.8em; color: var(--text-dim); margin-top: 0.3em; }
.form-error { color: var(--danger); font-size: 0.85em; margin-top: 0.3em; }

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5em;
    margin-bottom: 1em;
}
.card-header { font-weight: 600; margin-bottom: 1em; padding-bottom: 0.7em; border-bottom: 1px solid var(--border); }

/* ============ FLASH MESSAGES ============ */
.flash {
    padding: 0.9em 1.2em;
    border-radius: var(--radius-sm);
    margin-bottom: 1em;
    font-size: 0.95em;
    border-left: 4px solid;
}
.flash-success { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border-color: var(--success); }
.flash-error   { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: var(--danger); }
.flash-warning { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border-color: var(--warning); }
.flash-info    { background: rgba(99, 102, 241, 0.12); color: #a5b4fc; border-color: var(--accent); }

/* ============ TABLES ============ */
.table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.table th, .table td { padding: 0.7em 1em; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-weight: 500; text-transform: uppercase; font-size: 0.75em; letter-spacing: 0.05em; }
.table tr:hover { background: var(--bg-hover); }

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-danger  { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-info    { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-trial   { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }

/* ============ LANDING ============ */
.hero { text-align: center; padding: 5em 1em 4em; }
.hero h1 { font-size: 2.5em; margin-bottom: 0.5em; background: linear-gradient(135deg, var(--text-primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.15em; color: var(--text-muted); max-width: 600px; margin: 0 auto 2em; }
.hero-cta { display: flex; gap: 1em; justify-content: center; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5em; padding: 3em 0; }
.feature { padding: 1.5em; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.feature-icon { font-size: 2em; margin-bottom: 0.5em; }
.feature h3 { margin-bottom: 0.5em; }
.feature p { color: var(--text-muted); font-size: 0.95em; }

/* ============ DASHBOARD ============ */
.dashboard-shell { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5em 0;
    flex-shrink: 0;
}
.sidebar-link {
    display: block;
    padding: 0.7em 1.5em;
    color: var(--text-muted);
    font-size: 0.95em;
    border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--bg-hover); color: var(--text-primary); border-left-color: var(--accent); }

.dashboard-content { flex: 1; padding: 2em; min-width: 0; }

@media (max-width: 768px) {
    .dashboard-shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 0.5em 0; display: flex; overflow-x: auto; }
    .sidebar-link { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar-link.active { border-left: none; border-bottom-color: var(--accent); }
    .dashboard-content { padding: 1em; }
}

/* ============ STATS GRID ============ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1em; margin-bottom: 2em; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2em; }
.stat-label { font-size: 0.8em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.8em; font-weight: 700; margin-top: 0.3em; color: var(--text-primary); }

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-sm     { font-size: 0.85em; }
.text-lg     { font-size: 1.15em; }
.mt-1 { margin-top: 0.5em; }
.mt-2 { margin-top: 1em; }
.mt-3 { margin-top: 1.5em; }
.mt-4 { margin-top: 2em; }
.mb-1 { margin-bottom: 0.5em; }
.mb-2 { margin-bottom: 1em; }
.mb-3 { margin-bottom: 1.5em; }
.mb-4 { margin-bottom: 2em; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5em; }
.gap-2 { gap: 1em; }
