/* Chrome UI CSS - Scoped styles for CheckEagle chrome elements
 *
 * Scoping strategy:
 * - ID selectors (#toplinks, #header) - used directly (globally unique)
 * - Class selectors (.footer, .checkeagle) - prefixed with .ce-ui
 *   to protect chrome classes from user CSS
 *
 * This file is used when rendering checklists with :chrome on directive.
 */

/* Color constants - copied from common-colors.css */
:root {
    /* Semantic theme colors - red */
    --darkest-red: #500000;
    --dark-red: #600000;
    --red: #700000;
    --bright-red: #B00000;

    /* Common grays */
    --page-bg: white;
    --header-footer-bg: #120703;
    --darkest-grey: #202020;
    --darker-grey: #404040;
    --dark-grey: #505050;
    --darkish-grey: #606060;
    --mid-grey: #808080;
    --light-grey: #A0A0A0;
    --lighter-grey: #C0C0C0;
    --lightest-grey: #E0E0E0;

    /* Entity theme colors */
    --dark-green: #005000;
    --bright-blue: #2C45A1;
    --darkest-orange: #B0481A;

    /* Tab colors by entity type */
    --checklist-theme-colour: var(--red);
    --style-theme-colour: var(--darkest-orange);
    --link-theme-colour: var(--bright-blue);
    --completion-theme-colour: var(--dark-green);

    /* Theme variables - default to red/checklist theme */
    --theme-tab-colour: var(--darkest-red);
    --theme-tab-hover-colour: var(--red);
    --theme-link-colour: var(--red);
    --theme-link-visited-colour: var(--dark-red);
    --theme-link-hover-colour: var(--bright-red);
    --unselected-tab-grey: var(--darkish-grey);

    /* Icon alignment - default for text mode */
    --toplinks-icon-valign: baseline;

    /* Tab border thickness */
    --tab-border-thickness: 3px;
}

/* Body and basic structure */
body {
    margin: 0 5px;
}

/* Chrome wrapper - font and padding */
.ce-ui {
    font-family: helvetica, arial, sans;
    padding-bottom: 10px;
}

/* Toplinks (sign-in, language, settings, help) */
#toplinks {
    margin-top: 2px;
    margin-bottom: 0;
    padding: 0 4px 0 0;
    text-align: right;
    font-size: small;
    line-height: 1;
}

/* Links in toplinks */
#toplinks a {
    color: var(--darker-grey);
    text-decoration: none;
}

#toplinks a:visited {
    color: var(--darker-grey);
}

#toplinks a:hover {
    color: var(--theme-link-colour);
    text-decoration: underline;
}

/* Toplinks separators */
.topsep {
    color: var(--page-bg);
}

/* Actionlink and nonactionlink */
.actionlink, .nonactionlink {
    font-size: small;
}

.actionlink, .actionlink a {
    color: var(--darker-grey);
    text-decoration: none;
}

.nonactionlink, .nonactionlink a, .nonactionlink a:hover {
    color: var(--lighter-grey);
    text-decoration: none;
}

.actionlink a:hover {
    color: var(--theme-link-colour);
    text-decoration: underline;
}

.actionlink.disabled, .actionlink.disabled a {
    color: var(--lighter-grey);
    cursor: default;
}

.actionlink.disabled a:hover {
    color: var(--lighter-grey);
    text-decoration: none;
    cursor: default;
}

/* Language selector and menu */
.language-selector {
    position: relative;
    display: inline-block;
}

#language-trigger {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: small;
    padding: 2px 6px;
    outline: none;
}

#language-trigger:hover {
    background-color: var(--lightest-grey);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--mid-grey);
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    min-width: 120px;
}

.language-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 6px;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.language-menu a:hover {
    background-color: var(--lightest-grey);
    text-decoration: none;
}

.language-menu.hidden {
    display: none;
}

/* Icon sizing for toplinks */
#toplinks .icon-svg {
    vertical-align: var(--toplinks-icon-valign);
}

#toplinks .icon-svg svg {
    width: 1.2em;
}

/* Header and banner */
#header {
    margin-top: 6px;
    margin-bottom: 1em;
}

.ce-ui .checkeagle {
    font-size: x-large;
    font-family: Palatino, "Palatino Linotype", "Book Antiqua", serif;
    color: white;
    background-color: var(--header-footer-bg);
    height: 52px;
    width: 100%;
}

.ce-ui .checkeagle a.ll {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    height: 52px;
    padding-left: 4px;
}

.ce-ui .checkeagle a img {
    display: block;
    flex-shrink: 0;
    margin-top: -4px;
}

.ce-ui .checkeagle a:hover {
    text-decoration: none;
}

.ce-ui .headertable {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}


/* Tab colored underlines */
.listline {
    border-bottom: solid var(--tab-border-thickness)
        var(--checklist-theme-colour);
}

.completedline {
    border-bottom: solid var(--tab-border-thickness)
        var(--completion-theme-colour);
}

.styleline {
    border-bottom: solid var(--tab-border-thickness)
        var(--style-theme-colour);
}

.linkline {
    border-bottom: solid var(--tab-border-thickness)
        var(--link-theme-colour);
}

.sepline {
    border-bottom: solid 3px black;
}

/* Tab switches (Checklists, Styles, Completions, Links) */
.ce-ui .switch,
.ce-ui .checkswitch {
    color: white;
    font-size: small;
    text-align: right;
    padding-right: 1em;
    height: 52px;
}

.ce-ui .checkswitch,
.ce-ui .ontext a {
    background-color: var(--header-footer-bg);
    text-decoration: none;
}

.ce-ui .offtext a:hover,
.ce-ui .ontext a:hover {
    text-decoration: none;
    color: white;
}

.ce-ui .ontext,
.ce-ui .ontext a {
    font-weight: bold;
    font-size: small;
    color: white;
}

.ce-ui .ontext a:visited {
    color: white;
}

.ce-ui .offtext,
.ce-ui .offtext a {
    font-weight: normal;
    font-size: small;
    color: var(--unselected-tab-grey);
}

/* Tab styling */
.ce-ui .tab,
.ce-ui .selectedtab,
.ce-ui .createbutton,
.ce-ui .greyedtab {
    width: 100px;
    border: 1px solid white;
    margin: 0;
    text-align: center;
    font-size: small;
    color: white;
}

.ce-ui .selectedtab {
    background-color: var(--theme-tab-colour);
}

.ce-ui .greyedtab,
.ce-ui .greyedtab a {
    color: var(--unselected-tab-grey);
}

.ce-ui .tab,
.ce-ui .createbutton,
.ce-ui .greyedtab {
    background-color: var(--mid-grey);
}

.ce-ui td.createbutton a,
.ce-ui td.tab a,
.ce-ui td.selectedtab a {
    color: white;
}

.ce-ui td.createbutton a:visited,
.ce-ui td.tab a:visited,
.ce-ui td.selectedtab a:visited {
    color: white;
}

.ce-ui .createbutton a:hover,
.ce-ui td.tab a:hover,
.ce-ui td.selectedtab a:hover {
    color: white;
    text-decoration: none;
    background-color: var(--theme-tab-hover-colour);
}

.ce-ui .createbutton a:visited:hover,
.ce-ui td.tab a:visited:hover,
.ce-ui td.selectedtab a:visited:hover {
    color: white;
    text-decoration: none;
    background-color: var(--theme-tab-hover-colour);
}

.ce-ui a.ll {
    display: block;
    padding: 2px 0 2px 0;
}

.ce-ui .headertable td.tab,
.ce-ui .headertable td.selectedtab,
.ce-ui .headertable td.createbutton,
.ce-ui .headertable td.greyedtab {
    padding: 0;
    margin: 0;
}

.ce-ui .headertable td.empty {
    padding: 0 0 0 6px;
    margin: 0;
}

.ce-ui .headertable td.tab:first-child,
.ce-ui .headertable td.selectedtab:first-child,
.ce-ui .headertable td.createbutton:first-child,
.ce-ui .headertable td.greyedtab:first-child {
    border-left: none;
}

.ce-ui .headertable td.tab:last-child,
.ce-ui .headertable td.selectedtab:last-child,
.ce-ui .headertable td.createbutton:last-child,
.ce-ui .headertable td.greyedtab:last-child {
    border-right: none;
}

/* Footer */
.ce-ui .foot {
    margin-top: 1em;
}

.ce-ui .foottable a {
    color: white;
}

.ce-ui .footer {
    background-color: var(--header-footer-bg);
    padding: 6px 0 6px 0;
}

.ce-ui .footer td {
    color: white;
    padding: 0 .5ex 0 0.8em;
    font-size: small;
}

.ce-ui .footer a:hover {
    color: #FFD603;
    text-decoration: none;
}

/* Language-specific styles: UNIX/Lunix (ux_LI) */
body[data-language="ux_LI"] .ce-ui #toplinks,
body[data-language="ux_LI"] .ce-ui .checkeagle,
body[data-language="ux_LI"] .ce-ui .checkswitch,
body[data-language="ux_LI"] .ce-ui .subtab,
body[data-language="ux_LI"] .ce-ui .footer,
body[data-language="ux_LI"] .ce-ui .actionlink {
    font-family: "PT Mono", Menlo, monospace;
}
