/* Preflights are needed for default values of variables */
/* @unocss preflights; */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ui-modal-overlay);
    z-index: 11726;
}

.modal * {
    box-sizing: border-box;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    max-width: 600px;
    max-height: 800px;
    outline: none;
    border: 4px solid var(--ui-white-transparent);
    padding: 0;
    border-radius: var(--space);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    overflow: hidden;
    z-index: 11727;
}

.header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    height: var(--library-header-height);
    box-sizing: border-box;
    width: 100%;
    background-color: var(--charlotte-primary);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: normal;
}

.title {
    color: white;
    margin-left: auto;
}

.body {
    background: white;
    height: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    padding-bottom: 5rem;
    overflow-y: auto;
}

.closeButton {
    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;  /* Mask the icon animation */
    background-color: var(--ui-black-transparent);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    user-select: none;
    cursor: pointer;
    transition: all 0.15s ease-out;
}

.closeButton:hover {
    transform: scale(1.1, 1.1);
}

.closeIcon {
    margin: 0.25rem;
    user-select: none;
    transform-origin: 50%;
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
}

.settings {
    margin: var(--space) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space);
}

.settings .settingItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.headerItem {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--clipcc-on-motion-primary);
    user-select: none;
}

.addon {
    display: flex;
    border: 1px solid transparent;
    border-radius: calc(var(--space) / 2);
    padding: 0.5rem;
    width: 100%;
    margin-bottom: var(--space);
    transition-duration: .2s;
    flex-direction: column;
}

.addon .addonHeader {
    display: flex;
    align-items: center;
    flex-direction: row;
}

.expand {
    border: 1px solid var(--charlotte-ui-tertiary);
}

.addon:hover {
    background-color: var(--ui-black-transparent);
}

.addon .info {
    display: flex;
    max-width: 90%;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    margin-right: auto;
}

.name {
    font-weight: bold;
}

.subname {
    font-weight: 600;
    font-size: 14px;
}

.addon .info .description {
    flex-wrap: wrap;
    font-size: 12px;
}

.switch {
    width: 3rem;
    height: 1.5rem;
    border-radius: 1.5rem;
    border: solid var(--ui-black-transparent) 1px;
    display: inline-block;
    transition: background-color 0.3s;
    cursor: pointer;
}

.switch .true {
    background-color: var(--charlotte-primary);
}

.switch .false {
    background-color: #e6e6e6;
}

.switch .disabled {
    background-color: #7c7c7c;
}

.slider {
    width: calc(1.5rem - 4 * 1px);
    min-height: calc(1.5rem - 4 * 1px);
    border-radius: calc(1.5rem - 4 * 1px);
    margin: calc((1.5rem - calc(1.5rem - 4 * 1px)) / 2 - 1px);
    transition: all 0.3s;
    border: solid var(--ui-black-transparent) 1px;
    background-color: var(--ui-white);
}

.slider.true {
    transform: translateX(calc(3rem - 1.5rem));
}

.slider.false {
    transform: translateX(0rem);
}

.slider.disabled {
    background-color: #d3d3d3;
}

.dummyInput {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    margin: 0;
}

.alert {
    width: 100%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    justify-content: flex-start;
    background: #FFF0DF;
    border: 1px solid #FF8C1A;
    border-radius: calc(var(--space) / 2);
    margin-bottom: var(--space);
    padding: 1rem;
}

.inputForm {
    height: 2rem;
    padding: 0 0.75rem;

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.625rem;
    font-weight: bold;
    background-color: var(--ui-white);
    color: var(--text-primary);

    border-width: 1px;
    border-style: solid;
    border-color: var(--ui-black-transparent);
    border-radius: 2rem;

    outline: none;
    cursor: text;
    transition: 0.25s ease-out; /* @todo: standardize with var */
    box-shadow: none;

    /*
        For truncating overflowing text gracefully
        Min-width is for a bug: https://css-tricks.com/flexbox-truncated-text
        @todo: move this out into a mixin or a helper component
    */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.inputForm:hover {
    border-color: var(--charlotte-primary);
}

.inputForm:focus {
    border-color: var(--charlotte-primary);
    box-shadow: 0 0 0 0.25rem var(--charlotte-transparent);
}

.inputSmall {
    width: 3rem;
    padding: 0 0.5rem;
    text-overflow: clip;
    text-align: center;
}

