/* ============================================================
   SEO Audit Tool — Custom styles
   Tailwind handles utilities; this file handles things Tailwind can't:
   custom animations, scrollbar, autofill override, etc.
   ============================================================ */

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Autofill override ──────────────────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset;
    -webkit-text-fill-color: #f1f5f9;
    caret-color: #f1f5f9;
    transition: background-color 5000s ease-in-out;
}

/* ── Auth background gradient ────────────────────────────────── */
.auth-bg {
    background: radial-gradient(ellipse 80% 80% at 50% -20%,
        rgba(99,102,241,0.25) 0%,
        rgba(15,23,42,0) 70%),
        #0f172a;
}

/* ── Auth card glow ─────────────────────────────────────────── */
.auth-card {
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.15),
        0 25px 50px -12px rgba(0,0,0,0.6),
        0 0 80px -20px rgba(99,102,241,0.15);
}

/* ── Gradient text ───────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Button loading spinner ─────────────────────────────────── */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}
.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.animate-slide-down { animation: slideDown 0.3s ease both; }
.animate-slide-up   { animation: slideUp  0.3s ease both; }
.animate-fade-in    { animation: fadeIn   0.4s ease both; }
.animate-scale-in   { animation: scaleIn  0.3s ease both; }

/* ── Toast notifications ────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid;
    min-width: 300px;
    max-width: 420px;
    backdrop-filter: blur(12px);
    animation: slideDown 0.3s ease both;
    cursor: pointer;
}

.toast-success {
    background: rgba(16,185,129,0.15);
    border-color: rgba(16,185,129,0.3);
    color: #6ee7b7;
}
.toast-error {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}
.toast-warning {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.3);
    color: #fcd34d;
}
.toast-info {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
    color: #a5b4fc;
}

.toast.hiding {
    animation: slideUp 0.25s ease forwards;
    opacity: 0;
}

/* ── Form input focus ring ───────────────────────────────────── */
.form-input {
    background: rgba(15,23,42,0.6);
    border: 1px solid #334155;
    border-radius: 10px;
    color: #f1f5f9;
    padding: 12px 14px;
    width: 100%;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.form-input::placeholder { color: #475569; }

/* ── Password toggle ────────────────────────────────────────── */
.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 44px; }
.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
}
.toggle-pw:hover { color: #94a3b8; }

/* ── Score ring ─────────────────────────────────────────────── */
.score-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.sidebar-link:hover  { background: rgba(99,102,241,0.1); color: #c7d2fe; }
.sidebar-link.active { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* ── Table ──────────────────────────────────────────────────── */
.data-table th {
    background: rgba(15,23,42,0.8);
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
    font-size: 14px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(99,102,241,0.04); }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-pass    { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge-fail    { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-info    { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.badge-pending { background: rgba(100,116,139,0.15); color: #94a3b8; }
