/* Colour variables to save having to refer to the hex codes each time they are used */
:root {
    --pomo-blue: #5365B5;
    --pomo-light-blue: #8D99CE;
    --pomo-dark-blue: #3F4E92;
    --pomo-white: #ffffff;
}

/* Prevent page from "overflowing" and showing a horizontal scroll bar */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    margin: 0;
}

.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 3rem;
}

.main {
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    transition: transform 0.2s;
    width: 500px;
    height: 400px;
    text-align: center;
}

.howto h2 {
    width: 100%;
    max-width: 800px;
    margin: 2.25rem auto 1rem;
    padding: 0.75rem 1rem;
    border-left: 6px solid var(--pomo-dark-blue);
    background: rgba(141, 153, 206, 0.15);
    border-radius: 8px;
}

/* How-to page: secondary section headers */
.howto h3 {
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto 0.75rem;
    padding-left: 0.75rem;
    background: rgba(141, 153, 206, 0.15);
    font-weight: 600;
}

.howto p {
    width: 100%;
    max-width: 800px;
    margin: 0.75rem auto;
}


/* Limit the width of the intro text on the index page */
.intro-text {
    width: min(60vmin, 500px);
    margin: 0.75rem auto 0;
}

/* Nav bar */
.site-nav {
    background-color: var(--pomo-blue);
    color: var(--pomo-white);
    padding: 10px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center
}

.site-nav .nav-links {
    display: flex;
    gap: 10px;
}

.site-nav .nav-links a {
    color: var(--pomo-white);
    text-decoration: none;
    padding: 0.5em 0.75em;
}

.site-nav .nav-links a.active {
    background-color: var(--pomo-dark-blue);
    border-radius: 4px;
}

/* Hide the burger menu on desktop */
.site-nav .nav-toggle {
    display: none;
}

.site-nav .nav-toggle-label,
.site-nav .nav-current {
    display: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Sizing for mobile screens */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }
    .content {
        padding: 0 15px;
    }

    /* Change nav to burger menu */
    .site-nav {
        justify-content: space-between;
        flex-wrap: wrap;
        padding: 8px 12px;
        font-size: 0.9rem;
        overflow-x: hidden;
    }

    .site-nav .nav-top {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .site-nav .nav-toggle-label,
    .site-nav .nav-current {
        display: inline-flex;
        align-items: center;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80%;
    }

    .site-nav .nav-toggle-label {
        display: inline-flex;
        font-size: 1.6rem;
        cursor: pointer;
    }

    /* Hide links on mobile */
    .site-nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 8px;
    }

    .site-nav .nav-links a {
        text-align: center;
        padding: 0.6em 0.3em;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .site-nav .nav-toggle:checked ~ .nav-links {
        display: flex;
    }
}

.btn {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--pomo-blue);
    transition: background-color 0.3s;
}

/* Timer formatting */
.timer-circle {
    width: min(60vmin, 320px);
    height: min(60vmin, 320px);
    margin: 20px auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: clamp(48px, 10vmin, 96px);
    font-weight: 700;
    color: var(--pomo-white);
    background: var(--pomo-blue);
}

.timer-circle.work {
    background-color: var(--pomo-blue);
}

.timer-circle.break {
    background-color: var(--pomo-light-blue);
}
.control-buttons {
    margin-top: 75px;
    display: flex;
    justify-content: space-evenly;
    gap: 6px;
}

.control-buttons button {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.control-buttons button:hover {
    background-color: var(--pomo-blue);
    transition: background-color 0.3s;
}

/* Timer status (mode + session tracker) */
.timer-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Session tracker (dots & text) */
.session-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* Mode label (shows whether the timer is in "Work" or "Break" mode */
.mode-label {
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--pomo-dark-blue);
    color: var(--pomo-white);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Change colors based on 'work' or 'break' state */
.mode-label.work {
    background-color: var(--pomo-blue);
    
}

.mode-label.break {
    background-color: var(--pomo-light-blue);
}

.timer-circle.work {
    background-color: var(--pomo-blue);
    box-shadow: 0 0 0 6px rgba(83, 101, 181, 0.25);
}

.timer-circle.break {
    background-color: var(--pomo-light-blue);
    box-shadow: 0 0 0 6px rgba(141, 153, 206, 0.25);
}

/* Session dots */
.session-dots {
    display: inline-flex;
    gap: 6px;
}

.session-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
}

.session-dots .dot.filled {
    background: var(--pomo-dark-blue);
}

.session-text {
    font-weight: 600;
    color: #333;
}

/* Task list formatting */
.tasks {
    margin-top: 24px;
}

.task-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.task-input input {
    flex: 1;
    padding: 10px;
    height: 42px;
}

.btn-add {
    background-color : var(--pomo-light-blue);
    color: var(--pomo-white);
    height: 42px;
}

.btn-add:hover {
    background-color: var(--pomo-blue);
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-list li {
    background: var(--pomo-white);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.task-list li.checked {
    text-decoration: line-through;
    color: var(--pomo-dark-blue);
}

/* Make the 'cross' area larger to make it easier to click on */
.close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* Darker background on hover */
.task-list li:hover {
    background: var(--pomo-dark-blue);
    color: var(--pomo-white);
}

/* Session feedback */
.session-feedback {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--pomo-white);
    border-radius: 8px;
}

.session-feedback h2 {
    margin-bottom: 1rem;
}

.emoji-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
    margin-bottom: 1rem;
    border: none;
    margin: 1rem;
    padding: 1rem;
}

.emoji-group label {
    font-size: 2rem;
    cursor: pointer;
}

.emoji-group input {
    display: none;
}

.emoji-group input:checked + span {
    outline: 2px solid var(--pomo-dark-blue);
}

.emoji-group input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.emoji-group input[type="radio"]:checked + img {
    filter: none;
    opacity: 1;
    transform: scale(1.2);
}

.emoji-group img {
    width: 48px;
    height: 48px;
    max-width: none;
    filter: grayscale(100%);
    object-fit: contain;
    flex: 0 0 auto;
    opacity: 0.5;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

/* Remove the greyscale filter on hover */
.emoji-group img:hover {
    filter: grayscale(0%);
}

.mood-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px;
}

.feedback-date {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #666;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    resize: vertical;
}

button {
    padding: 0.5rem 1.2rem;
    cursor: pointer;
}

.hidden {
    display: none;
}

.timer-image {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.resource-links {
    list-style: none;
    padding-left: 0;
    margin: 0 auto;
    max-width: 600px;
}

.resource-links li {
    margin-bottom: 0.75rem;
    text-align: center;
}
