/* base.css */
html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 14px;
    font-weight: 600;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    line-height: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav {
    padding: 12px 15px;
    margin-bottom: 4px;
    width: 100%;
    flex-grow: 0;
    background: #fafafa;
    box-sizing: border-box;
}

label {
    vertical-align: baseline;
}

button {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 14px;
    line-height: 20px;
}

strong {
    font-weight: 700;
}

code {
    font-family: monospace;
    background-color: #ccc;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
}

.hiddenBasePreview {
    height: 0px !important;
    width: 0px !important;
}

.hiddenError {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.hidden{
    display: none !important; 
}

.body {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: center;
    flex-grow: 0;
}

#spacer-top {
    width: 100%;
    height: 21%;
    flex-shrink: 1;
}

#spacer-bottom {
    height: 10%;
    flex-shrink: 1;
}

#tool {
    display: flex;
    flex-direction: row;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 30px;
    gap: 30px;
}

.switches {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.toggle-switch {
    display: inline-flex;
    background-color: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.toggle-button {
    padding: 8px 16px;
    background: #ddd;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    transition: background-color 0.3s, color 0.3s;
}

.toggle-button:hover {
    background-color: #c8c8c8;
    border-color: #b8bec6;
}

.toggle-button.active {
    background-color: #ffffff;
    color: black;
    font-weight: 600;
}

.toggle-button.active:hover {
    background-color: #f0f0f0;
    border-color: #b8bec6;
}

.latching-button {
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    background-color: #ddd;
    border: none;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    transition: background-color 0.3s;
    width: 112px;
}

.latching-button:hover {
    background-color: #c8c8c8
    border-color: #b8bec6;
}

.latching-button.active {
    background-color: #437FCA;
    border-color: #3a6eb7;
    color: white;
}

.latching-button.active:hover {
    background-color: #376FB8;
    border-color: #2f5fa2;
}

.alpha-label {
    font-size: 16px;
}

#targetAInput {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
    width: 94px;
    padding: 0px;
}

#targetA {
    margin-top: 4px;
}

.inputModule {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: #f5f5f5;
    margin: 14px 0 0;
    width: 300px;
    padding: 5px 14px 14px;
}

.colorInput {
    width: 210px;
}

.rgb {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

.rgbLabel {
    display: flex;
    flex-direction: column;
    align-items: start;
    flex: 1;
}

.hexLabel {
    display: flex;
    flex-direction: row;
    align-items: start;
    padding-top: 7px;
}

input {
    padding: 3px 6px;
    border-radius: 3px;
}

.rgbInput {
    min-width: calc(1ch * 6);
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #aaa;
}

#overlayA {
    min-width: calc(1ch * 8);
}

.hexInput {
    border: 1px solid #aaa;
    width: 100%;
}

.inputPreview {
    height: 75px;
    width: 75px;
    border: 1px solid #ccc;
    background-color: #fff;
}

#output {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 300px;
    width: 300px;
    border: 1px solid #ccc;
    overflow: hidden;
}

#errorMessage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffeeeedd;
    color: #f00;
    padding: 2px 8px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 1;
}

.colorBox {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#baseColorPreview {
    height: 134px;
    transition: height 0.2s;
}

#outputColorPreview {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 50%;
    flex: 1;
}

#outputColorOverlay {
    padding: 2px 8px;
    width: 100%;
    box-sizing: border-box;
}

.outputText {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.invalidResultBackground {
    background-color: #ffeeeedd !important;
}

.invalidResult {
    color: #F00 !important;
}

.copyText {
    cursor: pointer;
}

.copiedText {
    position: absolute;
    right: 0;
    transform: translateX(125%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.showCopied {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

.help {
    align-self: flex-start;
    overflow-wrap: break-word;
    padding: 5px 10px;
    box-sizing: border-box;
    max-width: 725px;
}

.help li {
    font-weight: 400;
    font-size: 16px;
}

@media (max-width: 720px) {
    #tool {
        flex-direction: column;
        margin-bottom: 0;
        gap: 15px;
    }

    #output {
        width: 100%;
        height: 110px;
    }

    .colorBox {
        flex-direction: row;
        width: 100%;
        height: 110px;
    }

    #baseColorPreview {
        height: 100%;
        width: 50%;
        transition: width 0.2s;
    }

    .help {
        padding: 10px 25px;
    }
}

@media (max-height: 825px) {
    #spacer-top {
        height: 22%;
    }

    #spacer-bottom {
        height: 27%;
    }

    .help {
        display: none;
    }
}