:root {
    --bg: #f9f9f9;
    --surface: #ffffff;
    --text: #222222;
    --muted: #777777;
    --muted-2: #aaaaaa;
    --accent: #ff6347; /* tomato */
    --focus: #b3d4fc;
    --card-radius: 4px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1720;
        --surface: #0b1220;
        --text: #e6eef8;
        --muted: #9aa6b2;
        --muted-2: #6b7783;
        --accent: #ff8a65;
        --focus: #274b6b;
    }
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    background: var(--bg);
    color: var(--text);
}

.container {
    width: 100%;
    display: grid;
    row-gap: 1em;
    column-gap: 4em;
    grid-template-rows: repeat(5 100px);
    grid-template-columns: minmax(400px, 1fr) minmax(400px, 20fr) repeat(auto-fit, minmax(400px, 1fr));
    grid-template-areas:
    "header task timer music"
    ". task . controls"
    ". task . ."
    ". task . .";
}

.top {
    margin-bottom: 3em;
    grid-area: header;
}

.tasklistContainer {
    grid-area: task;
}

.timerContainer {
    grid-area: timer;
}

.musicContainer {
    grid-area: music;
}

.routineControlContainer {
    grid-area: controls;
}

@media (max-width: 1847px) {
    .container {
        grid-template-rows: repeat(5 100px);
        grid-template-columns: minmax(400px, 1fr) minmax(400px, 20fr) minmax(400px, 1fr);
        grid-template-areas:
        "header task timer"
        ". task music"
        ". task controls"
        ". task .";
    }
}

@media (max-width: 1354px) {
    .container {
        grid-template-rows: repeat(5 100px);
        grid-template-columns: repeat(2, minmax(400px, 1fr));
        grid-template-areas:
        "header task"
        "timer task"
        "music task"
        "controls task";
    }
}

@media (max-width: 891px) {
    .container {
        grid-template-rows: repeat(5 100px);
        grid-template-columns: repeat(1, minmax(400px, 1fr));
        row-gap: 3em;
        grid-template-areas:
            "header"
            "task"
            "timer"
            "music"
            "controls";
    }
}

@media (max-width: 450px) {
    .container {
        grid-template-columns: repeat(1, minmax(200px, 1fr));
    }
}

.container > details {
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
    padding: 0 1em;
    border-radius: 0.5em;
}

.timer-container {
    margin-bottom: 30px;
}

.timer-container.paused canvas {
    opacity: 0.5;
}

.timer-display {
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-text {
    position: absolute;
    font-size: 1em;
    font-weight: bold;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: var(--text);
}

.todo-container {
    width: 100%;
}

.todo-input {
    display: flex;
    margin-bottom: 10px;
}

.todo-input input {
    flex: 1;
    padding: 8px;
    font-size: 1em;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--surface);
    color: var(--text);
}

.todo-input button {
    padding: 8px;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    margin-bottom: 4px;
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: row;    
    align-items: center;
}

li.checked {
    color: var(--muted-2);
    text-decoration: line-through;
    order: 9999;
}

.taskContainer {
    background: var(--surface);
    display: flex;
    flex-direction: row;
    width: 300px;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset;
}

.indentSpacer {
    width: 30px;
}

button.template-btn {
    margin: 5px 5px 0 0;
}

.delete-btn {
    color: var(--muted);
}

.task-text {
    flex: 1;
    margin-right: 8px;
    cursor: pointer;
}

.move-btn {
    background: transparent;
    border: none;
    color: var(--muted-2);
    font-size: 0.8em;
    padding: 4px 6px;
    cursor: pointer;
}

.move-btn:focus,
.delete-btn:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

button {
    cursor: pointer;
}

button:hover {
    -webkit-filter: brightness(0.85);
    filter: brightness(0.85);
    transition: filter .15s ease, -webkit-filter .15s ease;
    will-change: filter;
}

.templates {
    display: flex;
    align-items: center;
    gap: 8px;
}

#todoList {
    color: var(--muted-2);
}

summary h2,
summary h3 {
    display: inline;
    margin: 0 0 0 0.2rem;
}

summary {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 2px;
    padding: 0.8rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
}

summary div {
    display: inline-flex;
    width: 90%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

summary p {
    margin: 0;
}

summary:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

summary:active {
    background-color: rgba(0, 0, 0, 0.12);
}

#currentTask {
    cursor: pointer;
    width: 100%;
}

/* Set your aspect ratio */
.video-container {
  position: relative;
  overflow: hidden;
  height: 0;
  padding-bottom: 56.25%; /* creates a 16:9 aspect ratio */
}

.video-container iframe,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

/* And set the max-width of the parent element */
.video-wrap {
  width: 100%;
  max-width: 600px;
}

footer {
    margin-top: 1.5em;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

/* Ensure links in the footer are readable on both light and dark themes */
footer a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s ease, filter 0.15s ease;
    padding: 1em;
}

footer a:hover,
footer a:focus {
    color: var(--accent);
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

footer a:visited {
    color: var(--muted-2);
}


