
* {
    --tint-color: #315a78;
    --text-color: #3d3d3d;
    --background-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --border-radius: 8px;

    background-repeat: no-repeat;
    background-position: center;

    outline: none;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    width: 100vw;
    height: 100vh;
    margin: 0;

    gap: 2rem;

    overflow: hidden;

    background-color: aliceblue;
}

svg {
    width: 100%;
    height: 100%;
}

path {
    fill: var(--tint-color);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background-color: var(--tint-color);
    background-image: -webkit-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
}

::-webkit-scrollbar-track {
    background-color: var(--background-color);
    border-radius: 8px;
}

.none-selection {
    user-select: none;
}

.normal-color {
    background-color: var(--background-color);
    color: var(--tint-color);
    caret-color: var(--tint-color);
}

.revert-color {
    background-color: var(--tint-color);
    color: var(--background-color);
    caret-color: var(--background-color);
}

.clickable {
    cursor: pointer;
}

.initially-hidden {
    display: none;
    opacity: 0.0;
}

.with-dashed-border {
    border: 0.25rem dashed var(--tint-color);
    border-radius: var(--border-radius);
    margin-top: -0.25rem;
}

.hide-scrollbar {
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

.hide-scrollbar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#background-module {
    position: fixed;
    top: 0;
    left: 0;

    width: 100vw;
    height: 100vh;

    z-index: -9;
}

#search-engine-module {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    width: 50rem;
    max-width: 70vw;

    margin-top: 10vh;

    transition: transform 0.5s;
}

#search-engine-swiper {
    position: relative;
    width: 100%;
    height: 100%;
}

#search-engine-list-container {
    position: relative;
    width: 25%;
    height: 100%;
}

#search-engine-list-controller-prev, #search-engine-list-controller-next {
    position: absolute;
    top: 80%;

    width: 2rem;
    height: 2rem;

    outline: none;
    text-decoration: none;
    border: 0;

    color: var(--tint-color);
    background: transparent;

    font-size: 1.5rem;

    transition: transform 0.8s, opacity 0.8s;
}

#search-engine-list-controller-prev::after, #search-engine-list-controller-next::after {
    display: none; /* hide Swiper's original handlers */
}

#search-engine-list-controller-prev {
    left: 37.5%;
    /* transform: translateX(-200%); */
    transform: translateX(0);
    opacity: 0.0;
}

#search-engine-list-controller-next {
    right: 37.5%;
    /* transform: translateX(200%); */
    transform: translateX(0);
    opacity: 0.0;
}

#search-editor {
    display: flex;
}

#search-bar-container {
    position: relative; /* enable clear button to position relatively */

    display: flex;
    flex-direction: row;
    
    width: 100%;
    height: 3.0rem;
}

#search-bar {
    width: 85%;
    height: 2rem;

    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border: 0.25rem solid var(--tint-color);
    /* the right padding is intended for clear button */
    padding: 0.25rem 2.5rem 0.25rem 1rem;

    font-size: 1.5rem;
    text-align: left;
    letter-spacing: 0.075rem;
    margin-right: -0.075rem; /* remove the whitespace on the right */

    overflow: scroll;
    white-space: nowrap;
}

#search-bar-clear-button {
    position: absolute;
    right: calc(15% + 0.5rem);
    top: 0.5rem;

    width: 2rem;
    height: 2rem;

    text-align: center;

    opacity: 0.6;
    transition: opacity 0.3s;
}

#search-bar-clear-button:hover {
    opacity: 1.0;
}

#search-button {
    width: 15%;
    height: 2.5rem;

    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border: 0.25rem solid var(--tint-color);

    text-align: center;
}

#search-button > span {
    font-size: 1.5rem;
    font-weight: 500;

    line-height: 2.5rem;
    letter-spacing: 0.5rem;
    margin-right: -0.5rem; /* remove the whitespace at end */
}

#websites-module {
    width: 50rem;
    max-width: 70vw;
    height: 100%;

    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;

    transition: height 0.5s;
}

#websites-grid {
    position: relative;
    width: 100%;
    min-height: 100%;
}

#websites-appendage-trigger {
    position: absolute;
    bottom: 0;

    width: 50rem;
    max-width: 70vw;
    height: 2rem;

    z-index: 9;
}

#websites-appendage-trigger hr {
    position: absolute;
    top: 0;

    width: 45%;
    
    border: none;
    border-top: 0.2rem dashed var(--tint-color);

    opacity: 0.0;

    transition: opacity 0.2s;
}

#websites-classification-appendage {
    position: relative;
    top: 0;
    left: 50%;
    transform: translate(-50%, -0.2rem);

    width: 1rem;
    height: 1rem;

    border-radius: 50%;
    border: dashed var(--tint-color);
    padding: 0.2rem;

    line-height: 1rem;

    opacity: 0.0;

    transition: opacity 0.2s;

    z-index: 9;
}

#websites-drag-container {
    position: fixed;
    top: 0;
    left: 0;

    z-index: 1000;
}

.websites-row {
    position: absolute;

    width: calc(100% - 1rem);

    margin: 0.5rem;

    z-index: 1;
}

.websites-row.muuri-item-releasing {
    z-index: 2;
}

.websites-row.muuri-item-dragging {
    z-index: 3;
    cursor: move;
}

.websites-row-container {
    display: flex;
    flex-direction: row;

    position: relative;
    width: 100%;
}

.websites-row-header {
    position: relative;
}

.websites-row-content-container {
    position: relative;
    width: 100%;
}

.websites-row-content {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.websites-row-appendage {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translate(-50%, -50%);

    width: 1rem;
    height: 1rem;

    border-radius: 50%;
    border: dashed var(--tint-color);
    padding: 0.2rem;

    line-height: 1rem;

    opacity: 0.0;

    transition: opacity 0.2s;
}

.websites-item {
    display: block;

    position: absolute;
    width: fit-content;
    height: fit-content;

    z-index: 1;
}

.websites-row-header, .websites-item {
    margin: 0.5rem;
}

.websites-item.muuri-item-releasing {
    z-index: 998;
}

.websites-item.muuri-item-dragging {
    z-index: 999;
    cursor: move;
}

.websites-item.muuri-item-hidden {
    z-index: 0;
}

.websites-item-content {
    position: relative;
    width: 8.5rem;
    height: 2rem;

    padding: 0.25rem 0.5rem;

    /* using FitText instead */
    /* font-size: 1.25rem; */
    line-height: 2rem;
    text-align: center;

    border-radius: var(--border-radius);

    overflow: hidden;
    white-space: nowrap;
}

.websites-item-attachment {
    position: absolute;
    width: 1rem;
    height: 1rem;

    border-radius: var(--border-radius);
    padding: 0.25rem;
    line-height: 1rem;

    opacity: 0.0;

    transition: opacity 0.3s;
}

.websites-item-attachment path {
    fill: var(--background-color);
}

.websites-item-remove {
    top: -0.5rem;
    right: -0.5rem;
}

.websites-item-edit {
    bottom: -0.5rem;
    right: -0.5rem;
}

.muuri-item-placeholder {
    border: 0.25rem dashed var(--tint-color);
    border-radius: var(--border-radius);
    margin-top: -0.25rem;
    margin-left: -0.25rem;

    opacity: 0.3;
}

#side-panel {
    position: absolute;
    top: 0;
    right: 0;

    width: 20vw;
    height: 100vh;

    background-color: var(--background-color);
    box-shadow: var(--shadow-color) 0px 0px 12px;

    overflow-x: hidden;
    overflow-y: auto;

    user-select: none;

    z-index: 9;
}

#side-panel.animate__animated {
    --animate-duration: 1s;
}

#setting-button {
    position: absolute;
    right: 3vw;
    bottom: 3vh;

    width: 2.5rem;
    height: 2.5rem;

    filter: drop-shadow(0px 4px 12px var(--shadow-color));

    z-index: 7;
}

#context-menu {
    position: absolute;
    top: 0;
    height: 0;

    width: 10rem;
    height: fit-content;

    padding: 8px;
    border-radius: var(--border-radius);
    border: 0.25rem dashed var(--tint-color);
    box-shadow: var(--shadow-color) 0px 4px 12px;

    font-size: 1rem;
    font-weight: 500;
    user-select: none;

    z-index: 1001;
}

#context-menu > div {
    border-radius: var(--border-radius);
    padding-left: 1rem;
}

#context-menu > div:hover {
    background-color: var(--tint-color);
    color: var(--background-color);
}

#side-panel-header {
    margin: 5%;
    margin-left: 5%;

    font-size: 2rem;
    font-weight: 500;

    color: var(--text-color);
}

.list-section-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: 100%;
    margin-bottom: 1rem;

    color: var(--text-color);
}

.list-section-container > div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    width: 80%;

    text-align: left;
}

.list-section {
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-color) 0px 0px 12px;
    border-radius: var(--border-radius);

    margin: 0.5rem 0;
}

.list-section-header, .list-section-footer {
    font-size: 0.8rem;
    opacity: 0.8;
}
