@import url('https://mui.kernelsu.org/internal/insets.css');

:root {
    --top-inset: var(--window-inset-top, 0px);
    --bottom-inset: var(--window-inset-bottom, 0px);

    /* Background colors */
    --bg-primary: #FFF2F1;
    --bg-secondary: #fff;
    --bg-overlay: #FFF2F1;
    --bg-input: #F5F5F5;
    --bg-theme: #FFCFCF;

    /* Text colors */
    --text-primary: #000;
    --text-secondary: #757575;

    /* Border colors */
    --border-color: #ddd;

    /* Button colors */
    --btn-primary: #D51200;
    --btn-primary-text:#fff;

    /* Logo color */
    --logo-bg: #D51200;
    --logo-color: #fff;
}

.dark-theme {
    /* Background colors */
    --bg-primary: #151515;
    --bg-secondary: #292929;
    --bg-overlay: #292929;
    --bg-input: #1b1b1b;
    --bg-theme: #FFB3B3;

    /* Text colors */
    --text-primary: #fff;
    --text-secondary: #C2C2C2;

    /* Border colors */
    --border-color: #636363;

    /* Logo color */
    --logo-bg: #fff;
    --logo-color: #D51200;
}

body {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding-top: var(--top-inset);
    padding-bottom: var(--bottom-inset);
    transition: padding-bottom 0.2s ease;
    margin: 0;
}

body.input-focused {
    padding-bottom: 50vh;
}

.content {
    margin-top: 20px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.header {
    background-color: var(--btn-primary);
    width: 90vw;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    border: none;
    border-radius: 15px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    padding: 25px 15px;
    user-select: none;
}

.header-disabled {
    display: none;
    justify-content: flex-start !important;
    font-size: 16px;
    padding: 10px 15px;
    background-color: var(--border-color);
    color: var(--text-secondary);
    user-select: none;

    svg {
        fill: var(--text-secondary);
        height: 20px;
        width: 20px;
    }
}

.header-disabled p {
    margin: 0;
    font-size: 0.7em;
}

#broken-mount-box {
    background-color: var(--btn-primary-text);
    color: var(--btn-primary);

    svg {
        flex-shrink: 0;
        fill: var(--btn-primary);
        height: 1.5em;
        width: 1.5em;
    }
}

.logo {
    height: 100%;
    display: flex;
    align-items: center;
    width: calc(100% - 60px);

    svg {
        fill: var(--btn-primary-text);
    }
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 90vw;
    max-width: 800px;
    background-color: var(--bg-theme);
    color: var(--btn-primary);
    border-radius: 15px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    user-select: none;
}

.dashboard-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px 5px;
}

.dashboard-item-title {
    font-size: 14px;
}

.dashboard-item-content {
    font-size: 20px;
}

.festival {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    z-index: -1;
}

.festival img {
    width: 100%;
    height: auto;
}

.festival.show {
    display: block;
}

.about {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;

    svg {
        fill: var(--btn-primary-text);
    }
}

.theme-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#theme-select {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;
    height: 30px;
    width: 30px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.float-container {
    position: fixed;
    bottom: calc(30px + var(--bottom-inset));
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    pointer-events: none;
    transform: translateY(calc(100% + 40px + var(--bottom-inset)));
    transition: transform 0.3s ease;
    z-index: 1000;
}

.float-container.show {
    transform: translateY(0);
}

.float-icon {
    bottom: 0;
    margin: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    width: 60px;
    border-radius: 15px;
    background-color: var(--btn-primary);
    pointer-events: auto;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);

    svg {
        fill: var(--btn-primary-text);
        position: absolute;
    }
}

#pause-icon {
    display: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1100;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.overlay-content {
    position: relative;
    width: calc(90vw - 60px);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-overlay);
    border-radius: 12px;
    padding: 30px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: opacity 0.2s ease;
}

.overlay-content h2 {
    margin: 0;
    user-select: none;
}

.overlay-content p {
    user-select: none;
}

#security-warning-content h2 {
    text-align: center;
}

.confirmation-btn-container {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    gap: 5px;
    user-select: none;
}

.confirmation-btn {
    padding: 10px;
    background-color: inherit;
    color: currentColor;
    border-radius: 20px;
    border: none;
}

.close-about {
    position: absolute;
    top: 15px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--border-color);
    user-select: none;
}

.about-content {
    text-align: center;
    max-height: calc(95vh - 60px);
    overflow-y: auto;
}

.about-logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.about-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    width: 80px;
    padding: 12px;
    border-radius: 15px;
    box-sizing: border-box;
    background-color: var(--logo-bg);

    svg {
        fill: var(--logo-color);
    }
}

.about-content p {
    margin: 0;
    font-size: 14px;
}

#module-name {
    padding-top: 5px;
    font-size: 28px;
    user-select: none;
}

#author {
    font-size: 14px;
    user-select: none;
}

.link {
    margin: 15px 0;
}

.link-icon {
    font-size: 17px;
    font-weight: bold;
    min-height: calc(1em + 15px);
    padding: 3px 10px;
    color: white;
    user-select: none;
    display: inline-flex;
    align-items: center;
    font-style: normal;
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 5px;
    transition: background-color 0.2s ease;

    svg {
        height: 17px;
        width: 17px;
        fill: white;
        padding-right: 5px;
    }
}

#telegram {
    background-color: #38A7ED;
}

#github {
    background-color: #606060;
}

#xda {
    background-color: #FF8002;
    color: #fff;
}

#sponsor {
    background-color: #E7D705;
}

.credit {
    display: flex;
    width: 100%;
    mask-image: linear-gradient(to right, black 0%, black calc(100% - 25px), transparent 100%);
    overflow-x: auto;
    grid-template-rows: 1fr;
}

.credit-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    grid-auto-flow: column;
    grid-auto-columns: 200px;
    gap: 15px;
}

.credit-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 15px;
    background-color: var(--bg-primary);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 20px;
    box-sizing: border-box;
    width: 200px;
    min-height: 150px;
    user-select: none;
}

.credit-box img {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    z-index: 1;
}

.credit-box h3,
.credit-box h4,
.credit-box p {
    text-align: left;
    margin: 0;
}

.credit-placeholder {
    flex-shrink: 0;
    width: 60px;
}

.box {
    width: 90vw;
    max-width: 800px;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 15px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    user-select: none;
}

.box h2 {
    margin-top: 5px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    user-select: none;
}

.outer-box {
    width: 90vw;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    user-select: none;
    overflow: hidden;
}

.inner-box {
    background-color: var(--bg-secondary);
    border: none;
    padding: 5px 15px;
    user-select: none;

    ul {
        padding: 0;
    }
}

.toggle-container {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    background-color: transparent;
    padding: 0;
    text-align: left;
}

#create-shortcut {
    display: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
    width: 40px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--btn-primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--btn-primary);
}

input:checked+.slider:before {
    transform: translateX(15px);
}

.slider.round {
    border-radius: 25px;
}

.slider.round:before {
    border-radius: 50%;
}

.control-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
    padding-right: 10px;

    svg {
        fill: var(--text-primary);
        height: 21px;
        width: 21px;
    }
}

.category-container {
    display: flex;
    position: relative;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.category-container input {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    outline-color: var(--btn-primary);
    color: var(--text-primary);
    background-color: var(--bg-input);
    width: calc(100% - 35px);
    height: 35px;
    padding-left: 10px;
}

.category-container button {
    display: flex;
    position: relative;
    border-radius: 8px;
    height: 35px;
    width: 35px;
    font-size: 25px;
    font-weight: bold;
    background-color: var(--btn-primary);
    border: none;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
}

.control-list {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.control-list.show {
    max-height: 60px;
}

.control-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    padding: 0;
    background-color: inherit;

    svg {
        fill: var(--text-primary);
        height: 24px;
        width: 24px;
    }
}

.back {
    margin-right: auto;
}

.loading {
    display: none;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.loading.show {
    display: flex;
}

.loading-circle {
    height: calc(100% - 15px);
    width: calc(100% - 15px);
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--btn-primary-text);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.checkbox-wrapper {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    padding: 7px;
    margin-left: auto;
    pointer-events: none;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.checkbox-wrapper.show {
    pointer-events: auto;
    opacity: 1;
    transform: scale(1);
}

[dir="rtl"] .checkbox-wrapper {
    margin-left: unset;
    margin-right: auto;
}

.checkbox {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
    border: 2px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 1s ease, transform 0.3s ease, background-color 0.2s ease;
}

.tick-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.3s ease;

    svg {
        fill: var(--btn-primary-text);
    }
}

.checkbox:checked + .custom-checkbox {
    border-color: var(--btn-primary);
    background-color: var(--btn-primary);
    transition: border-color 0.1s ease;
    animation: checked-bounce 0.3s ease-out;
}

.checkbox:not(:checked) + .custom-checkbox {
    animation: unchecked-bounce 0.3s ease-out;
}

.checkbox:checked + .custom-checkbox .tick-symbol {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

@keyframes checked-bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.8);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes unchecked-bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.8);
    }
    100% {
        transform: scale(1);
    }
}

.box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.box li {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.box li span {
    font-size: 14px;
    word-break: break-all;
    word-wrap: break-word;
    flex-grow: 1;
}

li:last-child {
    border-bottom: none;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--border-color);
}

.terminal {
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    position: fixed;
    width: 100vw;
    height: 100vh;
    padding-top: var(--top-inset);
    padding-bottom: var(--bottom-inset);
    background-color: var(--bg-primary);
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.5s ease;
    z-index: 1200;
}

.terminal.show {
    transform: translateY(0);
}

.terminal-header {
    flex-shrink: 0;
    display: flex;
    gap: 5px;
    align-items: center;
    height: 40px;
    width: 100%;
    font-size: 20px;
    padding: 5px 10px;
    user-select: none;
}

.back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    border-radius: 50%;

    svg {
        fill: var(--text-primary);
    }
}

.terminal-content {
    width: 100%;
    flex-grow: 1;
    padding: 0 15px;
    box-sizing: border-box;
}

.output-text {
    max-height: 100%;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-all;
}

.output-line {
    padding: 0;
    margin: 0;
}

.close-terminal {
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: calc(5% + var(--bottom-inset));
    right: 20px;
    height: 60px;
    width: 60px;
    border: none;
    border-radius: 15px;
    background-color: var(--btn-primary);
    transform: translateY(calc(100% + 50px + var(--bottom-inset)));
    transition: transform 0.3s ease;

    svg {
        fill: var(--btn-primary-text);
    }
}

.close-terminal.show {
    transform: translateY(0);
}

.prompt {
    position: fixed;
    bottom: 0;
    left: 10px;
    background-color: #4CAF50;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 15px;
    padding: 5px 10px;
    z-index: 1300;
    width: auto;
    max-width: calc(100% - 40px);
    transform: translateY(100%);
    transition: transform 0.2s ease;
    user-select: none;
}

.prompt.error {
    background-color: #f44336;
}

.footer {
    padding: 30px;
    padding-bottom: calc(var(--bottom-inset) + 30px);
    position: relative;
    text-align: center;
}

.ripple-element {
    position: relative;
    overflow: hidden;
}

.ripple-element.fixed-ripple {
    position: fixed;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    opacity: 1;
    animation: ripple-animation ease-out forwards;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.2);
}

.ripple.end {
    opacity: 0;
}

@keyframes ripple-animation {
    to {
        transform: scale(3);
    }
}