:root {
    --default-primary-color: #a0c2ea;
    --default-text-color: #5b6d98;
    --default-secondary-color: #eaeef5;
    --default-shadow-color: #7594db4d;

    --primary-color: #a0c2ea;
    --text-color: #5b6d98;
    --secondary-color: #eaeef5;
    --shadow-color: #7594db4d;

    --red-color: #E38888;
    --main-height: 85svh;
}

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
    color: var(--text-color);
    font-weight: 400;
    font-family: "Lexend", Helvetica, Arial, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.selectable {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

body {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    background-color: var(--secondary-color);
}

.main {
    width: 100%;
    height: var(--main-height);
    background-color: var(--primary-color);
    border-radius: 0px 0px 50px 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-color) 0px 50px 100px -20px, #0000004d 0px 30px 60px -30px;
}

.settings, .stations {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 36px;
    cursor: pointer;
}

.stations {
    left: 30px;
    right: auto;
    z-index: 2;
}

button:focus, input:focus, select:focus, textarea:focus {
    outline: 1px solid var(--text-color);
}

.reset-stations-button {
    position: relative;
    display: block;
}

input[type="color"] {
    border: none;
    border-radius: 0px;
    padding: 0px;
    background-color: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--text-color);
    border-radius: 50px;
    cursor: pointer;
}

.pickr button {
    border: 2px solid var(--text-color) !important;
    border-radius: 50px !important;
    padding: 0px !important;
    cursor: pointer;
    inline-size: 50px !important;
    block-size: 27px !important;
    margin-right: 2px;
    transition: none !important;
}

.pickr button::before {
    border-radius: 50px !important;
}

.pickr button::after {
    border-radius: 50px !important;
    transition: none !important;
}

.pickr .pcr-button:focus {
    box-shadow: none !important;
    outline: 1px solid var(--text-color) !important;
}

.modal-background {
    width: 100%;
    height: 100svh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #00000080;
    z-index: 5;
    display: grid;
    place-items: center;
}

.modal-content {
    z-index: 10;
    position: relative;
    width: 30%;
    height: 90%;
    background-color: var(--primary-color);
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 32px;
    cursor: pointer;
    z-index: 15;
    color: var(--text-color);
}

.modal-title {
    font-size: 36px;
    text-align: left;
    margin-top: 30px;
    margin-left: 30px;
}

.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 30px 30px;
}

.setting-title, .stations-title {
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.stations-title {
    text-align: right;
    margin-right: 25px;
}

.setting-item {
    width: 80%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0px;
}

.setting-title::after {
    content: "";
    display: block;
    width: 100%;
    outline: 1px solid var(--text-color);
    margin-top: 2px;
}

.reset-button {
    display: block;
    position: relative;
    background-color: var(--red-color);
    text-align: center;
    border: 2px solid var(--text-color);
    border-radius: 20px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 0px;
    overflow:hidden;
    width: 70px; 
    height: 45px;
}

.reset-button::after {
    content: "Reset";
    color: #ffffff;
    position: absolute;
    justify-self: center;
    align-self: center;
    padding-top: 10px;
    text-align: center;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    border-radius: inherit;
    background-color: #ffffff00;
    transition: background-color 0.3s ease-in-out;
}

.reset-button:hover::after {
    background-color: #ffffff4d;
}

.setting-section {
    width: 100%;
    display: grid;
    place-items: center;
    margin: 20px 30px 30px;
}

.item-button, .period-item, .add-period-button, .add-event-button, .event-item {
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    justify-content: space-between;
    padding: 15px 10px;
    font-size: 16px;
    width: 80%;
    background-color: var(--secondary-color);
    border: 2px solid var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    margin-bottom: 10px;
}

.item-name {
    text-align: left;
    font-size: 16px;
    border: none;
    background-color: transparent;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 10px;
    border-radius: 20px;
}

.item-name:focus {
    outline: 2px solid var(--text-color);
}

.inner-item-button-group {
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    justify-content: space-between;
    margin-left: 10px;
}

.inner-item-button {
    font-size: 20px;
    cursor: pointer;
    margin-left: 3px;
}

.remove-item {
    color: var(--red-color);
}

.plus-button {
    cursor: pointer;
    font-size: 20px;
    background-color: var(--secondary-color);
    border: 2px solid var(--text-color);
    border-radius: 20px;
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 10px 20px;
    margin-right: 40px;
}

.bottom-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.settings-modal, .stations-modal, .add-station-modal, .create-bell-schedule-modal, .edit-events-modal, .confirm-reset-modal {
    display: none;
}

.stations-body {
    padding-top: 5px;
}

.transparent-modal-background {
    width: 100%;
    height: 100svh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: transparent;
    z-index: 5;
    display: grid;
    place-items: center;
}

.add-item-modal-content {
    z-index: 15;
    position: relative;
    width: 40%;
    height: 50%;
    background-color: var(--primary-color);
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.add-station-item, .add-bell-schedule-item {
    width: 70%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0px;
    font-size: 24px;
}

.add-item-body {
    overflow-y: auto;
    margin-top: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.add-item-name {
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    font-size: 16px;
    border: none;
    background-color: var(--secondary-color);
    width: 40%;
    height: 40px;
    border-radius: 20px;
    border: 2px solid var(--text-color);
}

.custom-dropdown {
    position: relative;
    width: 40%;
    font-size: 16px;
}

.dropdown-selected {
    display: grid;
    place-items: center;
    text-align: center;
    background-color: var(--secondary-color);
    width: 100%;
    height: 40px;
    border-radius: 20px;
    border: 2px solid var(--text-color);
    cursor: pointer;
    box-shadow: var(--shadow-color) 0px 4px 6px -2px, #00000033 0px 2px 4px -2px;
    user-select: none;
    position: relative;
}

.dropdown-selected.open {
    outline: 1px solid var(--text-color);
}

.dropdown-options {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    padding-top: 19px;
    background-color: var(--secondary-color);
    border-radius: 0px 0px 10px 10px;
    border: 2px solid var(--text-color);
    box-shadow: var(--shadow-color) 0px 4px 6px -2px, #00000033 0px 2px 4px -2px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    max-height: 165px;
}

.dropdown-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-option:hover {
    background-color: var(--primary-color);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--text-color);
    border-radius: 50px;
}

.dropdown-options::-webkit-scrollbar {
    width: 15px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    border: 4px solid var(--secondary-color);
}

.dropdown-options input[type="checkbox"] {
    display: none;
}

.dropdown-options label {
    display: block;
    background-color: var(--secondary-color);
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-options label:hover {
    background-color: var(--primary-color);
}

.dropdown-options input[type="checkbox"]:checked + label {
    background-color: var(--text-color);
    color: var(--secondary-color);
}

.dropdown-option.selected {
    background-color: var(--text-color);
    color: var(--secondary-color);
}

.fancy-button {
    display: block;
    position: relative;
    text-align: center;
    background-color: var(--secondary-color);
    border: 2px solid var(--text-color);
    border-radius: 20px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 0px;
    overflow: hidden;
    height: 45px;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.fancy-button:hover {
    background-color: var(--text-color);
    color: var(--secondary-color);
}

.add-item-button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
    margin-top: 20px;
}

.add-station-edit-button, .add-bell-schedule-edit-button {
    display: none;
}

.item-button.selected {
    background-color: var(--text-color);
    color: var(--secondary-color);
}

.item-button.selected .edit-item {
    color: var(--secondary-color);
}

.item-button.selected p {
    color: var(--secondary-color);
}

.item-button:not(.selected):hover {
    background-color: var(--primary-color);
}

.secondary {
    width: 100%;
    display: flex;
    justify-content: center;
    grid-gap: 50px;
    padding: 20px 0px;
    position: absolute;
    top: calc(var(--main-height) + 50px);
}

.secondary.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, calc(100svh - var(--main-height) - 100px));
}

.main-module {
    height: 80%;
    aspect-ratio: 1;
    border-radius: 20%;
    text-align: center;
    text-decoration: none;
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-color) 0px 50px 100px -20px, #0000004d 0px 30px 60px -30px;
    font-size: calc(.16 * var(--main-height));
    overflow: hidden;
}

.module {
    background-color: var(--secondary-color);
    border: 2px solid var(--text-color);
    height: calc(100svh - var(--main-height) - 100px);
    aspect-ratio: 1;
    border-radius: 20%;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-color) 0px 50px 100px -20px, #0000004d 0px 30px 60px -30px;
    font-size: calc(.2 * (100svh - var(--main-height) - 100px));
}

.error-popup {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--red-color);
    color: #ffffff;
    border-radius: 30px;
    box-shadow: var(--shadow-color) 0px 10px 20px -10px, #0000004d 0px 6px 12px -6px;
    font-size: 16px;
    z-index: 200;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0px;
    animation: slideInOut 3s ease-in-out forwards;
}

@keyframes slideInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    10%, 90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.close-popup {
    position: absolute;
    font-size: 18px;
    margin-left: 10px;
    cursor: pointer;
    color: #ffffff;
}

.error-popup p {
    color: #ffffff;
    padding: 15px 30px 15px 40px;
}

.add-bell-schedule-modal-content, .edit-events-modal-content {
    height: 90%;
}

.bell-schedule-body {
    padding-top: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-height: 30svh;
}

.add-item-key-centered {
    text-align: center;
    width: 100%;
}

.add-bell-schedule-periods, .events {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.period-name {
    width: 25%;
}

.period-item, .event-item {
    cursor: default;
}

.period-time, .event-date {
    border: 2px solid var(--text-color);
    cursor: text;
    border-radius: 20px;
    padding: 5px 10px;
    background-color: var(--secondary-color);
}

.period-time:focus, .event-date:focus {
    outline: 1px solid var(--text-color);
}

.delete-period-button, .delete-event-button {
    font-size: 30px;
    cursor: pointer;
    margin-left: 10px;
}

.add-period-button, .add-event-button {
    justify-content: center;
    font-size: 30px;
    padding: 20px 10px;
}

.add-bell-schedule-button-group, .edit-events-button-group {
    margin-bottom: 20px;
}

.edit-events-modal-content {
    width: 65%;
}

.events-bottom-buttons {
    flex-direction: column;
}

.edit-events-button,.reset-events-button {
    width: 70%;
}

.edit-events-body {
    justify-content: space-between;
}

.events {
    height: 100%;
    padding: 1px 0px;
}

.event-text-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-schedule-dropdown, .event-name {
    width: 100%;
}

.save-weather-button {
    margin-right: 40px;
}

.weather-input {
    width: 60%;
    font-size: 16px;
    border: 2px solid var(--text-color);
    border-radius: 20px;
    padding: 10px;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.reset-all-data-button {
    width: 140px; 
}

.reset-all-data-button::after {
    content: "Reset All Data";
}

.confirm-reset-button {
    width: 180px; 
}

.confirm-reset-button::after {
    content: "Yes, Reset All Data";
}

.confirm-reset-body {
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 50px;
    overflow-y: scroll;
    overflow-x: hidden;
}

.confirm-reset-button-group {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
}

.confirm-reset-modal-content {
    width: 40%;
    height: max-content;
}

.confirm-reset-title {
    margin-right: 80px;
}