/* =========================================================
   CVEWORKS - LINUX CVE LOOKUP
   Clone visual do Windows KB Lookup
========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f7f7f8;
    color: #202124;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* HEADER */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e7;
}

.header-content {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #c90000;
    color: #ffffff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-name {
    color: #202124;
}

.logo-name span {
    color: #c90000;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navigation a {
    color: #5f6368;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.navigation a:hover {
    color: #c90000;
}

/* BANNERS */

.affiliate-banner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    overflow: hidden;
}

.affiliate-banner a {
    display: block;
    width: min(1136px, calc(100% - 40px));
}

.affiliate-banner img {
    display: block;
    width: 100%;
    max-width: 1136px;
    height: auto;
    margin: 0 auto;
}

.affiliate-banner-bottom {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* HERO */

.page-hero {
    padding: 55px 0 70px;
}

.page-heading {
    width: 100%;
    margin-bottom: 35px;
    text-align: center;
}

.section-label {
    display: inline-block;
    margin-bottom: 18px;
    padding: 9px 16px;
    color: #c90000;
    background: #ffffff;
    border: 1px solid #f3bcbc;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.page-heading h1 {
    margin-bottom: 12px;
    color: #202124;
    font-size: clamp(38px, 5vw, 56px);
    line-height: 1.08;
    letter-spacing: -1.8px;
}

.page-heading h1 span {
    color: #d71920;
}

.page-heading p {
    max-width: 820px;
    margin: 0 auto;
    color: #5f6368;
    font-size: 17px;
    line-height: 1.7;
}

/* LOOKUP */

.lookup-panel {
    position: relative;
    overflow: hidden;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #efcaca;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.045);
}

.lookup-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.lookup-kicker,
.results-label,
.result-type {
    display: block;
    margin-bottom: 4px;
    color: #c90000;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lookup-panel h2,
.results-heading h2 {
    color: #202124;
    font-size: 24px;
    line-height: 1.2;
}

.mode-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-badge {
    padding: 7px 11px;
    color: #55595d;
    background: #f7f7f8;
    border: 1px solid #efcaca;
    border-radius: 999px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
}

.lookup-form label {
    display: block;
    margin-bottom: 8px;
    color: #3c4043;
    font-size: 13px;
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-row input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    color: #202124;
    background: #ffffff;
    border: 1px solid #cfd1d4;
    border-radius: 8px;
    outline: none;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-row input:focus {
    border-color: #c90000;
    box-shadow: 0 0 0 3px rgba(201, 0, 0, 0.08);
}

.search-row input:disabled {
    background: #f2f2f3;
}

.search-button {
    min-width: 142px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    color: #ffffff;
    background: #d71920;
    border: 1px solid #d71920;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 5px 16px rgba(215, 25, 32, 0.18);
    transition: background 0.2s ease, transform 0.15s ease;
}

.search-button:hover:not(:disabled) {
    background: #bd151b;
}

.search-button:active:not(:disabled) {
    transform: translateY(1px);
}

.search-button:disabled {
    opacity: 0.72;
    cursor: wait;
}

.search-button span {
    font-size: 18px;
}

.spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lookup-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 10px;
    color: #7b7f84;
    font-size: 12px;
}

.lookup-help code {
    color: #c90000;
    font-family: Consolas, Monaco, monospace;
    font-weight: 700;
}

.examples-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 19px;
    padding-top: 18px;
    border-top: 1px solid #eeeeef;
}

.examples-label {
    margin-right: 2px;
    color: #808489;
    font-size: 12px;
    font-weight: 700;
}

.example-button {
    min-height: 32px;
    padding: 5px 10px;
    color: #55595d;
    background: #ffffff;
    border: 1px solid #d8dadd;
    border-radius: 6px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.example-button:hover {
    color: #c90000;
    background: #fffafa;
    border-color: #c90000;
}

/* RESULTS */

.results-section {
    margin-top: 24px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #efcaca;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

.results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.results-heading p {
    margin-top: 5px;
    color: #7b7f84;
    font-size: 13px;
}

.results-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.clear-button,
.export-button {
    min-height: 36px;
    padding: 0 13px;
    color: #3c4043;
    background: #ffffff;
    border: 1px solid #cfd1d4;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.clear-button:hover:not(:disabled),
.export-button:hover:not(:disabled) {
    color: #c90000;
    background: #fffafa;
    border-color: #c90000;
}

.clear-button:disabled,
.export-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.status-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.55;
}

.status-idle {
    color: #686c70;
    background: #f7f7f8;
    border-color: #e3e4e6;
}

.status-loading {
    color: #6b5300;
    background: #fff9e7;
    border-color: #f0df9a;
}

.status-success {
    color: #25613a;
    background: #f1faf4;
    border-color: #bfdfc8;
}

.status-error {
    color: #9d1b21;
    background: #fff2f2;
    border-color: #efb9bb;
}

.results-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.result-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    background: #f8f8f9;
    border: 1px solid #efcaca;
    border-radius: 9px;
}

.result-summary-card h3 {
    margin-bottom: 4px;
    color: #202124;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 22px;
}

.result-summary-card p {
    color: #777b80;
    font-size: 13px;
}

.vendor-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    color: #ffffff;
    background: #d71920;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s ease, transform 0.15s ease;
}

.vendor-button:hover {
    background: #bd151b;
}

.source-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #efcaca;
    border-radius: 9px;
}

.source-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #d71920;
}

.source-error::before {
    background: #9a9da1;
}

.source-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.source-card h3 {
    color: #202124;
    font-size: 20px;
}

.source-badges {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
}

.status-badge,
.severity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    color: #c90000;
    background: #fffafa;
    border: 1px solid #efcaca;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.35px;
}

.severity-badge {
    color: #55595d;
    background: #f7f7f8;
    border-color: #dedfe1;
}

.source-description {
    margin-top: 14px;
    color: #6f7377;
    font-size: 12px;
    line-height: 1.65;
}

.affected-list {
    display: grid;
    gap: 7px;
    margin-top: 15px;
}

.affected-row {
    padding: 9px 10px;
    background: #fafafa;
    border: 1px solid #ececee;
    border-radius: 6px;
}

.affected-product {
    display: block;
    color: #4f5357;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
}

.affected-build {
    display: block;
    margin-top: 3px;
    color: #7b7f84;
    font-size: 10px;
}

.affected-build strong {
    color: #3c4043;
}

.affected-empty {
    margin-top: 15px;
    padding: 10px;
    color: #777b80;
    background: #fafafa;
    border: 1px solid #ececee;
    border-radius: 6px;
    font-size: 10px;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eeeeef;
}

.primary-link {
    color: #c90000;
    font-size: 11px;
    font-weight: 800;
}

.primary-link:hover {
    text-decoration: underline;
}

.source-note {
    color: #8a8e92;
    font-size: 10px;
}

/* HELP */

.quick-help {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.help-card {
    position: relative;
    overflow: hidden;
    min-height: 145px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #efcaca;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.025);
}

.help-card h2 {
    margin-bottom: 11px;
    color: #202124;
    font-size: 15px;
    font-weight: 800;
}

.help-card p {
    color: #777b80;
    font-size: 13px;
    line-height: 1.65;
}

/* FOOTER */

.site-footer {
    background: #ffffff;
    border-top: 1px solid #e4e4e6;
}

.footer-bottom {
    border-top: 1px solid #eeeeef;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    color: #92969a;
    font-size: 11px;
}

.footer-bottom-inner a {
    color: #c90000;
}

.footer-bottom-inner a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .quick-help {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .results-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .lookup-panel-top,
    .result-summary-card,
    .results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .search-button {
        width: 100%;
    }

    .results-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .export-button,
    .clear-button {
        flex: 1 1 auto;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .header-content {
        height: 64px;
    }

    .navigation {
        gap: 16px;
    }

    .page-hero {
        padding: 42px 0 52px;
    }

    .page-heading h1 {
        font-size: 38px;
    }

    .affiliate-banner a {
        width: min(100% - 28px, 1136px);
    }

    .lookup-panel,
    .results-section {
        padding: 22px;
    }

    .footer-bottom-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .navigation a {
        font-size: 12px;
    }

    .logo-name {
        font-size: 18px;
    }

    .logo-mark {
        width: 36px;
        height: 36px;
    }

    .quick-help {
        grid-template-columns: 1fr;
    }

    .source-card-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .source-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .page-heading h1 {
        font-size: 34px;
    }

    .page-heading p {
        font-size: 15px;
    }

    .lookup-panel,
    .results-section {
        padding: 18px;
    }

    .lookup-panel h2,
    .results-heading h2 {
        font-size: 21px;
    }

    .mode-badges {
        width: 100%;
    }
}


/* =========================================================
   LATEST LINUX CVES
========================================================= */

.latest-section {
    margin-top: 24px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #efcaca;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

.latest-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.latest-heading h2 {
    color: #202124;
    font-size: 24px;
    line-height: 1.2;
}

.latest-heading p {
    margin-top: 5px;
    color: #7b7f84;
    font-size: 13px;
}

.latest-view-all {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    color: #c90000;
    background: #fffafa;
    border: 1px solid #efcaca;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    transition: background .2s ease, border-color .2s ease;
}

.latest-view-all:hover {
    background: #fff4f4;
    border-color: #d71920;
}

.distro-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.distro-tab {
    min-height: 34px;
    padding: 0 13px;
    color: #55595d;
    background: #ffffff;
    border: 1px solid #d8dadd;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.distro-tab:hover,
.distro-tab.active {
    color: #ffffff;
    background: #d71920;
    border-color: #d71920;
}

.latest-status {
    margin-bottom: 14px;
    color: #777b80;
    font-size: 11px;
}

.latest-status-success {
    color: #4f6a57;
}

.latest-status-error {
    color: #9d1b21;
}

.latest-cve-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.latest-cve-card {
    min-width: 0;
    min-height: 105px;
    padding: 14px;
    text-align: left;
    background: #fbfbfc;
    border: 1px solid #efcaca;
    border-radius: 8px;
    transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}

.latest-cve-card:hover {
    transform: translateY(-3px);
    border-color: #d71920;
    box-shadow: 0 7px 18px rgba(0,0,0,.05);
}

.latest-cve-source {
    display: block;
    margin-bottom: 5px;
    color: #8a8e92;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.latest-cve-card strong {
    display: block;
    color: #c90000;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
}

.latest-cve-meta {
    display: block;
    margin-top: 5px;
    min-height: 17px;
    color: #74787c;
    font-size: 9px;
}

.latest-cve-search {
    display: block;
    margin-top: 8px;
    color: #3c4043;
    font-size: 9px;
    font-weight: 800;
}

.latest-loading,
.latest-empty {
    grid-column: 1 / -1;
    padding: 20px;
    color: #777b80;
    background: #f8f8f9;
    border: 1px dashed #d8dadd;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
}


/* =========================================================
   HACKERDNA AFFILIATE
========================================================= */

.affiliate-section {
    padding: 60px 0;
    background: #ffffff;
    border-top: 1px solid #e8e8ea;
    border-bottom: 1px solid #e8e8ea;
}

.affiliate-box {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
    padding: 34px;
    background: #f7f7f8;
    border: 1px solid #efcaca;
    border-radius: 12px;
}

.affiliate-content {
    position: relative;
    z-index: 1;
}

.affiliate-box .section-label {
    margin-bottom: 12px;
}

.affiliate-box h2 {
    margin-bottom: 8px;
    color: #202124;
    font-size: 29px;
    line-height: 1.25;
}

.affiliate-box p {
    max-width: 720px;
    color: #6c7074;
    font-size: 14px;
    line-height: 1.7;
}

.affiliate-button {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 8px;
    background: #d71920;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 5px 16px rgba(215, 25, 32, .18);
    transition: background .2s ease, transform .2s ease;
}

.affiliate-button:hover {
    background: #bd151b;
    transform: translateY(-1px);
}

.affiliate-button span {
    font-size: 18px;
}

.affiliate-disclosure {
    margin-top: 13px !important;
    color: #999999 !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
}

@media (max-width: 1100px) {
    .latest-cve-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .latest-heading {
        flex-direction: column;
    }

    .latest-cve-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .latest-section {
        padding: 22px;
    }

    .affiliate-section {
        padding: 52px 0;
    }

    .affiliate-box {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
        padding: 27px;
    }

    .affiliate-box h2 {
        font-size: 25px;
    }

    .affiliate-button {
        width: 100%;
    }
}
