/* --- ROOT VARIABLES --- */
:root {
    --bg-main: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Severity Colors */
    --severity-high: #ef4444;
    --severity-high-bg: #fef2f2;
    --severity-medium: #f59e0b;
    --severity-medium-bg: #fffbeb;
    --severity-low: #10b981;
    --severity-low-bg: #ecfdf5;
}

/* --- GLOBAL RESETS --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* --- SITE HEADER --- */
.site-header {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.site-logo {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.02em;
}
.site-logo span { color: #f59e0b; }
.header-search { display: flex; max-width: 450px; width: 100%; }
.header-search input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 8px 14px;
    border-radius: 6px 0 0 6px;
    color: #ffffff;
    font-size: 0.9rem;
}
.header-search input:focus { outline: 2px solid #f59e0b; }
.header-search button {
    background: #f59e0b;
    color: #000000;
    border: none;
    padding: 0 16px;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    cursor: pointer;
}

/* --- SITE FOOTER --- */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 20px 20px 20px;
    border-top: 4px solid #1e293b;
    margin-top: auto; /* Pushes footer down */
    flex-shrink: 0;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h5 { color: #ffffff; margin: 0 0 15px 0; font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li a { color: #94a3b8; text-decoration: none; font-size: 0.9rem; }
.footer-col ul li a:hover { color: #ffffff; }
.footer-bottom { font-size: 0.8rem; }
.footer-bottom .disclosure { background: #1e293b; padding: 12px 15px; border-radius: 6px; border-left: 3px solid #f59e0b; color: #cbd5e1; }

/* --- OBD CONTENT LAYOUT --- */
.obd-container {
    max-width: 1100px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.obd-header {
    background: #0f172a;
    color: #ffffff;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--border-color);
}
.obd-code-title { margin: 0; font-size: 2.5rem; font-weight: 800; letter-spacing: -0.05em; }
.obd-make-badge { background: rgba(255, 255, 255, 0.15); padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; }

.obd-body { padding: 30px; }
.obd-definition { font-size: 1.4rem; font-weight: 700; margin-top: 0; margin-bottom: 15px; color: #0f172a; }

/* --- SEVERITY BADGES --- */
.badge-severity {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 25px;
}
.badge-severity.high { color: var(--severity-high); background-color: var(--severity-high-bg); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-severity.medium { color: var(--severity-medium); background-color: var(--severity-medium-bg); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-severity.low { color: var(--severity-low); background-color: var(--severity-low-bg); border: 1px solid rgba(16, 185, 129, 0.2); }

/* --- SECTIONS & LISTS --- */
.obd-summary-box { background: #f1f5f9; border-left: 4px solid #475569; padding: 20px; border-radius: 0 8px 8px 0; margin-bottom: 30px; }
.obd-section-title { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(--border-color); padding-bottom: 8px; }
.obd-list, .obd-steps { margin: 0 0 25px 0; padding-left: 20px; }
.obd-list li, .obd-steps li { margin-bottom: 8px; color: var(--text-primary); }

/* --- CTA SECTION --- */
.obd-cta-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-top: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.obd-button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.obd-affiliate-box {
    margin-top: 35px;
    padding: 22px;
    border-radius: 10px;

    background: linear-gradient(135deg, #0f172a, #111c33);
    border: 1px solid #1e293b;

    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

.obd-affiliate-box p {
    margin: 0 0 15px 0;
    font-weight: 700;
    color: #e2e8f0;
}

/* container */
.affiliate-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* base "URL pill" */
.affiliate-link {
    display: inline-block;
    padding: 10px 16px;

    border-radius: 999px;

    background: #0b1220;
    border: 1px solid #334155;

    color: #93c5fd;
    text-decoration: none;

    font-weight: 600;
    font-size: 0.95rem;

    transition: all 0.2s ease;
    position: relative;
}

/* fake URL prefix feel */
.affiliate-link::before {
    color: #64748b;
    margin-right: 2px;
    font-weight: 400;
}

/* domain emphasis */
.affiliate-link.amazon {
    color: #fbbf24;
	text-transform:uppercase;
	font-weight:800;
	font-size:1.5rem;
}

.affiliate-link.ebay {
    color: #60a5fa;
	text-transform:uppercase;
	font-weight:800;
	font-size:1.5rem;
}

/* hover = feels clickable, not buttony */
.affiliate-link:hover {
    transform: translateY(-2px);
    border-color: #475569;
    background: #0f172a;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .header-search { max-width: 100%; }
    .obd-cta-box { flex-direction: column; align-items: flex-start; }
}

/* --- HOMEPAGE SPECIFIC --- */
.home-container { max-width: 1100px; margin: 0 auto; padding: 20px; }

.home-hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
}
.hero-title { font-size: 2.5rem; margin-bottom: 10px; }
.hero-subtext { font-size: 1.2rem; color: #cbd5e1; margin-bottom: 30px; }

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
}
.hero-search input {
    flex: 1;
    padding: 15px;
    border-radius: 6px 0 0 6px;
    border: none;
    font-size: 1rem;
}
.hero-search button {
    padding: 0 25px;
    background: #f59e0b;
    border: none;
    border-radius: 0 6px 6px 0;
    font-weight: 700;
    cursor: pointer;
}

/* Grid Layout for Categories */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.home-card {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}
.home-card:hover { transform: translateY(-5px); border-color: #f59e0b; }
.home-card h3 { margin-top: 0; color: #0f172a; }

.home-list { list-style: none; padding: 0; }
.home-list li { margin-bottom: 10px; font-weight: 600; }
.home-list a { color: var(--text-primary); text-decoration: none; }
.home-list a:hover { color: #f59e0b; }

.middlen {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
}

.live-search-form {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
	color: #000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;

    box-shadow: 0 4px 12px rgba(0,0,0,.1);

    max-height: 400px;
    overflow-y: auto;

    z-index: 9999;

    display: none;
}