:root {
    --bg-color: #ccc;
    --fg-color: #000;
    --accent-color: #06f;
    --accent-text-color: #fff;
    --list-bg-color: #eee;
    --list-title-color: #000;
    --faded-text-color: #444;
    --lesson-number-bg: #fff;
    --lesson-number-text: #222;
    --popup-bg-color: #fff;
    --input-bg-color: #eee;
    --separator-color: #ddd;
    --icon-list-color: #ccc
}

:root,
body.dark-mode {
    --icon-primary-color: #fff
}

body.dark-mode {
    --bg-color: #242424;
    --fg-color: #fff;
    --list-bg-color: #2e2e2e;
    --list-title-color: #fff;
    --faded-text-color: #aaa;
    --lesson-number-bg: #444;
    --lesson-number-text: #fff;
    --popup-bg-color: #383838;
    --input-bg-color: #444;
    --separator-color: #444;
    --link-color: #7bafff;
    --icon-list-color: #555
}

* {
    border: none;
    outline: none;
    stroke: none;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: Rubik, sans-serif
}

body {
    scrollbar-width: 0;
    -ms-overflow-style: none;
    background-color: var(--bg-color);
    color: var(--fg-color)
}

body::-webkit-scrollbar {
    display: none
}

header {
    background-color: var(--accent-color);
    color: var(--accent-text-color);
    font-size: 1.5rem;
    font-weight: 700;
    user-select: none;
    height: 3.5rem;
    flex-direction: row;
    position: sticky;
    top: 0;
    overflow: hidden;
    z-index: 11
}

header,
main {
    padding: 1rem;
    display: flex;
    align-items: center
}

main {
    flex-direction: column;
    justify-content: center;
    gap: 1rem
}

.day-list-item-title,
.fx-1,
.fx-2 {
    transition: all .1s;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none
}

.fx-1:active {
    transform: scale(.98);
    filter: brightness(.95)
}

.fx-2:active {
    transform: scale(.9);
    filter: brightness(.8)
}

#header-title {
    width: 100%;
    white-space: nowrap;
    font-size: 2rem
}

.day-list-item,
.friends-list-item,
.list-item {
    background-color: var(--list-bg-color);
    width: 100%;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
    padding: .5rem .5rem .5rem 1rem;
    overflow: hidden;
    white-space: nowrap
}

.day-list-item-title,
.friends-list-item-title,
.list-item-title {
    color: var(--list-title-color);
    user-select: none;
    font-size: 1.5rem;
    font-weight: 500
}

.friends-list-item-icon,
.list-item-icon {
    color: var(--icon-list-color)
}

.day-list-item-icon,
.friends-list-item-icon,
.list-item-icon {
    width: auto;
    font-size: 2rem;
    position: sticky;
    right: 0;
    user-select: none
}

.day-list-item-icon {
    color: var(--faded-text-color);
    background-color: transparent
}

.header-button {
    width: auto;
    position: sticky;
    right: 0;
    background-color: transparent;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center
}

.header-button span {
    color: var(--icon-primary-color);
    font-size: 2rem
}

.material-symbols-rounded {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    font-variation-settings:
        'FILL' 1,
        'wght' 500,
        'GRAD' 0,
        'opsz' 24
}

#friends-list {
    gap: 1rem
}

#friends-list,
.schedule {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%
}

.schedule {
    background-color: var(--list-bg-color);
    border-radius: 1rem;
    padding: .5rem;
    overflow: hidden;
    white-space: nowrap;
    align-items: flex-start;
}

.schedule-lesson {
    display: flex;
    grid-template-columns: auto 1fr;
    gap: .5rem;
    width: 100%;
    padding: .5rem;
    align-items: center
}

.schedule-lesson-number,
.schedule-lesson-number-active {
    font-size: 1.2rem;
    border-radius: .6rem;
    padding: 1rem;
    height: 2.5rem;
    aspect-ratio: 1/1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center
}

.schedule-lesson-number {
    font-weight: 700;
    color: var(--lesson-number-text);
    background-color: var(--lesson-number-bg)
}

.schedule-lesson-number-active {
    font-weight: bolder;
    color: var(--accent-text-color);
    background-color: var(--accent-color)
}

.schedule-lesson-details {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-around;
    gap: 0.1rem;
    flex-grow: 1;
    min-width: 0
}

.schedule-lesson-name,
.schedule-lesson-time {
    line-height: .9;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--list-title-color)
}

.schedule-lesson-time {
    color: var(--faded-text-color)
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #000000b8, #00000050);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    visibility: visible;
}

.popup {
    background: var(--popup-bg-color);
    border-radius: 2rem;
    width: 20rem;
    max-width: 90%;
    text-align: center;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
    padding: 0 1rem 1rem;
}

.hidden {
    display: none
}

.popup-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem
}

.popup-buttons.vertical {
    flex-direction: column
}

.popup-buttons button {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--list-title-color);
    font-size: 1rem
}

#popup-content-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch
}

#schedule-name,
#schedule-url {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--list-title-color);
    font-size: 1rem
}

.popup-message {
    font-size: 1rem;
    color: var(--faded-text-color)
}

.popup-message a {
    color: var(--accent-color)
}

.popup-header {
    margin-left: -1rem;
    margin-right: -1rem;
    padding: .8rem;
    background-color: var(--accent-color);
    border-top-left-radius: 2rem;
    border-top-right-radius: 2rem;
    color: var(--accent-text-color);
    font-size: 1.5rem;
}

@keyframes loading-animation {
    0% {
        left: -100%
    }

    to {
        left: 100%
    }
}

.loading-bar-container {
    width: 100%;
    height: 5px;
    background-color: var(--input-bg-color);
    border-radius: 2.5px;
    overflow: hidden;
    position: relative
}

.loading-bar {
    width: 50%;
    height: 100%;
    border-radius: 999px;
    background-color: var(--accent-color);
    position: absolute;
    animation: loading-animation 2s linear infinite
}

.schedule h2 {
    margin-bottom: .5rem;
    color: var(--accent-color)
}

.theme-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--list-bg-color);
    width: 100%;
    height: 3rem;
    border-radius: 1rem;
    padding: .5rem
}

.theme-switch-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--list-title-color)
}

.theme-switch {
    position: absolute;
    right: 2rem;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.slider {
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--icon-list-color);
    border-radius: 34px
}

.slider,
.slider:before {
    position: absolute;
    transition: .4s
}

.slider:before {
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--list-bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center
}

input:checked+.slider {
    background-color: var(--accent-color)
}

input:checked+.slider:before {
    transform: translateX(26px);
    content: "";
    background-color: var(--accent-text-color)
}

input[type="text"] {
    transition: box-shadow .3s ease;
}

input[type="text"]:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 80%, transparent);
}

.disabled {
    opacity: .6 !important;
    pointer-events: none !important
}

#generate-qr-btn,
#my-schedule-name,
#my-schedule-url,
#save-my-schedule-btn {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--popup-bg-color);
    color: var(--list-title-color);
    font-size: 1rem
}

#generate-qr-btn,
#save-my-schedule-btn,
.buttons-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .5rem
}

.buttons-container {
    width: 100%
}

.button-primary {
    background-color: var(--accent-color) !important;
    color: #fff !important
}

.qr-image {
    image-rendering: pixelated;
    height: auto;
    width: 90%;
    aspect-ratio: 1/1
}

.scanner-popup>#reader>video {
    border-radius: 2rem
}

#scan-qr-btn {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--list-title-color);
    font-size: 1rem;
    display: flex;
    gap: .5rem;
    flex-direction: row;
    align-items: center;
    justify-content: center
}

.schedule-lesson-name {
    overflow-wrap: break-word
}

.schedule-lesson-number {
    flex-shrink: 0
}

.schedule-lesson-empty {
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0, .4, 0, 1), opacity 0.4s ease-out;
}

#popup-tutorial .popup {
    max-width: 90%;
    width: 400px
}

.tutorial-buttons-container {
    display: flex;
    gap: 1rem;
    width: 100%
}

.tutorial-buttons-container button {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--list-title-color);
    font-size: 1rem
}

.tutorial-scroll-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 1.5rem;
    background-color: var(--list-bg-color);
    color: var(--list-title-color);
    line-height: 1.4;
    font-size: .9rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-height: 24vh;

    &::-webkit-scrollbar {
        display: none
    }
}

#about-roma-scroll-content a,
.tutorial-scroll-content-area a {
    color: var(--accent-color);
    text-decoration: underline
}

a {
    color: var(--accent-color);
}

#popup-about-roma .popup {
    max-width: 90%;
    width: 400px
}

.notice-text {
    text-align: center;
    color: var(--faded-text-color);
    padding: 0.5rem 0px;
    display: flex;
    gap: 0.5rem;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    user-select: none;
}


.schedule-lesson-friends {
    font-weight: 600;
    color: var(--faded-text-color);
    font-size: 1.7rem;
    border-radius: .6rem;
    height: 2.5rem;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    font-variation-settings:
        'FILL' 0
}

#share-link-input {
    width: 100%;
    padding: .5rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--faded-text-color);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

#copy-share-link-btn {

    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--list-title-color);
    background-color: transparent;
    height: 100%;
    aspect-ratio: 1 / 1;
    /* width: 30px; */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    text-shadow: var(--input-bg-color) 0px 0px;
}

#copy-share-link-btn>span {
    font-variation-settings:
        'FILL' 0
}

#qr-url-wrapper {

    position: relative;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border-radius: 1rem;
}

.day-container {
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 1rem;
    align-items: flex-start;
}



.schedule-day {
    background-color: var(--list-bg-color);
    border-radius: 1rem;
    padding: .5rem;
    overflow: hidden;
    white-space: nowrap;
    align-items: flex-start;
    /* Zeer belangrijk: Zorgt dat elk rooster de volledige breedte inneemt */
    flex: 0 0 100%;
    /* Zorgt ervoor dat de scroll stopt bij elk rooster */
    scroll-snap-align: start;
}



.main-button {
    background-color: var(--list-bg-color);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
    padding: .5rem;
    overflow: hidden;
    white-space: nowrap;
    position: absolute;
    right: 1rem;
    bottom: 1rem;
}

.main-button-icon {
    font-size: 2.5rem;
    color: var(--accent-text-color);
    font-weight: 600;
}

#sortable-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* padding: 0.5rem; */
    max-height: 60vh;
    overflow-y: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: 60vh;
}

.sortable-item {
    width: 100%;
    padding: .5rem 1rem;
    border-radius: 1rem;
    background-color: var(--input-bg-color);
    color: var(--list-title-color);
    font-size: 1rem;
    display: flex;
    transition: transform 0.2s ease;
    align-items: center;
    justify-content: space-between;
}

.sortable-item .drag-icon {
    color: var(--faded-text-color);
    font-size: 22px;
}

/* Tijdens drag */
.sortable-item.dragging {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.03);
    transition: none;
    animation: dragLift 0.15s ease forwards;
}

/* Plaatshouder */
.sortable-placeholder {
    border: 2px dashed var(--faded-text-color);
    border-radius: 1rem;
    background: transparent;
}

/* Drop animatie */
.sortable-item.drop {
    animation: dropItem 0.2s ease forwards;
}

/* 🔽 Keyframes */
@keyframes dragLift {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

@keyframes dropItem {
    0% {
        transform: scale(1.05);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.inter-lesson-bar {
    background-color: var(--accent-color);
    border-radius: 999px;
    height: 5px;
    width: 25%;
    margin: -3px auto;
    display: block;
}