:root {
    --body-background-color: black;
    --font: sans-serif;
    --text-color: white;
    --header-background-color: rgb(22, 22, 22);
    --accent-color: #e07000;
}

@media (prefers-color-scheme: light) {
    :root {
        --body-background-color: rgb(255, 255, 255);
        --font: sans-serif;
        --text-color: black;
        --header-background-color: rgb(240, 240, 240);
        --accent-color: #e07000;
    }
}

* {
    padding: 0;
    margin: 0;
}

html,
body {
    height: 100vh;
}

body {
    background-color: var(--body-background-color);
    font-family: var(--font);
    font-size: 16px;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

header {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 40px;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.766);
    padding: 5px;
    background-color: var(--header-background-color);
    z-index: 3;
}

main {
    flex: 1;
}

.settings {
    position: absolute;
    right: 10px;
}

.settings button {
    background-color: var(--header-background-color);
    color: var(--text-color);
    border: none;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.settings button:hover {
    cursor: pointer;
    transform: rotate(-30deg);
}

.header-title {
    font-size: 25px;
    font-weight: 600;
    padding-left: 10px;
}

.aktuelle-settings {
    flex: 1;
    display: flex;
    justify-content: center;
    flex-direction: row;
    gap: 10px;
}

.camera-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 50px;
    margin-top: 20px;
}

.start-camera-button {
    opacity: 1;
    position: absolute;
    background-color: var(--accent-color);
    color: white;
    font-size: 17px;
    padding: 10px 25px;
    border: none;
    border-radius: 20px;
    z-index: 3;
    transition: background-color 0.4s ease, opacity 0.5s ease;
}

.start-camera-button:hover {
    cursor: pointer;
    background-color: color-mix(in srgb, var(--accent-color) 90%, black);
}

.start-camera-button.hidden {
    opacity: 0;
}

#liveVideo {
    opacity: 0;
    transition: opacity 0.4s ease, 0.5s;
    border-radius: 6px;
    max-width: 90vw;
    max-height: 50vh;
    position: relative;
    z-index: 2;
}

#liveVideo.view {
    opacity: 1;
}

.overlay {
    position: fixed;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.732);
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    -webkit-animation: fade-in 0.7s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
    animation: fade-in 0.7s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

.popup {
    padding: 20px;
    background: linear-gradient(135deg, #212121 0%, #3c3c3c 100%);
    border-radius: 10px;
    width: 40%;
    position: relative;
    -webkit-animation: flip-in-hor-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both 0.1s;
    animation: flip-in-hor-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both 0.1s;
}

#settingsPopup {
    background: none;
    background-color: rgb(51, 51, 51);
}

.popup-title {
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 25px;
    display: flex;
    justify-content: center;
}

.switch input {
    display: none;
}

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.4s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s;
}

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

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

.slider-text {
    font-size: 16px;
    color: #ffffff;
}

.timer-check-container {
    background-color: color-mix(in srgb, rgb(51, 51, 51) 80%, black);
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
}

.timer-input {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 10px;
    border-left: 1px solid white;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
    background-color: color-mix(in srgb, rgb(51, 51, 51) 80%, black);
    width: fit-content;
    padding: 0 15px;
    height: 40px;
    margin-left: 20px;
    border-radius: 0 0 6px 6px;
    text-align: center;
    transform: translateY(-47px);
    z-index: 1;
    overflow: hidden;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.timer-input.active {
    transform: translateY(0px);
    opacity: 1;
}

.timer-input input {
    width: 50px;
    padding: 5px 3px;
    outline: none;
    border-radius: 5px;
    border: none;
}

.close-x {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 18px;
    transition: background-color 0.4s ease;
    padding: 5px;
    border-radius: 25px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-x:hover {
    cursor: pointer;
    background-color: rgb(219, 0, 0);
}

.record-buttons {
    display: none;
    justify-content: center;
    flex-direction: row;
    gap: 10px;
    z-index: 1;
    position: relative;
}

.record-buttons.view {
    display: flex;
    -webkit-animation: slide-in-top 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    animation: slide-in-top 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.record-buttons button {
    padding: 9px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    transition: background-color 0.4s ease;
}

.record-buttons button:hover {
    cursor: pointer;
    background-color: color-mix(in srgb, var(--accent-color) 90%, black)
}

.record-sign {
    display: none;
    position: absolute;
    color: rgb(208, 0, 0);
    font-size: 60px;
    top: 0px;
    right: -2px;
    z-index: 3;
    opacity: 0;
    transition: opacity 4s ease;
}

.record-sign.view {
    display: block;
    opacity: 1;
    animation: blink 1.8s infinite;
}

@keyframes blink {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.download-container {
    display: none;
    justify-content: center;
    margin-top: 10px;
    overflow: hidden;
}

.download-container.view {
    display: flex;
    -webkit-animation: slide-in-bottom 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    animation: slide-in-bottom 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.download-container button {
    padding: 9px;
    background-color: rgb(0, 148, 193);
    border: none;
    border-radius: 25px;
    transition: background-color 0.4s ease;
}

.download-container button a {
    text-decoration: none;
    color: white;
}

.download-container button:hover {
    cursor: pointer;
    background-color: color-mix(in srgb, rgb(0, 148, 193) 90%, black);
}

@media only screen and (max-width: 780px) {
    .popup {
        width: 85%;
    }

    #liveVideo {
        max-width: 98vw;
        max-height: 70vh;
    }
}