:root {
    --onyx: #0f1f38;
    --onyx-rgb: 15, 31, 56;
    --blue: #236092;
    --oceanic: #1b4b5a;
    --red: #f55449;
    --yellow: #cfb400;
    --green: #00a464;
    --gray-light: #ecedef;
    --gray: #cfd2d7;
    --gray-darker: #6f7988;
    --gray-dark: #4d4d4d;
    --white: #ffffff;
    line-height: 1.8
}

p {
    line-height: 1.8
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--gray-light);
    color: var(--gray-dark);
    line-height: 1.8
}

.blurred-loading-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;

    /* fallback for no backdrop-filter support */
    backdrop-filter: blur(8px);
}

.blurred-loading-box span {
    position: relative;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    animation: pulse 1.5s infinite ease-in-out;
    z-index: 1;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

.pagination-controls {
    display: flex;
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    gap: 8px;
    /* Space between buttons */
    margin: 1em auto;
    flex-wrap: wrap;
    /* Optional: wrap if buttons overflow */
}

.pagination-button {
    padding: 6px 12px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #fff;
    border-radius: 4px;
    background-color: var(--onyx);
    transition: background 0.2s;
}

.pagination-button:hover {
    background-color: var(--oceanic);
}

.pagination-button.active {
    font-weight: bold;
    background: #ddd;
    border-color: #999;
    cursor: default;
}


.pagination-button:hover {
    background-color: #0056b3;
}

.pagination-button.active {
    font-weight: bold;
    background: var(--red);

}

label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease;
}

select:focus {
    border-color: #007BFF;
    outline: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    max-width: 960px;
    margin: 0px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table tr:nth-child(odd) {
    background-color: #f5f5f5;
}

table.clickable-table tr[data-href] {
    cursor: pointer;
}

table.clickable-table tr[data-href]:hover {
    background-color: #f0f0f0;
}

thead {
    background-color: #f8f8f8;
    width: 100%;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    font-size: 16px;
    font-weight: bold;
}

a {
    color: var(--blue);
    text-decoration: none;
}

.loading {
    background: transparent url('/static/rocket.gif') center no-repeat;
}

.button {
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.button.primary {
    background-color: var(--onyx);
    color: #fff;
}

.button.secondary {
    background-color: var(--red);

    color: #fff;
}

.container {
    padding: 2rem;
}

.chart {
    display: block;
    /* kills the little inline-element gap */
    width: 100%;
    /* stretch to wrapper’s width */
    height: auto;
    /* preserve aspect ratio */

    min-height: 300px;

    margin-bottom: 1rem;

}

.chart-wrapper {
    max-width: 100%;
    /* never overflow its parent */
    width: 100%;

}

#docs h2 {
    border-bottom: 2px solid var(--gray);
    padding-bottom: 0.5rem;
}

#docs ul {
    list-style: none;
    padding: 0;
}

#docs li a {
    color: var(--blue);
    text-decoration: none;
}

section {
    margin-top: 2rem;
}

#dashboard {
    display: none;
}

.widget {
    background: var(--gray);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

nav {
    background: var(--onyx);
    display: flex;
    align-items: center;
    /* vertical centering */
    justify-content: space-between;
    /* spread items left/right */
    height: 60px;
    /* or use padding-top/bottom instead */
    padding: 0 1rem;

}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* adjust spacing between logo and badge */
}

nav img#logo,
nav svg {
    height: 40px;
    width: auto;
    display: inline-block;
    vertical-align: baseline;
    margin: 0;
    padding: 0;
}

#title h1 svg {
    height: 40px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

nav a {
    margin: 0 0.75rem;
    /* spacing between links/buttons */
    line-height: 1;
    /* ensure no extra line-height issues */
    text-decoration: none;
    color: #ffffff;

    font-weight: bold;
}

.image-card {
    position: relative;
    width: 100%;
    /* or 100% if responsive */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .overlay {
    opacity: 1;
}

.overlay a {
    background-color: #ffffff;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.overlay button:hover {
    background-color: #f0f0f0;
}

/* Container spacing (optional) */
.tiles {
    margin: 2rem 0;
    position: relative;
}

.tile-title {
    position: absolute;
    top: -2.5rem;
    flex-basis: 100%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    margin-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    color: var(--onyx);
    background-color: #fafafa;
    /* slightly off-white */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    z-index: 1;
}


/* Base tile styles */
.tiles .tile {
    background-color: #fafafa;
    /* slightly off-white */
    border: 1px solid #e0e0e0;
    /* light gray border */
    border-radius: 6px;
    /* soften the corners */
    padding: 1.5rem;
    /* internal spacing */
    margin-bottom: 1.5rem;
    /* space between tiles */
    flex-wrap: wrap;
    /* box-shadow to lift off page */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    position: relative;
    display: flex;

}


.tiles .tile .box50 {
    flex: 1;
    padding: 1rem;
}

.tiles .tile .box33 {
    flex: 1;
    padding: 1rem;
}

.tiles .tile .box67 {
    flex: 2;
    padding: 1rem;
}

.tiles #contributor-trust-score {
    display: flex;
    align-items: stretch;
}

#contributor-trust-score .box67 {
    display: flex;
    flex-direction: column;
}

#sc-alerts-wrapper,
#phf-wrapper {
    display: flex;
    align-items: center;
    /* vertical alignment */
    justify-content: flex-start;
    /* left-align items */
    gap: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #777;
    border-radius: 0.375rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.legend {
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-color {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.center-text {
    font-size: 20px;
    font-weight: bold;
    text-anchor: middle;
    fill: #111;
}

.warning {
    background-color: var(--red);
}


.caution {
    background-color: var(--yellow);
}

.ok {
    background-color: var(--green);

}

/* Base tile styles */
.tiles .tile-spacer {


    padding: 1.5rem;
    /* internal spacing */
    margin-bottom: 1.5rem;
    /* space between tiles */
    position: relative;
    display: flex;
}


.tiles .tile-spacer .left-box {
    flex: 1;
    border: 1px solid #e0e0e0;
    /* light gray border */
    border-radius: 6px;
    padding: 1rem;
    margin-right: 1rem;
}

.tiles .tile-spacer .right-box {
    flex: 1;
    border: 1px solid #e0e0e0;
    /* light gray border */
    border-radius: 6px;
    padding: 1rem;
    margin-left: 1rem;
    background: var(--onyx);
    color: var(--white);
}

.tiles .tile-spacer .middle-box {
    flex: 1;
    border: 1px solid #e0e0e0;
    /* light gray border */
    border-radius: 6px;
    padding: 1rem;
}

/* Bubble element */
.tiles .tile .bubble {
    position: absolute;
    top: -3rem;
    /* adjust distance from top */
    left: -3rem;
    /* adjust distance from left */
    width: 6rem;
    /* circle diameter */
    height: 6rem;
    border-radius: 50%;
    /* make it round */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
    /* sit on top of tile content */
}

/* Bubble element */
.tiles .tile .bubble-red {
    background-color: var(--red);
    color: #fff;
}


/* Bubble element */
.tiles .tile .bubble-yellow {
    background-color: var(--yellow);
    color: #fff;
}


/* Bubble element */
.tiles .tile .bubble-green {
    background-color: var(--green);
    /* pick a standout color */
    color: #fff;
}

.btn-learn-more {
    background-color: var(--red);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.btn-learn-more:hover {
    background-color: #d84338;
    /* Slightly darker red on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/*──────────────────────────────────────────*/
/* Mobile-First Enhancements (Optional):   */
/* make svg charts fluid, text readable   */
/*──────────────────────────────────────────*/
svg {
    max-width: 100%;
    height: auto;
}

/*──────────────────────────────────────────*/
/* Tablets / Small Desktops (≤ 768px)      */
/*──────────────────────────────────────────*/
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    nav a#logo-link {
        margin-bottom: 0.75rem;
    }

    nav a {
        margin: 0.5rem 0;
    }

    .container {
        padding: 1rem;
    }

    /* Stack main tiles vertically */
    .tiles .tile-spacer,
    .tiles .tile {
        flex-direction: column;
    }

    .tiles .tile-spacer .left-box,
    .tiles .tile-spacer .middle-box,
    .tiles .tile-spacer .right-box,
    .tiles .tile .box33,
    .tiles .tile .box50,
    .tiles .tile .box67 {
        flex: none;
        width: 100%;
        padding: 0.5rem;
    }

    .tiles .tile {
        padding: 1rem;
    }

    .tile-title {
        text-align: center;
    }

    .image-card {
        aspect-ratio: auto;
        height: 200px;
    }
}

/*──────────────────────────────────────────*/
/* Phones (≤ 480px)                        */
/*──────────────────────────────────────────*/
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    nav {
        align-items: flex-start;
    }

    nav img#logo {
        height: 30px;
    }

    nav a#btn-learn-more {
        font-size: 0.9rem;
    }

    .tiles {
        margin: 1rem 0;
    }

    /* Shrink bubbles on very small */
    .tiles .tile .bubble-red,
    .tiles .tile .bubble-yellow,
    .tiles .tile .bubble-green {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.75rem;
        top: -0.5rem;
        left: -0.5rem;
    }

    .image-card {
        border-radius: 4px;
    }

    .overlay a {
        padding: 8px 16px;
        font-size: 12px;
    }
}
