html, body, *, input, button {
    -webkit-touch-callout: none; /* no "copy…" menu on long-press (iOS Safari) */
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+ */
    user-select: none; /* standard */
}


body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    margin: 0;
    background-color: #111;
    color: #fff;
    position: relative;
    flex-direction: column;
}

.container {
    text-align: center;
    will-change: transform, opacity;
}

.task {
    font-size: 6.5rem;
    margin-bottom: 1rem;
    font-family: 'Bangers', cursive;
}

.timer {
    font-size: 6.5rem;
    font-weight: bold;
    font-family: 'Bangers', cursive;
    cursor: pointer;
}

.next-task {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 2rem;
    font-family: 'Bangers', cursive;
    opacity: 0.8;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.toggle-seconds {
    position: absolute;
    bottom: 10px;
    left: 20px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-container {
    width: 70%;
    height: 40px;
    background-color: #444;
    margin-top: 50px;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #00ff88;
    transition: width 0.3s ease;
    border-radius: 20px 0 0 20px;
}

.tick {
    display: inline-block;
    width: 1px;
    height: 10px;
    background: #888;
    position: relative;
}

.tick-label {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #aaa;
    white-space: nowrap;
}

input[type="text"] {
    background: #000;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

#task-list input.time-input {
    width: 60px;
}

button {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: #333;
    border: 2px solid #666;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

input[type="checkbox"]::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

input[type="checkbox"]:checked::before {
    opacity: 1;
}

#day-tabs .day-tab {
    background: #333;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    outline: 2px solid transparent;
    transition: outline-color .2s;
}

#day-tabs .day-tab.selected {
    outline-color: #00BFFF;
}


/* Modernize the font dropdown */
#modalFontSelect, #modalDateTimeFontSelect {
    /* remove native arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* base styling */
    min-width: 140px;
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;

    /* custom arrow via SVG data-URI */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
}

/* hide IE/Edge default arrow */
#modalFontSelect::-ms-expand,
#modalDateTimeFontSelect::-ms-expand {
    display: none;
}

/* focus state */
#modalFontSelect:focus,
#modalDateTimeFontSelect:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.4);
}

/* Style the alternating interval dropdown the same way */
#modalAlternatingInterval {
    /* remove native arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* base styling */
    min-width: 80px;
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;

    /* custom arrow via SVG data-URI */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
}

/* hide IE/Edge default arrow */
#modalAlternatingInterval::-ms-expand {
    display: none;
}

/* focus state */
#modalAlternatingInterval:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.4);
}

/* disabled state */
#modalAlternatingInterval:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #1a1a1a;
}

input.invalid-time {
    border: 1px solid #f44 !important;
    background-color: #1a0000 !important;
}

button:hover {
    background-color: #444;
}

@keyframes containerSlideRight {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-swipe {
    animation: containerSlideRight 0.8s ease-in-out;
}

@media (max-width: 700px) {
    /* shrink the modal container */
    #settings-modal > div {
        width: 90vw;
        max-height: 80vh;
        padding: 12px !important;
    }

    /* make the header and labels smaller */
    #settings-modal h3,
    #settings-modal h2,
    #settings-modal label {
        font-size: 0.8rem !important;
    }

    /* constrain the task list so Add/Reset always show */
    #task-list {
        max-height: 200px !important;
        overflow-y: auto !important;
    }

    #task-list > div {
        gap: 4px !important;
    }

    #task-list input[type="text"],
    #task-list button {
        font-size: 0.7rem !important;
        padding: 4px 6px !important;
    }

    /* shrink the add/reset buttons */
    #add-task,
    #reset-tasks {
        font-size: 0.8rem !important;
        padding: 6px 8px !important;
    }

    /* reduce icon size */
    #settings-icon {
        font-size: 1.2em !important;
    }
}

/* utility */
.hidden {
    display: none !important;
}

/* the "date" overlay */
#date-view {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden; /* prevent any overflow */
    background: transparent; /* or semi-transparent if you like */
    pointer-events: none;
}

/* weekday (e.g. MONDAY) */
#date-view .weekday {
    font-family: 'Cal Sans', sans-serif;
    font-size: clamp(2rem, 10vw, 8rem);
    margin: 0.2em 0;
    line-height: 1;
}

/* time (e.g. 4:42 PM) */
#date-view .time {
    font-family: 'Cal Sans', sans-serif;
    font-size: clamp(3rem, 12vw, 10rem);
    margin: 0.2em 0;
    line-height: 1;
}


/* date (e.g. April 30th 2025) */
#date-view .date {
    font-family: 'Cal Sans', sans-serif;
    font-size: clamp(2rem, 8vw, 6rem);
    margin: 0.2em 0;
    line-height: 1;
}

/* target the suffix */
#date-view .date sup {
    font-size: 0.5em; /* half the parent's size */
    line-height: 0; /* collapse the line-box */
    vertical-align: super; /* move it up */
}


/* ensure hidden class really hides */
.hidden {
    display: none !important;
}

#modalAlternatingInterval:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* NEST HUB (approx. 1024×600) */
@media screen and (max-width: 1024px) and (max-height: 600px) {
    /* make the backdrop fill it nicely */
    #settings-modal {
        align-items: flex-start;
        padding-top: 20px;
    }

    /* full‐width, full‐height content */
    #settings-modal > div {
        width: 95vw;
        max-width: 95vw;
        max-height: 85vh;
        padding: 10px !important;
        box-sizing: border-box;
    }

    /* shrink all text and controls */
    #settings-modal h3,
    #settings-modal label {
        font-size: 0.75rem !important;
    }

    #day-tabs .day-tab,
    #add-task,
    #reset-tasks {
        padding: 4px 6px !important;
        font-size: 0.75rem !important;
    }

    #task-list {
        max-height: 180px !important;
        overflow-y: auto !important;
    }

    #task-list input,
    #task-list button {
        font-size: 0.7rem !important;
        padding: 3px 5px !important;
    }

    /* reduce icon size */
    #settings-icon {
        font-size: 1.2em !important;
    }
}


@media (max-width: 600px) {
    .timer {
        font-size: 4.0rem;
    }

    .task {
        font-size: 4.0rem;
    }

    .next-task {
        font-size: 1.0rem;
    }

    #settings-icon {
        font-size: 1.2em !important;
    }

    #settings-modal > div {
        width: 90vw !important;
        padding: 20px !important;
    }

    #task-list input[type="text"] {
        font-size: 0.7rem;
        padding: 2px 3px;
    }

    #task-list button {
        padding: 4px 6px;
        font-size: 0.85rem;
    }

    #task-list > div {
        gap: 3px;
    }

    #settings-modal h3,
    #settings-modal h2,
    #settings-modal label {
        font-size: 0.9rem;
    }

    #settings-modal button {
        font-size: 0.85rem;
        padding: 6px 8px;
    }
}

/* Style the alternating duration dropdown the same way */
#modalAlternatingDuration {
    /* remove native arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* base styling */
    min-width: 60px;
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;

    /* custom arrow via SVG data-URI */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
}

/* hide IE/Edge default arrow */
#modalAlternatingDuration::-ms-expand {
    display: none;
}

/* focus state */
#modalAlternatingDuration:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.4);
}

/* disabled state */
#modalAlternatingDuration:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #1a1a1a;
}
