/* =========================================================
   CHRONOS & CODE RESEARCH — MODERN UI
========================================================= */

:root {
    /* Chronos & Code brand */

    --ccr-bg: #f7f9fc;
    --ccr-surface: rgba(255, 255, 255, 0.92);
    --ccr-surface-solid: #ffffff;

    /* Main Chronos navy */
    --ccr-text: #101c3a;
    --ccr-text-soft: #475467;
    --ccr-muted: #667085;

    --ccr-border: rgba(16, 28, 58, 0.10);

    /* Chronos & Code blue */
    --ccr-primary: #1976d2;
    --ccr-primary-dark: #125ea8;

    /* Brand orange */
    --ccr-accent: #f28c18;

    --ccr-primary-soft: rgba(25, 118, 210, 0.08);
    --ccr-accent-soft: rgba(242, 140, 24, 0.10);

    --ccr-green: #087a55;
    --ccr-orange: #d97706;

    --ccr-radius-sm: 10px;
    --ccr-radius: 16px;
    --ccr-radius-lg: 24px;

    --ccr-shadow:
        0 18px 55px rgba(16, 28, 58, 0.07);

    --ccr-shadow-soft:
        0 8px 28px rgba(16, 28, 58, 0.045);

    --ccr-max: 1240px;
}

/* =========================================================
   BASE
========================================================= */

.cc-research-repository {
    min-height: 100vh;

    color: var(--ccr-text);

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(37, 99, 235, 0.07),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 20%,
            rgba(124, 58, 237, 0.07),
            transparent 32%
        ),
        var(--ccr-bg);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.65;
}

.cc-research-container {
    width: min(
        var(--ccr-max),
        calc(100% - 40px)
    );

    margin-inline: auto;
}


/* =========================================================
   HERO
========================================================= */

.cc-research-hero {
    position: relative;

    padding:
        clamp(80px, 9vw, 130px)
        0
        55px;

    overflow: hidden;
}

.cc-research-hero::before {
    content: "";

    position: absolute;
    top: -180px;
    right: -120px;

    width: 520px;
    height: 520px;

    background:
        radial-gradient(
            circle,
            rgba(37, 99, 235, 0.15),
            transparent 65%
        );

    pointer-events: none;
}

.cc-research-hero::after {
    content: "";

    position: absolute;
    left: -160px;
    bottom: -200px;

    width: 500px;
    height: 500px;

    background:
        radial-gradient(
            circle,
            rgba(124, 58, 237, 0.12),
            transparent 65%
        );

    pointer-events: none;
}

.cc-research-brand {
    position: relative;
    z-index: 1;

    max-width: 920px;
}

.cc-research-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 18px;
    padding: 7px 12px;

    color: var(--ccr-primary);

    background:
        rgba(255, 255, 255, 0.72);

    border:
        1px solid
        rgba(37, 99, 235, 0.10);

    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    backdrop-filter: blur(12px);
}

.cc-research-brand h1 {
    margin: 0;
    max-width: 1000px;

    font-size: clamp(2.8rem, 6vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    font-weight: 800;

    color: var(--ccr-text);
}

.cc-research-brand p {
    max-width: 760px;

    margin: 26px 0 0;

    color: var(--ccr-text-soft);

    font-size:
        clamp(
            1.05rem,
            1.6vw,
            1.24rem
        );
}


/* =========================================================
   HERO STATS
========================================================= */

.cc-research-stats {
    position: relative;
    z-index: 1;

    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 34px;
}

.cc-research-stats > div {
    min-width: 150px;

    padding: 14px 17px;

    background:
        rgba(255, 255, 255, 0.72);

    border:
        1px solid
        rgba(255, 255, 255, 0.65);

    border-radius: 14px;

    box-shadow:
        0 8px 30px
        rgba(15, 23, 42, 0.04);

    backdrop-filter: blur(14px);
}

.cc-research-stats strong {
    display: block;

    font-size: 1.12rem;
}

.cc-research-stats span {
    display: block;

    margin-top: 2px;

    color: var(--ccr-muted);

    font-size: 0.78rem;
}


/* =========================================================
   SEARCH
========================================================= */

.cc-research-search-wrap {
    position: relative;
    z-index: 2;

    margin-top: 38px;

    max-width: 920px;
}

#cc-research-search {
    width: 100%;
    min-height: 66px;

    padding:
        0
        22px;

    color: var(--ccr-text);

    background:
        rgba(255, 255, 255, 0.88);

    border:
        1px solid
        rgba(148, 163, 184, 0.22);

    border-radius: 18px;

    box-shadow:
        0 14px 40px
        rgba(15, 23, 42, 0.08);

    backdrop-filter: blur(16px);

    font-size: 1rem;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

#cc-research-search::placeholder {
    color: #94a3b8;
}

#cc-research-search:focus {
    border-color:
        rgba(37, 99, 235, 0.45);

    box-shadow:
        0 18px 50px
        rgba(37, 99, 235, 0.12);

    transform: translateY(-1px);
}


/* =========================================================
   BROWSER SECTION
========================================================= */

.cc-research-browser {
    padding:
        25px
        0
        90px;
}

.cc-research-browser-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 25px;

    margin-bottom: 24px;
}

.cc-research-browser-header h2 {
    margin: 0;

    font-size:
        clamp(
            2rem,
            3vw,
            2.8rem
        );

    letter-spacing: -0.035em;
}

.cc-research-browser-header p {
    margin: 6px 0 0;

    color: var(--ccr-muted);
}


/* =========================================================
   SORT
========================================================= */

.cc-sort-wrap {
    display: flex;
    align-items: center;
    gap: 10px;

    padding:
        8px
        10px;

    background:
        rgba(255, 255, 255, 0.75);

    border:
        1px solid
        var(--ccr-border);

    border-radius: 12px;

    backdrop-filter: blur(10px);
}

.cc-sort-wrap label {
    color: var(--ccr-muted);

    font-size: 0.8rem;
}

#cc-research-sort {
    color: var(--ccr-text);

    background: transparent;

    border: 0;

    outline: none;

    font-weight: 700;
}


/* =========================================================
   REPOSITORY LAYOUT
========================================================= */

.cc-research-layout {
    display: grid;

    grid-template-columns:
        230px
        minmax(0, 1fr);

    gap: 32px;

    align-items: start;
}


/* =========================================================
   FILTER SIDEBAR
========================================================= */

.cc-research-sidebar {
    position: sticky;
    top: 100px;

    padding: 20px;

    background:
        rgba(255, 255, 255, 0.70);

    border:
        1px solid
        rgba(148, 163, 184, 0.16);

    border-radius: 18px;

    backdrop-filter: blur(14px);

    box-shadow: var(--ccr-shadow-soft);
}

.cc-filter-section {
    margin-bottom: 24px;
}

.cc-filter-section:last-of-type {
    margin-bottom: 14px;
}

.cc-filter-section h3 {
    margin: 0 0 12px;

    font-size: 0.82rem;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.055em;

    color: var(--ccr-muted);
}

.cc-filter-section label {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 10px 0;

    color: var(--ccr-text-soft);

    font-size: 0.9rem;

    cursor: pointer;
}

.cc-filter-section input[type="checkbox"] {
    width: 17px;
    height: 17px;

    accent-color: var(--ccr-primary);
}

.cc-clear-filters {
    width: 100%;

    min-height: 40px;

    color: var(--ccr-primary);

    background:
        var(--ccr-primary-soft);

    border: 0;

    border-radius: 10px;

    font-weight: 750;

    cursor: pointer;

    transition:
        background .18s ease;
}

.cc-clear-filters:hover {
    background:
        rgba(37, 99, 235, 0.13);
}


/* =========================================================
   RESULTS
========================================================= */

.cc-results-meta {
    margin-bottom: 12px;

    color: var(--ccr-muted);

    font-size: 0.85rem;
}


/* =========================================================
   MODERN RESEARCH CARD
========================================================= */

.cc-research-card {
    position: relative;

    margin-bottom: 18px;

    padding:
        30px
        30px
        27px;

    overflow: hidden;

    background:
        rgba(255, 255, 255, 0.82);

    border:
        1px solid
        rgba(148, 163, 184, 0.16);

    border-radius: 20px;

    backdrop-filter: blur(16px);

    box-shadow:
        0 12px 35px
        rgba(15, 23, 42, 0.05);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease;
}

.cc-research-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    opacity: 0;

    background:
        linear-gradient(
            90deg,
            var(--ccr-primary),
            var(--ccr-primary-2)
        );

    transition:
        opacity .2s ease;
}

.cc-research-card:hover {
    transform:
        translateY(-4px);

    border-color:
        rgba(37, 99, 235, 0.18);

    box-shadow:
        0 24px 60px
        rgba(15, 23, 42, 0.09);
}

.cc-research-card:hover::before {
    opacity: 1;
}


/* =========================================================
   METADATA
========================================================= */

.cc-paper-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    margin-bottom: 14px;

    color: var(--ccr-muted);

    font-size: 0.78rem;
}

.cc-paper-status {
    display: inline-flex;
    align-items: center;

    padding:
        5px
        9px;

    color: var(--ccr-purple);

    background:
        rgba(124, 58, 237, 0.08);

    border:
        1px solid
        rgba(124, 58, 237, 0.10);

    border-radius: 999px;

    font-weight: 800;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}

.cc-research-card[data-status="published"]
.cc-paper-status {
    color: var(--ccr-green);

    background:
        rgba(5, 150, 105, 0.08);

    border-color:
        rgba(5, 150, 105, 0.12);
}

.cc-research-card[data-status="under-review"]
.cc-paper-status {
    color: var(--ccr-orange);

    background:
        rgba(217, 119, 6, 0.08);

    border-color:
        rgba(217, 119, 6, 0.12);
}


/* =========================================================
   TITLE + AUTHORS
========================================================= */

.cc-research-card h3 {
    max-width: 900px;

    margin: 0;

    font-size:
        clamp(
            1.45rem,
            2.2vw,
            2rem
        );

    line-height: 1.25;

    letter-spacing: -0.028em;
}

.cc-research-card h3 a {
    color: var(--ccr-text);

    text-decoration: none;
}

.cc-research-card h3 a:hover {
    color: var(--ccr-primary);
}

.cc-paper-authors {
    margin: 10px 0 0;

    color: var(--ccr-text-soft);

    font-size: 0.93rem;

    font-weight: 650;
}


/* =========================================================
   ABSTRACT
========================================================= */

.cc-paper-abstract {
    max-width: 900px;

    margin: 18px 0 0;

    color: var(--ccr-text-soft);

    font-size: 0.95rem;

    line-height: 1.7;
}


/* =========================================================
   KEYWORDS
========================================================= */

.cc-paper-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 19px;
}

.cc-paper-keywords span {
    padding:
        6px
        10px;

    color: #475569;

    background:
        rgba(248, 250, 252, 0.88);

    border:
        1px solid
        rgba(148, 163, 184, 0.17);

    border-radius: 999px;

    font-size: 0.75rem;

    font-weight: 650;
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.cc-paper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 24px;
}

.cc-paper-actions a,
.cc-paper-actions button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        0
        14px;

    color: var(--ccr-text-soft);

    background:
        rgba(255, 255, 255, 0.9);

    border:
        1px solid
        rgba(148, 163, 184, 0.2);

    border-radius: 10px;

    font-size: 0.82rem;

    font-weight: 750;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.cc-paper-actions a:hover,
.cc-paper-actions button:hover {
    transform: translateY(-1px);

    border-color:
        rgba(37, 99, 235, 0.30);

    color: var(--ccr-primary);
}

.cc-paper-actions
.cc-primary-action {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            var(--ccr-primary),
            var(--ccr-primary-2)
        );

    border-color: transparent;

    box-shadow:
        0 8px 22px
        rgba(37, 99, 235, 0.20);
}

.cc-paper-actions
.cc-primary-action:hover {
    color: #fff;

    transform: translateY(-2px);
}


/* =========================================================
   DOI
========================================================= */

.cc-paper-doi {
    margin-top: 17px;

    padding-top: 15px;

    border-top:
        1px solid
        rgba(148, 163, 184, 0.15);

    color: var(--ccr-muted);

    font-size: 0.78rem;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.cc-empty-state {
    padding:
        50px
        28px;

    text-align: center;

    background:
        rgba(255, 255, 255, 0.75);

    border:
        1px dashed
        rgba(148, 163, 184, 0.32);

    border-radius: 18px;

    backdrop-filter: blur(12px);
}

.cc-empty-state h3 {
    margin: 0;

    font-size: 1.15rem;
}

.cc-empty-state p {
    margin: 7px 0 0;

    color: var(--ccr-muted);
}


/* =========================================================
   REPOSITORY INFO
========================================================= */

.cc-repository-info {
    position: relative;

    padding:
        85px
        0;

    overflow: hidden;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #0f172a,
            #172554 50%,
            #312e81
        );
}

.cc-repository-info::after {
    content: "";

    position: absolute;
    right: -100px;
    top: -130px;

    width: 450px;
    height: 450px;

    background:
        radial-gradient(
            circle,
            rgba(96, 165, 250, 0.18),
            transparent 65%
        );
}

.cc-repository-info
.cc-research-container {
    position: relative;
    z-index: 1;

    display: grid;

    grid-template-columns:
        1fr
        minmax(320px, 520px);

    gap: 70px;
}

.cc-repository-info
.cc-section-label {
    color: #93c5fd;
}

.cc-repository-info h2 {
    margin: 0;

    max-width: 700px;

    font-size:
        clamp(
            2.2rem,
            4vw,
            3.5rem
        );

    line-height: 1.08;

    letter-spacing: -0.035em;
}

.cc-repository-info p {
    margin: 0;

    color: #cbd5e1;

    font-size: 1.02rem;
}


/* =========================================================
   MODAL
========================================================= */

.cc-citation-modal {
    position: fixed;
    inset: 0;

    z-index: 99999;

    display: grid;
    place-items: center;

    padding: 20px;
}

.cc-citation-modal[hidden] {
    display: none;
}

.cc-citation-overlay {
    position: absolute;
    inset: 0;

    background:
        rgba(15, 23, 42, 0.62);

    backdrop-filter: blur(8px);
}

.cc-citation-dialog {
    position: relative;
    z-index: 1;

    width:
        min(
            620px,
            100%
        );

    padding: 32px;

    background:
        rgba(255, 255, 255, 0.96);

    border:
        1px solid
        rgba(255, 255, 255, 0.4);

    border-radius: 20px;

    box-shadow:
        0 30px 90px
        rgba(15, 23, 42, 0.30);

    backdrop-filter: blur(20px);
}

.cc-citation-dialog h2 {
    margin: 0 0 18px;

    font-size: 1.6rem;
}

.cc-citation-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    background:
        #f8fafc;

    border: 0;

    border-radius: 50%;

    font-size: 1.4rem;

    cursor: pointer;
}

.cc-citation-content {
    padding: 18px;

    margin-bottom: 18px;

    background: #f8fafc;

    border:
        1px solid
        #e2e8f0;

    border-radius: 12px;
}

.cc-citation-content p {
    margin: 0;
}

.cc-copy-citation {
    min-height: 42px;

    padding:
        0
        15px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            var(--ccr-primary),
            var(--ccr-primary-2)
        );

    border: 0;

    border-radius: 10px;

    font-weight: 750;

    cursor: pointer;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.cc-research-repository a:focus-visible,
.cc-research-repository button:focus-visible,
.cc-research-repository input:focus-visible,
.cc-research-repository select:focus-visible {
    outline:
        3px solid
        #60a5fa;

    outline-offset: 3px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 950px) {

    .cc-research-layout {
        grid-template-columns: 1fr;
    }

    .cc-research-sidebar {
        position: static;

        display: grid;

        grid-template-columns:
            1fr
            1fr;

        gap: 20px;
    }

    .cc-clear-filters {
        grid-column: 1 / -1;
    }

    .cc-repository-info
    .cc-research-container {
        grid-template-columns: 1fr;

        gap: 30px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 680px) {

    .cc-research-container {
        width:
            min(
                100% - 24px,
                var(--ccr-max)
            );
    }

    .cc-research-hero {
        padding:
            55px
            0
            35px;
    }

    .cc-research-brand h1 {
        font-size: 2.55rem;
    }

    .cc-research-stats {
        display: grid;

        grid-template-columns:
            repeat(2, 1fr);
    }

    .cc-research-stats > div {
        min-width: 0;
    }

    #cc-research-search {
        min-height: 58px;
    }

    .cc-research-browser {
        padding:
            15px
            0
            60px;
    }

    .cc-research-browser-header {
        flex-direction: column;

        align-items: stretch;
    }

    .cc-sort-wrap {
        justify-content: space-between;
    }

    .cc-research-sidebar {
        grid-template-columns: 1fr;
    }

    .cc-research-card {
        padding:
            24px
            20px;
    }

    .cc-paper-actions a,
    .cc-paper-actions button {
        flex: 1 1 auto;
    }

    .cc-repository-info {
        padding:
            60px
            0;
    }
}

/* Fix primary research button */
.cc-paper-actions .cc-primary-action {
    color: #ffffff !important;
    background: #1976d2 !important;
    border-color: #1976d2 !important;
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.16);
}

.cc-paper-actions .cc-primary-action:hover {
    color: #ffffff !important;
    background: #125ea8 !important;
    border-color: #125ea8 !important;
    transform: translateY(-2px);
}

.cc-research-submit-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 18px;
    padding: 11px 18px;

    background: #1976d2;
    color: #ffffff !important;

    border-radius: 8px;

    font-size: .88rem;
    font-weight: 800;

    text-decoration: none;

    box-shadow:
        0 8px 20px
        rgba(25,118,210,.18);
}

.cc-research-submit-cta:hover {
    background: #125ea8;
}

.cc-research-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 50px;
}

.cc-research-brand {
    max-width: 720px;
}

.cc-research-hero-action {
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 7px;

    padding-top: 12px;
}

.cc-research-submit-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 46px;
    padding: 0 18px;

    color: #ffffff !important;
    background: #1976d2;

    border-radius: 8px;

    font-size: .86rem;
    font-weight: 800;

    text-decoration: none;

    box-shadow:
        0 8px 20px
        rgba(25,118,210,.16);

    transition:
        background .15s ease,
        transform .15s ease;
}

.cc-research-submit-cta:hover {
    background: #125ea8;
    transform: translateY(-1px);
}

.cc-research-submit-icon {
    font-size: 1rem;
    line-height: 1;
}

.cc-research-submit-note {
    color: #7a8699;
    font-size: .68rem;
    font-weight: 600;
}

@media (max-width: 800px) {

    .cc-research-hero-top {
        flex-direction: column;
        gap: 25px;
    }

    .cc-research-hero-action {
        align-items: flex-start;
        padding-top: 0;
    }

}

.cc-research-dashboard-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 16px;

    color: #101c3a !important;
    background: #ffffff;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    font-size: .82rem;
    font-weight: 800;

    text-decoration: none;
}

.cc-research-dashboard-cta:hover {
    border-color: #1976d2;
    color: #1976d2 !important;
}

/* ============================================================
   FORCE COMPACT SUPPORTING FILES CARD
============================================================ */

.cc-research-files {
    width: 520px !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;

    padding: 16px 18px !important;
    margin: 0 !important;

    box-sizing: border-box !important;
}

.cc-research-files-header {
    margin-bottom: 12px !important;
}

.cc-research-files-header h2 {
    margin: 3px 0 5px !important;
    font-size: 19px !important;
}

.cc-research-files-header p {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
}

.cc-research-files-list {
    margin-top: 12px !important;
}

.cc-research-file {
    padding: 9px 11px !important;
    min-height: 0 !important;
}

.cc-research-file-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
}

.cc-research-file-info strong {
    font-size: 12px !important;
}

.cc-research-file-info span {
    font-size: 10px !important;
}