@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(241, 128, 60, 0.25);
    }
    70% {
        box-shadow: 0 0 0 1.5rem rgba(241, 128, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(241, 128, 60, 0);
    }
}

/* Fallback Asian Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+HK&family=Noto+Sans+JP&family=Noto+Sans+KR&family=Noto+Sans+SC&family=Noto+Sans+TC&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;

    --background-color: rgba(246, 246, 246, 1);
    --background-gradient: linear-gradient(90deg, rgba(246, 246, 246, 1), rgba(226, 235, 240, 1), rgba(215, 221, 230, 1), rgba(230, 238, 243, 1));
    --background-nav-color: rgba(246, 246, 246, 0.7);
    --background-text-color: rgba(18, 55, 64, 1);
    --surface-light-color: rgba(84, 154, 171, 0.16);
    --surface-color: rgba(84, 154, 171, 0.3);
    --surface-text-color: rgba(18, 55, 64, 0.85);
    --primary-color: rgba(241, 128, 45, 0.9);
    --primary-text-color: rgba(255, 238, 228, 1);
    --error-color: rgba(240, 40, 30, 0.3);
    --error-text-color: rgba(240, 40, 30, 1);

    --cubic-ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

:lang(zh-TW):not(.material-symbols-outlined) {
    font-family: "Poppins", "Noto Sans TC", sans-serif;
}

:lang(zh-CN):not(.material-symbols-outlined) {
    font-family: "Poppins", "Noto Sans SC", sans-serif;
}

:lang(zh-HK):not(.material-symbols-outlined) {
    font-family: "Poppins", "Noto Sans HK", sans-serif;
}

:lang(ja):not(.material-symbols-outlined) {
    font-family: "Poppins", "Noto Sans JP", sans-serif;
}

:lang(ko):not(.material-symbols-outlined) {
    font-family: "Poppins", "Noto Sans KR", sans-serif;
}

.dark-mode, .dark-mode * {
    --background-color: rgba(16, 16, 24, 1);
    --background-gradient: linear-gradient(90deg, rgba(16, 16, 24, 1), rgba(21, 21, 40, 1), rgba(25, 25, 49, 1), rgba(21, 22, 31, 1));
    --background-nav-color: rgba(16, 16, 24, 0.7);
    --background-text-color: rgb(123, 158, 255);
    --surface-light-color: rgba(75, 122, 252, 0.13);
    --surface-color: rgba(75, 122, 252, 0.2);
    --surface-text-color: rgba(153, 195, 255, 0.9);
    --primary-color: rgba(239, 127, 59, 0.9);
    --primary-text-color: rgba(255, 238, 228, 1);
    --error-color: rgba(240, 40, 30, 0.2);
    --error-text-color: rgba(240, 40, 30, 1);
}

[contenteditable] {
    outline: none;
}

.cloneable {
    display: none !important;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--background-text-color);
    background-color: var(--background-color);
    background-image: var(--background-gradient);
    background-size: 140% 140%;
}

h1,
h2 {
    margin: 0;
    padding: 1.3rem 0;
    font-size: 1.6rem;
}

.surface {
    background: var(--surface-color);
    color: var(--surface-text-color);
}

.primary {
    background: var(--primary-color);
    color: var(--primary-text-color);
}

a {
    text-decoration: none;
    font-weight: 600;
    color: inherit;
}

a:hover {
    text-decoration: underline;
}

button {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: var(--surface-light-color);
    color: var(--surface-text-color);
    transition: 150ms var(--cubic-ease-out);
}

button.primary {
    animation: pulse 1.5s linear infinite;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

header {
    display: flex;
    justify-content: center;
    width: 100%;
    position: fixed;
    top: 0;
    background-color: var(--background-nav-color);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.header-content-wrapper {
    position: relative;
}

.header-content-wrapper > button {
    position: absolute;
    top: 50%;
    left: -1rem;
    transform: translate(-100%, -50%);
}

.header-content-wrapper > button:last-child {
    right: -1rem;
    left: auto;
    transform: translate(100%, -50%);
}

.header-content-wrapper > button:hover {
    cursor: pointer;
    background-color: var(--surface-color);
}

footer {
    text-align: center;
    padding: 2.1rem;
    height: 8rem;
    font-size: 1.2rem;
}

#dark-mode-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    padding-top: 0.5rem;
}

#dark-mode-toggle:hover {
    cursor: pointer;
}

#dark-mode-toggle::before {
    content: 'Switch to dark';
}

.dark-mode #dark-mode-toggle::before {
    content: 'Switch to light';
}

#dark-mode-toggle > span::after {
    content: 'dark_mode';
}

.dark-mode #dark-mode-toggle > span::after {
    content: 'light_mode';
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--primary-text-color);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 250ms var(--cubic-ease-out);
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fab.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.fab > span {
    font-size: 1.5rem;
}
