/*************************************/
/************* VARIABLES *************/
/*************************************/

html {
    /* DevSeed Brand Colors */
    --color-repo-main: #CF3F02;      /* Grenadier (signature orange) */
    --color-repo: #2E86AB;           /* Aquamarine (secondary blue) */
    --color-owner: #CF3F02;          /* Grenadier */
    --color-contributor: #3A9BBF;    /* Lighter aquamarine for contributors */
    --color-text: #443F3F;           /* Base dark gray */
    --color-background: #f7f7f7;
    --color-gradient: linear-gradient(to right, var(--color-repo), var(--color-repo-main)) 1;
}

body {
    margin: 0;
    font-family: 'Roboto', 'Antarctica', sans-serif;
}

.central-repo {
    /* color: var(--color-repo-main); */
    background: var(--color-repo-main);
    padding: 0.1em 0.3em;
    font-weight: 700;
    color: white
}

.contributor {
    /* color: var(--color-contributor); */
    background: var(--color-contributor);
    padding: 0.1em 0.3em;
    font-weight: 700;
}

.repository {
    background: var(--color-repo);
    padding: 0.1em 0.3em;
    /* border-bottom: 0.3em solid var(--color-repo); */
    font-weight: 700;
}

.repo-name-only {
    font-style: italic;
}

.owner {
    /* color: var(--color-owner); */
    background: var(--color-owner);
    padding: 0.1em 0.3em;
    font-weight: 700;
}

p {
    line-height: 140%;
    color: var(--color-text);
}

.double-column {
    padding: 3em 5em 2em 5em;

    font-size: 1.2em;

    display: grid;
    justify-content: center;
    align-items: top;

    grid-template-columns: 1fr 1fr;
    column-gap: 7em;
    row-gap: 1em;
}

.double-column .header {
    text-align: center;
    font-size: 1.0em;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    margin-bottom: 0;

    border-bottom: 3px solid var(--color-repo-main);
    border-image: var(--color-gradient);

    grid-column-start: 1;
    grid-column-end: 3;
    grid-row-start: 1;
    grid-row-end: 1;
}

.double-column p {
    line-height: 160%;
    font-size: 0.8em;
}

.code {
    font-family: 'Fira Code', monospace;
    background-color: #2E86AB30;    /* Aquamarine at ~20% opacity */
    font-size: 0.9em;
    padding: 0.2em 0.4em;
}

a {
    border-bottom: 3px solid var(--color-repo);
    border-image: linear-gradient(to right, var(--color-repo), var(--color-repo-main)) 1;
    /* padding: 0.1em 0.3em; */
    font-weight: 700;
    cursor: pointer;
    color: var(--color-text);
    text-decoration: none;
}

/*************************************/
/*************** INTRO ***************/
/*************************************/

#chart-wrapper {
    min-width: 900px;
    /* Min size that the visual can becom */
    max-width: 1400px;
    /* Max size that the visual can become */

    border-top: 10px solid var(--color-repo-main);
    border-image: var(--color-gradient);
    margin: 0 auto;
}

#chart-introduction {
    /* Create a linear gradient for the background going from transparent #f7f7f7 to #f7f7f7 downward */
    background: linear-gradient(to bottom, rgba(247, 247, 247, 0) 50%, rgba(247, 247, 247, 1) 100%);
    padding: 3em 5em 2em 5em;

    display: grid;
    justify-content: center;
    align-items: top;

    grid-template-columns: 1fr 2fr;
    column-gap: 5em;
    row-gap: 5em;
}

#chart-title {
    grid-column-start: 1;
    grid-column-end: 1;
}

#chart-title h1 {
    font-weight: 400;
    font-size: 2.4em;
    font-style: italic;
    margin-bottom: 0.2em;
    margin-top: 0em;
}

#chart-title h1#title-repo-name {
    font-weight: 700;
    font-size: 2.6em;
    margin-top: 0.2em;
    font-style: normal;
}

#chart-title #last-commit-date {
    font-size: 0.9em;
    padding-top: 1em;
    font-style: italic;
    opacity: 0.6;
    padding-bottom: 3em;
}

#chart-intro-text {
    grid-column-start: 2;
    grid-column-end: 2;
    font-weight: 400;
    font-size: 1.1em;
}

#explanation-link {
    border-bottom: 2px solid var(--color-repo-main);
    border-image: linear-gradient(to right, var(--color-repo-main), var(--color-repo)) 1;
    font-size: 0.9em;
    font-style: italic;
    color: var(--color-text);
    text-decoration: none;
}

/*************************************/
/************* BAR CHART *************/
/*************************************/

#bar-chart-wrapper {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

#commit-bar-chart {
    overflow: hidden;
    width: 80%;
    height: 0.9em;
    text-align: center;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

#bar-remaining {
    background: #e0e0e0;
}

#bar-non-orca {
    background: var(--color-contributor);
    opacity: 0.7;
}

#bar-orca {
    background: var(--color-contributor);
}

#legend-bar-chart {
    width: 80%;
    margin: 0 auto;
    font-size: 0.7em;
    color: #69656c;
}

#legend-bar-chart li {
    list-style-type: none;
    position: relative;
    font-style: italic;
}

#legend-bar-chart li::before {
    content: '⬤';
    position: absolute;
    left: -1.5em;
    top: -0em;
    font-size: 0.8em;
    font-style: normal;
}

li#item-orca::before {
    color: var(--color-contributor);
}

li#item-non-orca::before {
    color: var(--color-contributor);
    opacity: 0.5;
}

li#item-remaining::before {
    color: #e0e0e0;
}


/*************************************/
/******* EXPLANATION / LEGEND ********/
/*************************************/

#chart-explanation {
    background: linear-gradient(to bottom, rgba(247, 247, 247, 1) 50%, rgba(247, 247, 247, 0) 100%);
}

#tldr-explanation {
    grid-column-start: 1;
    grid-column-end: 3;
    grid-row-start: 3;
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
    font-size: 0.9em;

    border: 3px solid var(--color-repo);
    border-image: linear-gradient(to right, var(--color-repo-main), var(--color-repo)) 1;
    padding: 0.8em 1.2em;
    margin-top: 0.5em;
    margin-bottom: 1.5em;
}

#legend-image {
    grid-column-start: 1;
    grid-column-end: 3;
    grid-row-start: 2;
}

#legend {
    width: 100%;
}

/*************************************/
/**************** ORCA ***************/
/*************************************/


#orca-explanation {
    & ul {
        font-size: 0.75em;
        line-height: 160%;
    }

    & li {
        list-style: none;
    }

    & li::before {
        content: "⬢";
        color: var(--color-repo-main);
        display: inline-block;
        width: 1em;
        margin-left: -1em;
        font-size: 0.7em;
        position: relative;
        top: -3px;
        left: -3px;
    }
}

.orca-name {
    font-weight: 700;
    /* font-style: italic; */
    /* cursor: pointer; */
}

/*************************************/
/************** CREDITS **************/
/*************************************/

#chart-extra {
    position: relative;
    text-align: center;
}

#dataviz-download-data {
    text-align: center;
    background: var(--color-repo-main);
    color: white;
    border: none;
    padding: 0.5em 1em;
    font-size: 1.0em;
    font-weight: 700;
    cursor: pointer;
    margin: 1em auto;
}

#dataviz-credit {
    font-style: italic;
    text-align: center;
    margin-top: 2em;
    margin-bottom: 2em;
    opacity: 0.8;
    font-size: 0.9em;
    line-height: 180%;
}

#dataviz-credit a {
    border-bottom: 3px solid var(--color-repo-main);
    border-image: linear-gradient(to right, var(--color-repo), var(--color-repo-main)) 1;
    /* padding: 0.1em 0.3em; */
    font-weight: 700;
    cursor: pointer;
    color: var(--color-text);
    text-decoration: none;
}

/*************************************/
/*************** CHART ***************/
/*************************************/

/* This is all done within the createORCAVisual function */

#chart-container {
    position: relative;
    background-color: var(--color-background);
    width: 100%;
    min-height: 800px;
    padding: 20px;
}

#chart-zoom-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

#chart-zoom-controls button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #443F3F;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 120ms ease, border-color 120ms ease;
}

#chart-zoom-controls svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0 auto;
}

#zoom-reset {
    width: 36px;
    height: 36px;
    padding: 0;
}

#chart-zoom-controls button:hover {
    border-color: #CF3F02;
    transform: translateY(-1px);
}

#chart-zoom-controls button:active {
    transform: translateY(0);
}

#chart-container canvas {
    display: block;
    margin: 0;
}

#canvas, #canvas-click {
    position: absolute;
    top: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 200ms ease-in;
}

#canvas-hover {
    position: relative;
    z-index: 1
}
/* Filter Controls */
#chart-filters {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #CF3F02;
}

#filter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#filter-header label {
    font-size: 14px;
    font-weight: 600;
    color: #443F3F;
    margin: 0;
}

#org-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #443F3F;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#org-select:hover {
    border-color: #CF3F02;
}

#org-select:focus {
    outline: none;
    border-color: #CF3F02;
    box-shadow: 0 0 0 2px rgba(207, 63, 2, 0.1);
}

#filter-stats {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
    width: 100%;
}

/* Responsive: Stack on small screens */
@media (max-width: 768px) {
    #filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #org-select {
        width: 100%;
        max-width: 300px;
    }
}
