/* ==========================================================================
   SerpRadar — Custom Styles (loads AFTER Bootstrap to override defaults)
   ========================================================================== */

/* ---------- Base overrides ---------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: #f8f9fb !important;
    color: #1e1e2d !important;
    -webkit-font-smoothing: antialiased;
}

a { color: #635bff; }
a:hover { color: #5147e5; }

/* ---------- Sidebar ---------- */
.sr-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 256px;
    background: #1a1c2e;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow-y: auto;
}

.sr-sidebar .sr-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
}
.sr-sidebar .sr-logo:hover { color: #fff; text-decoration: none; }

.sr-logo-icon {
    width: 32px; height: 32px;
    background: #635bff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sr-domain-pill {
    margin: 0 16px 16px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}
.sr-domain-pill select {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.sr-domain-pill select option { background: #1a1c2e; }

/* Nav links */
.sr-nav { padding: 0 12px; flex: 1; }
.sr-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: rgba(255,255,255,0.50);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
}
.sr-nav a:hover { color: #fff; background: rgba(255,255,255,0.07); text-decoration: none; }
.sr-nav a.active { color: #fff; background: rgba(99,91,255,0.25); text-decoration: none; }
.sr-nav a svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.6; }
.sr-nav a:hover svg, .sr-nav a.active svg { opacity: 1; }
.sr-nav-divider { border-top: 1px solid rgba(255,255,255,0.08); margin: 12px 14px; }
.sr-nav a.sr-nav-secondary { font-size: 14px; color: rgba(255,255,255,0.35); }
.sr-nav a.sr-nav-secondary:hover { color: rgba(255,255,255,0.7); }

/* User footer */
.sr-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sr-user-email { color: rgba(255,255,255,0.8); font-weight: 500; font-size: 14px; }
.sr-user-plan { color: rgba(255,255,255,0.35); font-size: 12px; margin-top: 2px; }
.sr-user .btn-logout {
    background: none; border: none; color: rgba(255,255,255,0.3);
    font-size: 12px; cursor: pointer; padding: 0;
}
.sr-user .btn-logout:hover { color: rgba(255,255,255,0.6); }

/* ---------- Main content ---------- */
.sr-main {
    margin-left: 256px;
    min-height: 100vh;
    padding: 32px 40px;
}
.sr-main-inner { max-width: 1100px; }

/* ---------- Page header ---------- */
.sr-page-title { font-size: 24px; font-weight: 700; margin: 0; color: #1e1e2d; }
.sr-page-sub { font-size: 15px; color: #6b7280; margin: 4px 0 0; }
.sr-back { font-size: 14px; color: #6b7280; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.sr-back:hover { color: #635bff; }

/* ---------- Cards ---------- */
.sr-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sr-card-link { display: block; text-decoration: none; color: inherit; transition: all 0.2s; }
.sr-card-link:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #d1d5db; color: inherit; text-decoration: none; }

.sr-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
}
.sr-card-row {
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sr-card-row:last-child { border-bottom: none; }
.sr-card-empty { padding: 48px 20px; text-align: center; color: #9ca3af; font-size: 15px; }

/* ---------- Stat cards ---------- */
.sr-stat { padding: 20px; }
.sr-stat-label { font-size: 14px; color: #6b7280; font-weight: 500; margin-bottom: 4px; }
.sr-stat-value { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.sr-stat-sub { font-size: 13px; color: #9ca3af; margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn-sr-primary {
    background: #635bff !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 22px;
    border-radius: 8px;
    transition: background 0.15s;
}
.btn-sr-primary:hover { background: #5147e5 !important; color: #fff !important; }

.btn-sr-outline {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #374151 !important;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 22px;
    border-radius: 8px;
    transition: all 0.15s;
}
.btn-sr-outline:hover { background: #f9fafb !important; border-color: #d1d5db !important; }

.btn-sr-sm { padding: 7px 16px; font-size: 14px; }
.btn-sr-ghost {
    background: none; border: none; color: #6b7280; font-size: 14px;
    font-weight: 500; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.btn-sr-ghost:hover { background: #f3f4f6; color: #374151; }
.btn-sr-danger { background: none; border: none; color: #ef4444; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; }
.btn-sr-danger:hover { text-decoration: underline; }

/* ---------- Badges ---------- */
.badge-sr { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px; display: inline-block; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }

/* ---------- Position pills ---------- */
.sr-pos {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 28px; border-radius: 6px;
    font-size: 14px; font-weight: 700;
}
.sr-pos-top3 { background: #dcfce7; color: #166534; }
.sr-pos-top10 { background: #dbeafe; color: #1e40af; }
.sr-pos-low { background: #f1f5f9; color: #64748b; }

/* ---------- SERP role highlights ---------- */
.sr-role-own { background: #f0fdf4; border-left: 4px solid #22c55e; }
.sr-role-direct { background: #fffbeb; border-left: 4px solid #eab308; }
.sr-role-marketplace { background: #f8fafc; border-left: 4px solid #94a3b8; }
.sr-role-ignored { opacity: 0.45; }

/* ---------- Tables ---------- */
.sr-table th {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    white-space: nowrap;
    background: transparent !important;
}
.sr-table td {
    padding: 14px 20px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    vertical-align: middle !important;
    font-size: 15px;
}
.sr-table tbody tr:hover { background: #fafbfd; }

/* ---------- Filters ---------- */
.sr-filters { display: flex; gap: 4px; margin-bottom: 20px; }
.sr-filter {
    padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
    text-decoration: none; color: #6b7280; background: #fff; border: 1px solid #e5e7eb; transition: all 0.15s;
}
.sr-filter:hover { background: #f5f6f8; color: #374151; text-decoration: none; }
.sr-filter.active { background: #635bff; color: #fff; border-color: #635bff; }
.sr-filter.active:hover { background: #5147e5; }

/* ---------- Forms ---------- */
.sr-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.sr-hint { font-weight: 400; color: #9ca3af; }

.form-control, .form-select {
    font-size: 15px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
}
.form-control:focus, .form-select:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 3px rgba(99,91,255,0.12) !important;
}

/* ---------- Legend ---------- */
.sr-legend { display: flex; gap: 16px; font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.sr-legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ==========================================================================
   AUTH PAGES (login, signup, password reset)
   ========================================================================== */
.sr-auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fb;
    padding: 24px;
}
.sr-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sr-auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    color: #1e1e2d;
}
.sr-auth-card .auth-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 28px;
}
.sr-auth-card .sr-form-group { margin-bottom: 16px; }
.sr-auth-card .sr-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}
.sr-auth-card .sr-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.sr-auth-card .sr-alert.danger {
    background: rgba(239,68,68,0.06);
    color: #991b1b;
    border: 1px solid rgba(239,68,68,0.12);
}
.sr-auth-card .sr-alert.success {
    background: rgba(34,197,94,0.06);
    color: #166534;
    border: 1px solid rgba(34,197,94,0.12);
}
.sr-auth-card .sr-alert.info {
    background: rgba(99,91,255,0.06);
    color: #4239b3;
    border: 1px solid rgba(99,91,255,0.12);
}
.sr-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.sr-divider::before,
.sr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.sr-divider span {
    color: #9ca3af;
    font-size: 13px;
}

@media (max-width: 480px) {
    .sr-auth-card { padding: 24px 20px; margin: 16px; }
}
