/* ============================================================
   PeptideWatchdog Design System
   ============================================================ */

/* ---- Variables ---- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #161d2e;
    --bg-card-hover: #1c2540;
    --bg-elevated: #1e2a3f;
    --border: #1e2d44;
    --border-light: #2a3a54;
    --text-primary: #e8edf5;
    --text-secondary: #8a95a8;
    --text-muted: #5a6578;
    --accent: #00d4aa;
    --accent-dim: #00d4aa22;
    --accent-glow: #00d4aa44;
    --accent-secondary: #00a3ff;
    --platinum: #c0f0ff;
    --gold: #ffd666;
    --silver: #b8c4d0;
    --bronze: #d4956a;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --star: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #33e0be; }
img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---- Navbar ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,14,23,.85);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
}
.navbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.navbar-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.15rem; color: var(--text-primary); letter-spacing: -.02em;
}
.navbar-logo .logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--bg-primary); font-weight: 800;
}
.navbar-logo span.accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    color: var(--text-secondary); font-size: .875rem; font-weight: 500;
    padding: 8px 14px; border-radius: var(--radius-sm); transition: all .2s; white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-links a.active { color: var(--accent); }
.nav-links a.nav-cta {
    background: var(--accent); color: var(--bg-primary); font-weight: 600; padding: 8px 18px;
}
.nav-links a.nav-cta:hover { background: #33e0be; }
.nav-links .dropdown { position: relative; }
.nav-links .dropdown > a::after { content: ' \25BE'; font-size: .7em; }
.nav-links .dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px; min-width: 180px; box-shadow: 0 12px 40px rgba(0,0,0,.4); width: max-content;
}
.nav-links .dropdown:hover .dropdown-menu { display: block; }
.nav-links .dropdown-menu a {
    display: block; padding: 8px 14px; font-size: .82rem; border-radius: 6px;
    color: var(--text-secondary); white-space: nowrap;
}
.mobile-menu-btn {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.4rem; cursor: pointer;
}
.mobile-nav {
    display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary); z-index: 99; padding: 24px; border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
    display: block; padding: 14px 16px; color: var(--text-secondary);
    font-size: 1rem; font-weight: 500; border-radius: var(--radius-sm);
}
.mobile-nav a.nav-cta {
    background: var(--accent); color: var(--bg-primary); font-weight: 600;
    text-align: center; margin-top: 12px;
}

/* ---- Footer ---- */
.footer { padding: 64px 0 32px; border-top: 1px solid var(--border); }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 48px;
}
.footer-brand p { font-size: .82rem; color: var(--text-muted); margin-top: 16px; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
    font-size: .78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-secondary); margin-bottom: 4px;
}
.footer-col a { font-size: .82rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
    padding-top: 32px; border-top: 1px solid var(--border);
}
.footer-disclaimer { font-size: .72rem; color: var(--text-muted); line-height: 1.7; max-width: 800px; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: .78rem; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius);
    font-family: var(--font-body); font-size: .95rem; font-weight: 600;
    cursor: pointer; border: none; transition: all .25s; text-decoration: none;
}
.btn-primary {
    background: var(--accent); color: var(--bg-primary);
    box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover { background: #33e0be; transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(30,45,68,.6); transform: translateY(-1px); }
.btn-sm { padding: 8px 18px; font-size: .82rem; }
.btn-full { width: 100%; }

/* ---- Section Labels ---- */
.section-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .14em; color: var(--accent); margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
}
.section-label::before { content: ''; width: 20px; height: 1px; background: var(--accent); }

/* ---- Page Headers ---- */
.page-header { padding: 130px 0 40px; position: relative; overflow: hidden; }
.page-header::before {
    content: ''; position: absolute; top: -200px; right: -300px;
    width: 800px; height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
    pointer-events: none;
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 {
    font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 400; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 12px;
}
.page-header h1 em { font-style: italic; color: var(--accent); }
.page-header p { font-size: .95rem; color: var(--text-secondary); max-width: 560px; line-height: 1.65; }
.page-header .updated { font-size: .82rem; color: var(--text-muted); }

/* ---- Cards ---- */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; transition: all .25s;
}
.card:hover { border-color: var(--border-light); transform: translateY(-2px); }

/* ---- Grade Badges ---- */
.grade-badge {
    display: inline-flex; padding: 3px 10px; border-radius: 100px;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.grade-platinum { background: rgba(192,240,255,.1); color: var(--platinum); border: 1px solid rgba(192,240,255,.2); }
.grade-gold { background: rgba(255,214,102,.1); color: var(--gold); border: 1px solid rgba(255,214,102,.2); }
.grade-silver { background: rgba(184,196,208,.1); color: var(--silver); border: 1px solid rgba(184,196,208,.2); }
.grade-bronze { background: rgba(212,149,106,.1); color: var(--bronze); border: 1px solid rgba(212,149,106,.2); }
.grade-ungraded { background: rgba(90,101,120,.1); color: var(--text-muted); border: 1px solid rgba(90,101,120,.2); }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
    width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    color: var(--text-primary); font-family: var(--font-body); font-size: .9rem;
    outline: none; transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 140px; resize: vertical; }
.form-select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6578'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { color: var(--danger); font-size: .78rem; margin-top: 4px; }

/* ---- Alert/Flash Messages ---- */
.alert {
    padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 20px;
    font-size: .88rem; border: 1px solid;
}
.alert-success { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.2); color: var(--success); }
.alert-error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.2); color: var(--danger); }
.alert-warning { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.2); color: var(--warning); }

/* ---- Status Badges ---- */
.status-badge {
    display: inline-flex; padding: 3px 8px; border-radius: 4px;
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.status-pass { background: rgba(52,211,153,.12); color: var(--success); }
.status-warn { background: rgba(251,191,36,.12); color: var(--warning); }
.status-fail { background: rgba(248,113,113,.12); color: var(--danger); }

/* ---- Callout ---- */
.callout {
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 20px 24px; margin-bottom: 24px;
}
.callout p { margin: 0; font-size: .88rem; color: var(--text-secondary); line-height: 1.65; }

/* ---- Star Ratings ---- */
.stars { display: flex; gap: 2px; }
.stars .star { color: var(--border-light); font-size: 1rem; }
.stars .star.filled { color: var(--star); }
.star-input { display: flex; gap: 4px; }
.star-input span { font-size: 1.3rem; cursor: pointer; color: var(--border-light); transition: color .15s; user-select: none; }
.star-input span:hover, .star-input span.active { color: var(--star); }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 12px 20px; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); background: var(--bg-elevated);
}
.data-table td {
    padding: 16px 20px; font-size: .88rem; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: rgba(30,45,68,.3); }

/* ---- Prose (for blog/legal) ---- */
.prose h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; margin: 40px 0 16px; }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: 28px 0 10px; }
.prose p { font-size: .92rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }
.prose strong { color: var(--text-primary); }
.prose blockquote {
    border-left: 3px solid var(--accent); padding: 16px 24px; margin: 24px 0;
    background: var(--bg-card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose blockquote p { margin: 0; color: var(--text-primary); font-style: italic; }
.prose ul, .prose ol { margin: 12px 0 16px 20px; }
.prose li { font-size: .88rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 6px; }

/* ---- Legal Pages ---- */
.legal-content { max-width: 740px; padding: 40px 0 80px; }
.legal-content h2 { font-size: 1.15rem; font-weight: 700; margin: 36px 0 12px; color: var(--text-primary); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { font-size: .88rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 14px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .nav-links a { padding: 8px 10px; font-size: .82rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 2rem; }
}
