/* =========================================================
   PUBLICATIONS PAGE
========================================================= */


/* =========================================================
   ROOT VARIABLES
========================================================= */

.publications-page {

    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --accent-light: #ecfeff;

    --ink: #0a0a0a;
    --ink-soft: #4b5563;
    --ink-faint: #6b7280;

    --line: #e5e7eb;
    --bg: #f4f6f7;
    --white: #ffffff;

    /* SCI */

    --green: #059669;
    --green-bg: #ecfdf5;
    --green-border: #a7f3d0;

    /* SCOPUS */

    --blue: #2563eb;
    --blue-bg: #eff6ff;
    --blue-border: #bfdbfe;

    /* IEEE */

    --purple: #7c3aed;
    --purple-bg: #f5f3ff;
    --purple-border: #ddd6fe;

    /* INTERNATIONAL */

    --orange: #ea580c;
    --orange-bg: #fff7ed;
    --orange-border: #fed7aa;

    /* CHAIR */

    --star: #b45309;
    --star-bg: #fffbeb;
    --star-border: #fde68a;

    width: 100%;

    background: var(--bg);

    color: var(--ink);
}


/* =========================================================
   PUBLICATIONS FONT
========================================================= */

.publications-page,
.publications-page *,
.publications-page *::before,
.publications-page *::after {

    font-family:
        'Roboto',
        Arial,
        Helvetica,
        sans-serif;
}


/* =========================================================
   PAGE LOADER
========================================================= */

#pageLoader {

    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background: #ffffff;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 14px;

    z-index: 999999;

    opacity: 1;

    visibility: visible;

    transition:
        opacity .45s ease,
        visibility .45s ease;
}


#pageLoader.hide {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* =========================================================
   LOADER SPINNER
========================================================= */

.loader-spinner {

    width: 46px;
    height: 46px;

    border: 4px solid #e5e7eb;

    border-top-color: #06b6d4;
    border-right-color: #06b6d4;

    border-radius: 50%;

    animation:
        publications-loader-spin .8s linear infinite;
}


@keyframes publications-loader-spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   LOADER TEXT
========================================================= */

.loader-text {

    color: #4b5563;

    font-size: 14px;

    font-weight: 600;

    letter-spacing: .02em;
}


.loader-text::after {

    content: "";

    display: inline-block;

    width: 18px;

    text-align: left;

    animation:
        publications-loading-dots 1.2s infinite;
}


@keyframes publications-loading-dots {

    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75% {
        content: "...";
    }

    100% {
        content: "";
    }

}


/* =========================================================
   MAIN WRAPPER
========================================================= */

.pub-wrap {

    width: 100%;

    max-width: 1400px;

    margin: 0 auto;

    padding: 32px 20px 80px;
}


/* =========================================================
   HEADER
========================================================= */

.pub-header {

    display: flex;

    flex-wrap: wrap;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;
}


.pub-title h1 {

    font-size: 44px;

    line-height: 1.05;

    margin: 0 0 8px;

    font-weight: 800;

    letter-spacing: -.02em;
}


.pub-title p {

    margin: 0;

    color: var(--ink-soft);

    font-size: 15px;

    line-height: 1.5;

    max-width: 520px;
}


/* =========================================================
   STATISTICS
========================================================= */

.stat-row {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;
}


.stat-card {

    background: var(--white);

    border: 1px solid var(--line);

    border-radius: 14px;

    padding: 14px 18px;

    min-width: 140px;

    transition:
        border-color .18s ease,
        transform .18s ease;
}


.stat-card:hover {

    border-color: var(--accent);

    transform: translateY(-2px);
}


.stat-card .num {

    font-size: 22px;

    font-weight: 800;

    line-height: 1;
}


.stat-card .lbl {

    font-size: 14px;

    color: var(--ink-soft);

    margin-top: 4px;

    line-height: 1.3;
}


.stat-card.c1 .num {
    color: var(--accent-dark);
}

.stat-card.c2 .num {
    color: var(--green);
}

.stat-card.c3 .num {
    color: var(--blue);
}

.stat-card.c4 .num {
    color: var(--orange);
}


/* =========================================================
   MAIN LAYOUT
========================================================= */

.pub-body {

    display: grid;

    grid-template-columns: 280px 1fr;

    gap: 24px;

    align-items: start;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {

    background: var(--white);

    border: 1px solid var(--line);

    border-radius: 16px;

    padding: 18px;

    position: sticky;

    top: 20px;

    height: max-content;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    align-self: start;
}


.sidebar::-webkit-scrollbar {

    width: 5px;
}


.sidebar::-webkit-scrollbar-track {

    background: transparent;
}


.sidebar::-webkit-scrollbar-thumb {

    background: #d1d5db;

    border-radius: 10px;
}


.sidebar h3 {

    font-size: 14px;

    text-transform: uppercase;

    letter-spacing: .06em;

    color: var(--ink-soft);

    margin: 4px 6px 12px;
}


/* =========================================================
   CATEGORY BUTTONS
========================================================= */

.cat-btn {

    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    text-align: left;

    background: transparent;

    border: none;

    border-radius: 10px;

    padding: 11px 12px;

    font-size: 14px;

    color: var(--ink);

    cursor: pointer;

    margin-bottom: 4px;

    font-weight: 500;

    line-height: 1.35;

    transition:
        background .15s ease,
        color .15s ease;
}


.cat-btn:hover {

    background: var(--accent-light);
}


.cat-btn.active {

    background: var(--accent);

    color: var(--white);
}


.cat-btn .count {

    margin-left: auto;

    flex: none;

    font-size: 14px;

    background: rgba(0, 0, 0, .06);

    border-radius: 20px;

    padding: 2px 8px;

    color: inherit;
}


.cat-btn.active .count {

    background:
        rgba(255, 255, 255, .25);
}


/* =========================================================
   LEGEND
========================================================= */

.legend {

    margin-top: 18px;

    padding-top: 16px;

    border-top: 1px solid var(--line);
}


.legend h3 {

    font-size: 14px;

    text-transform: uppercase;

    letter-spacing: .06em;

    color: var(--ink-soft);

    margin: 4px 6px 12px;
}


.legend-item {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 14px;

    color: var(--ink-soft);

    padding: 4px 6px;

    line-height: 1.4;
}


/* =========================================================
   MOBILE SIDEBAR BUTTON
========================================================= */

.sidebar-toggle {

    display: none;
}


/* =========================================================
   MAIN COLUMN
========================================================= */

.main-col {

    min-width: 0;
}


/* =========================================================
   FILTER ROW
========================================================= */

.tabs-row {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 16px;

    align-items: center;
}


/* =========================================================
   FILTER BUTTON
========================================================= */

.tab-btn {

    background: var(--white);

    border: 1px solid var(--line);

    border-radius: 10px;

    padding: 10px 18px;

    font-size: 14px;

    font-weight: 600;

    color: var(--ink);

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}


.tab-btn:hover {

    border-color: var(--accent);
}


.tab-btn.active {

    background: var(--accent);

    color: var(--white);

    border-color: var(--accent);
}


/* =========================================================
   YEAR FILTER
========================================================= */

.year-filter {

    background: var(--white);

    border: 1px solid var(--line);

    border-radius: 10px;

    padding: 10px 14px;

    font-size: 14px;

    font-weight: 600;

    color: var(--ink);

    cursor: pointer;

    min-width: 130px;
}


.year-filter:focus {

    outline: 2px solid var(--accent);

    outline-offset: 1px;

    border-color: var(--accent);
}


/* =========================================================
   SEARCH
========================================================= */

.search-box {

    margin-left: auto;

    flex: 1 1 220px;

    max-width: 320px;
}


.search-box input {

    width: 100%;

    padding: 10px 14px;

    border: 1px solid var(--line);

    border-radius: 10px;

    font-size: 14px;

    background: var(--white);

    color: var(--ink);
}


.search-box input:focus {

    outline: 2px solid var(--accent);

    outline-offset: 1px;
}


/* =========================================================
   YEAR HEADING
========================================================= */

.year-heading {

    display: flex;

    align-items: center;

    gap: 10px;

    margin: 26px 4px 12px;

    font-size: 17px;

    font-weight: 800;

    line-height: 1.3;

    color: var(--ink);
}


.year-heading:first-child {

    margin-top: 6px;
}


.year-heading::before {

    content: "";

    width: 7px;
    height: 22px;

    border-radius: 4px;

    background: var(--accent);

    flex: none;
}


.year-heading span {

    color: var(--accent-dark);
}


/* =========================================================
   CATEGORY HEADING
========================================================= */

.section-title {

    font-size: 15px;

    font-weight: 800;

    color: var(--ink);

    margin: 26px 4px 12px;

    display: flex;

    align-items: center;

    gap: 8px;

    line-height: 1.4;
}


.section-title::before {

    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--accent);

    flex: none;
}


/* =========================================================
   PUBLICATION CARD
========================================================= */

.pub-card {

    background: var(--white);

    border: 1px solid var(--line);

    border-radius: 14px;

    padding: 20px 22px;

    margin-bottom: 14px;

    transition:
        box-shadow .15s ease,
        transform .15s ease,
        border-color .15s ease;
}


.pub-card:hover {

    box-shadow:
        0 6px 18px rgba(0, 0, 0, .08);

    transform: translateY(-1px);

    border-color: var(--accent);
}


.pub-content {

    width: 100%;
}


/* =========================================================
   BADGES
========================================================= */

.badge {

    display: inline-block;

    font-size: 14px;

    font-weight: 700;

    padding: 6px 10px;

    border-radius: 8px;

    border: 1px solid;

    white-space: nowrap;

    margin-bottom: 10px;
}


.badge-sci {

    color: var(--green);

    background: var(--green-bg);

    border-color: var(--green-border);
}


.badge-scopus {

    color: var(--blue);

    background: var(--blue-bg);

    border-color: var(--blue-border);
}


.badge-ieee {

    color: var(--purple);

    background: var(--purple-bg);

    border-color: var(--purple-border);
}


.badge-intl {

    color: var(--orange);

    background: var(--orange-bg);

    border-color: var(--orange-border);
}


.badge-chair {

    color: var(--star);

    background: var(--star-bg);

    border-color: var(--star-border);
}


.badge-book {

    color: var(--accent-dark);

    background: var(--accent-light);

    border-color: #a5f3fc;
}


.badge-preprint {

    color: #6b7280;

    background: #f9fafb;

    border-color: #d1d5db;
}


/* =========================================================
   PUBLICATION TITLE
========================================================= */

.pub-content h4 {

    margin: 0 0 12px;

    font-size: 17px;

    line-height: 1.4;

    font-weight: 700;
}


/* =========================================================
   PUBLICATION FOOTER
========================================================= */

.pub-footer {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 14px;

    flex-wrap: wrap;
}


.pub-meta {

    min-width: 0;

    flex: 1;
}


.pub-authors {

    font-size: 14px;

    color: var(--ink-soft);

    line-height: 1.5;

    margin-bottom: 4px;
}


.pub-venue {

    font-size: 14px;

    color: var(--ink-faint);

    line-height: 1.5;
}


.pub-venue b {

    color: var(--ink);

    font-weight: 600;
}


/* =========================================================
   VIEW BUTTON
========================================================= */

.view-btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    font-size: 14px;

    font-weight: 700;

    color: var(--white);

    background: var(--accent);

    border: 1px solid var(--accent);

    border-radius: 8px;

    padding: 8px 16px;

    text-decoration: none;

    flex: none;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.view-btn:hover {

    background: var(--accent-dark);

    border-color: var(--accent-dark);

    color: var(--white);

    transform: translateY(-1px);
}


.view-btn.disabled {

    background: var(--white);

    color: var(--ink-faint);

    border-color: var(--line);

    cursor: default;

    pointer-events: none;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {

    text-align: center;

    padding: 60px 20px;

    color: var(--ink-soft);

    background: var(--white);

    border: 1px dashed var(--line);

    border-radius: 14px;

    font-size: 14px;

    line-height: 1.6;
}


/* =========================================================
   SEARCH HIGHLIGHT
========================================================= */

.publications-page mark {

    background: var(--accent);

    color: var(--white);

    border-radius: 3px;

    padding: 0 2px;
}


/* =========================================================
   BACK TO TOP BUTTON
========================================================= */

.back-to-top {

    position: fixed;

    right: 22px;
    bottom: 22px;

    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--accent);

    border-radius: 50%;

    background: var(--accent);

    color: var(--white);

    font-size: 20px;

    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    opacity: 0;

    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        background .2s ease;

    z-index: 9999;

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


.back-to-top:hover {

    background: var(--accent-dark);

    border-color: var(--accent-dark);

    transform: translateY(-2px);
}


.back-to-top.show {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .pub-body {

        grid-template-columns: 1fr;

        gap: 12px;
    }


    .sidebar {

        position: static;

        display: none;

        width: 100%;

        max-height: none;

        overflow: visible;

        margin-bottom: 10px;
    }


    .sidebar.open {

        display: block;
    }


    .sidebar-toggle {

        display: flex;

        align-items: center;

        justify-content: space-between;

        width: 100%;

        background: var(--white);

        border: 1px solid var(--line);

        border-radius: 10px;

        padding: 10px 14px;

        font-weight: 700;

        font-size: 14px;

        cursor: pointer;

        margin-bottom: 10px;

        color: var(--ink);
    }


    .pub-title h1 {

        font-size: 32px;
    }


    .search-box {

        max-width: none;

        flex-basis: 100%;
    }


    .year-filter {

        flex: 1;
    }

}


/* =========================================================
   MOBILE
   Minimum normal text size: 14px
========================================================= */

@media (max-width: 560px) {

    .pub-wrap {

        width: 100%;

        max-width: 100%;

        padding:
            20px 12px
            45px;
    }


    .pub-header {

        margin-bottom: 18px;

        gap: 14px;
    }


    .pub-title h1 {

        font-size: 28px;

        line-height: 1.15;

        margin-bottom: 7px;
    }


    .pub-title p {

        font-size: 14px;

        line-height: 1.55;
    }


    /* Statistics */

    .stat-row {

        width: 100%;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }


    .stat-card {

        min-width: 0;

        padding: 11px 12px;

        border-radius: 10px;
    }


    .stat-card .num {

        font-size: 19px;
    }


    .stat-card .lbl {

        font-size: 14px;

        line-height: 1.3;
    }


    /* Filters */

    .tabs-row {

        gap: 8px;

        margin-bottom: 12px;
    }


    .tab-btn {

        padding: 9px 12px;

        font-size: 14px;

        border-radius: 8px;
    }


    .year-filter {

        width: 100%;

        min-width: 0;

        padding: 10px 12px;

        font-size: 14px;

        border-radius: 8px;
    }


    .search-box input {

        padding: 10px 12px;

        font-size: 14px;

        border-radius: 8px;
    }


    /* Sidebar */

    .sidebar-toggle {

        font-size: 14px;

        padding: 11px 13px;
    }


    .sidebar h3,
    .legend h3,
    .legend-item,
    .cat-btn,
    .cat-btn .count {

        font-size: 14px;
    }


    /* Year headings */

    .year-heading {

        font-size: 18px;

        line-height: 1.3;

        margin: 20px 2px 10px;

        gap: 7px;
    }


    .year-heading::before {

        width: 5px;

        height: 20px;
    }


    .section-title {

        font-size: 15px;

        line-height: 1.4;

        margin: 18px 3px 10px;

        gap: 7px;
    }


    /* Publication cards */

    .pub-card {

        width: 100%;

        padding: 15px;

        margin-bottom: 11px;

        border-radius: 12px;

        box-shadow: none;
    }


    .badge {

        font-size: 14px;

        padding: 5px 9px;

        border-radius: 7px;

        margin-bottom: 9px;
    }


    .pub-content h4 {

        font-size: 16px;

        line-height: 1.45;

        margin:
            0 0 10px;

        font-weight: 700;
    }


    .pub-authors {

        font-size: 14px;

        line-height: 1.5;

        margin-bottom: 5px;
    }


    .pub-venue {

        font-size: 14px;

        line-height: 1.5;
    }


    .pub-footer {

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 10px;
    }


    .view-btn {

        width: 100%;

        padding: 10px 14px;

        font-size: 14px;

        border-radius: 8px;
    }


    .empty-state {

        padding: 35px 15px;

        font-size: 14px;
    }


    .back-to-top {

        width: 38px;
        height: 38px;

        right: 12px;
        bottom: 12px;

        font-size: 18px;
    }


    /* Loader */

    .loader-spinner {

        width: 40px;
        height: 40px;

        border-width: 3px;
    }


    .loader-text {

        font-size: 14px;
    }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .pub-wrap {

        padding-left: 10px;

        padding-right: 10px;
    }


    .pub-title h1 {

        font-size: 25px;
    }


    .pub-title p {

        font-size: 14px;
    }


    .stat-row {

        grid-template-columns:
            1fr 1fr;
    }


    .stat-card .num {

        font-size: 18px;
    }


    .stat-card .lbl {

        font-size: 14px;
    }


    .section-title {

        font-size: 14px;
    }


    .year-heading {

        font-size: 17px;
    }


    .pub-card {

        padding: 13px;
    }


    .pub-content h4 {

        font-size: 15px;
    }


    .pub-authors,
    .pub-venue,
    .badge,
    .view-btn,
    .tab-btn,
    .year-filter,
    .search-box input,
    .cat-btn,
    .cat-btn .count,
    .legend-item,
    .sidebar-toggle,
    .loader-text {

        font-size: 14px;
    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.cat-btn:focus-visible,
.tab-btn:focus-visible,
.sidebar-toggle:focus-visible,
.view-btn:focus-visible,
.back-to-top:focus-visible {

    outline:
        3px solid rgba(6, 182, 212, .35);

    outline-offset: 2px;
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .loader-spinner,
    .loader-text::after {

        animation: none !important;
    }


    .stat-card,
    .cat-btn,
    .tab-btn,
    .pub-card,
    .view-btn,
    .back-to-top {

        transition: none !important;
    }


    .stat-card:hover,
    .pub-card:hover,
    .view-btn:hover,
    .back-to-top:hover {

        transform: none;
    }

}