:root {
    --green: #4c6647;
    --dark-green: #2d4b2a;
    --dusty-green: #a3b18a;
    --lightly-dusty-green: #859170;
    --dark-dusty-green: #6b7a5d;
}


/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}
main{
	flex: 1;
}
body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    line-height: 1.5;
    color: var(--dark-green);
    background: #f1f5f9;
	min-height: 100%;
}

p {
    margin: 0 0 1rem 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: normal;
    color: var(--dark-green);
}

h1 {
    font-weight: 900;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: var(--green);
    text-decoration: none;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-weight: 900;
    font-size: 1.2rem;
    margin: 0;
    padding: 20px 0;
    background: linear-gradient(
        to bottom,
        var(--dusty-green),
        var(--dark-green)
    );
    flex-direction: row;
}

nav a {
    text-decoration: none;
    padding: 1rem;
    color: white;
    font-weight: 100;
    font-size: 1.5rem;
    transition: 0.2s;
}

nav a:hover {
    background-color: rgba(128, 128, 128, 0.397);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.6rem;
    padding: 0.8rem;
}


/* =========================================================
   GENERAL SECTIONS
   ========================================================= */

.section {
    background: #f8fafc;
    border: 3px solid #b82323;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    width: 80vw;
}

.section.progress-yellow {
    border-color: #eab308;
}

.section.progress-green {
    background: #f0fdf4;
    border-color: #16a34a;
}


/* =========================================================
   HERO
   ========================================================= */

section.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    font-size: 1.5rem;
    flex-direction: column;
    text-align: center;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.button-link,
button {
    margin: 0.5rem;
    padding: 1rem 1.5rem;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: var(--green);
    cursor: pointer;
}

.button-link:hover,
button:hover {
    background: var(--dark-green);
    text-decoration: underline;
    font-weight: bold;
}


/* =========================================================
   TASK INPUT
   ========================================================= */

.task-input {
    min-width: 0;
    width: 100%;
}


/* =========================================================
   TASKS
   ========================================================= */

.task {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px;
    margin-bottom: 10px;

    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.1s ease;
}

.task:hover {
    border-color: #16a34a;
}

.task:active {
    transform: scale(0.99);
}

.task input {
    position: absolute;
    opacity: 0;
}

.task-check {
    width: 22px;
    height: 22px;

    border: 2px solid #94a3b8;
    border-radius: 6px;

    flex-shrink: 0;
}

.task:has(input:checked) {
    background: #f0fdf4;
    border-color: #16a34a;
}

.task:has(input:checked) .task-check {
    background: #16a34a;
    border-color: #16a34a;
}

.task:has(input:checked) .task-name {
    color: #64748b;
    text-decoration: line-through;
}


/* =========================================================
   SECTION HEADER
   ========================================================= */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.section-progress {
    font-weight: 700;
}


/* =========================================================
   SECTION COMPLETE STATE
   ========================================================= */

.section:not(:has(.task input:not(:checked))) {
    background: #f0fdf4;
    border-color: #16a34a;
}


/* =========================================================
   DAY PROGRESS
   ========================================================= */

.day-progress {
    margin-bottom: 24px;
}

.day-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 800;
}

.day-progress-track {
    width: 100%;
    height: 14px;
    background: #eeeeee;
    border-radius: 999px;
    overflow: hidden;
}

.day-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;

    background: #ef4444;

    transition:
        width 0.25s ease,
        background-color 0.25s ease;
}


/* =========================================================
   MANAGE WORKSPACE
   ========================================================= */

.workspace-builder-section {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    width: 80vw;
}

.workspace-builder-section .section-header input {
    flex: 1;
    min-width: 0;
}


/* =========================================================
   TASK ROWS IN WORKSPACE BUILDER
   ========================================================= */

.task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.task-row .task-input {
    flex: 1;
    min-width: 0;
}


/* =========================================================
   REORDER BUTTONS
   ========================================================= */

.reorder-buttons {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    margin: 0;
}

.reorder-buttons button {
    width: 28px;
    height: 28px;

    margin: 0;
    padding: 0;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: white;
    color: #374151;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.reorder-buttons button:hover {
    background: #f3f4f6;
    color: var(--dark-green);
    text-decoration: none;
}

.reorder-buttons button:active {
    background: #e5e7eb;
}


/* =========================================================
   REMOVE BUTTONS
   ========================================================= */

.remove-task {
    width: 28px;
    height: 28px;

    margin: 0;
    padding: 0;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-section {
    flex-shrink: 0;
}


/* =========================================================
   ADD TASK / SECTION
   ========================================================= */

.add-task {
    margin: 8px 0 0 0;
    padding: 0.6rem 1rem;
}

#add-section {
    margin-top: 4px;
}


/* =========================================================
   WORKSPACE ACTIONS
   ========================================================= */

.create-workspace-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.create-workspace-actions button,
.create-workspace-actions .button-link {
    margin: 0;
}


/* =========================================================
   DANGER ZONE
   ========================================================= */

.danger-zone {
    width: 80vw;
    margin-top: 40px;
    padding: 20px;

    border: 2px solid #dc2626;
    border-radius: 12px;

    background: #fef2f2;
    text-align: left;
}

.danger-zone h2 {
    color: #b91c1c;
    font-weight: 800;
    margin-bottom: 8px;
}

.danger-zone p {
    color: #7f1d1d;
}

.danger-button {
    display: inline-block;

    margin-top: 8px;
    padding: 0.8rem 1.2rem;

    border-radius: 4px;

    background: #dc2626;
    color: white;
    font-weight: 700;
}

.danger-button:hover {
    background: #991b1b;
    color: white;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    bottom: 0;
    width: 100%;
    text-align: center;
	position: fixed;
    background-color: #f8f9fa;
    padding: 10px;

    color: var(--dark-green);
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    section.hero {
        font-size: 1.2rem;
        min-height: 60vh;
    }

    section.hero .button-container {
        flex-direction: column;
    }

    section.hero .button-link {
        font-size: 1rem;
        margin: 0.5rem 0;
        width: 80vw;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    .section {
        width: 90vw;
    }

    .workspace-builder-section {
        width: 90vw;
        padding: 12px;
    }

    .task-input {
        min-width: 0;
        width: 100%;
    }

    .task-row {
        gap: 5px;
    }

    .reorder-buttons {
        gap: 2px;
    }

    .reorder-buttons button,
    .remove-task {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    .section-header {
        gap: 5px;
    }

    .section-header input {
        min-width: 0;
        width: 100%;
    }

    .remove-section {
        margin: 0;
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .danger-zone {
        width: 90vw;
    }
}