/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: last 4 version
*/

/* Google fonts import ------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Playwrite+US+Modern:wght@100..400&family=Quicksand:wght@300..700&display=swap");

/* CSS Variables ------------------------------------------------- */
:root {
    --primary-font: "quicksand", sans-serif;
    --secondary-font: "playwrite us modern", cursive;

    --background-color-primary: #d8f3dc; /* task list background */
    --background-color-overdue: #ecdad5 ;/* task list background for overdue tasks */
    --text-color-dark: #081c15; /* dark text color for lighter background */
    --text-color-light: white; /* light text color for darker background */

    --highlight-color: #1b4332;
    --highlight-color-dark: #081c15;

    --html-background-color-primary: #2d6a4f;
    --html-background-color-secondary: #52b788;
}

/* General styles ------------------------------------------------ */
body {
    font-family: var(--primary-font);
    color: var(--text-color-dark);
    min-height: 100vh;
    /* Background style inspired by https://blog.logrocket.com/advanced-effects-with-css-background-blend-modes-4b750198522a/) */
    background: 
        -webkit-gradient(linear, left top, left bottom, from(var(--html-background-color-primary)), to(transparent)),
        -webkit-gradient(linear, right bottom, left top, from(var(--html-background-color-secondary)), to(transparent));
    background: 
        -o-linear-gradient(var(--html-background-color-primary), transparent),
        -o-linear-gradient(bottom right, var(--html-background-color-secondary), transparent);
    background: 
        linear-gradient(var(--html-background-color-primary), transparent),
        linear-gradient(to top left, var(--html-background-color-secondary), transparent);
    background-blend-mode: screen;
}

h1,
h2 {
    font-family: var(--secondary-font);
    color: var(--text-color-light);
    line-height: 1.5em;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

/* Header ----------------------------------------------------------- */
header {
    padding: 20px 0;
    text-align: center;
    /* Background image with dark layer added on top of it to improve readability of text */
    background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.5))),
        url(../images/header-background.jpg) no-repeat center 60% / cover;
    background: -o-linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url(../images/header-background.jpg) no-repeat center 60% / cover;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url(../images/header-background.jpg) no-repeat center 60% / cover;
}

header h1 {
    font-size: 2.5rem;
    padding-bottom: 20px;
}

header p {
    color: var(--text-color-light);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 30px;
}

/* Instructions Icon/Modal ------------------------------------------ */ 
/* Icon container aligned to top right */
.instructions-icon-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: end;
        -ms-flex-pack: end;
            justify-content: flex-end;
    padding: 0 20px;
    max-width: 800px;
    margin: 0 auto;
}

.instructions-icon {
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 1.5rem;
    -webkit-transition: color 0.2s ease;
    -o-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.instructions-icon:hover {
    color: var(--background-color-primary);
}

#instructionsModalLabel {
    color: var(--text-color-dark);
}

.modal-content {
    background: var(--background-color-primary);
}

.modal-body ol, ul {
    padding: 0 25px;
}

.modal-footer button {
    background-color: var(--highlight-color);
    color: var(--text-color-light);
}

.modal-footer button:hover {
    background-color: var(--highlight-color-dark);
}

/* Task input section -------------------------------------------- */
.task-input-section h2 {
    padding: 20px 0;
}

.task-input-wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Task input field */
#taskInput {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    min-width: 200px;
    max-width: 500px;
    min-height: 40px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    resize: vertical; /* Allows manual resizing */
    font-size: 1rem;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    margin-bottom: 20px;
}

/* Deadline input field */
#deadlineInput {
    width: 140px;
    height: 40px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* cursor: pointor only appears when hovering over the calendar icon of the date input */
input::-webkit-calendar-picker-indicator:hover {
    cursor: pointer;
}

#deadlineLabel {
    height: 40px;
    line-height: 40px;
    color: var(--text-color-light);
    font-weight: 500;
}

/* Add button */
#addButton {
    height: 40px;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border: none;
    background-color: var(--highlight-color);
    color: var(--text-color-light);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
    -ms-flex-item-align: start;
        align-self: flex-start; /* Keeps button aligned to top of textarea */
}

#addButton:hover {
    background-color: var(--highlight-color-dark);
}

/* Task list section -------------------------------------------- */
/* General task list styles */
#taskList {
    list-style-type: none;
    padding: 0;
}

#taskList li {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    background: var(--background-color-primary);
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 5px;
}

/* Task list item content */
/* Task Checkbox */
.taskCheckbox {
    margin-right: 10px;
    accent-color: green;
    -webkit-transform: scale(1.3);
        -ms-transform: scale(1.3);
            transform: scale(1.3);
    -webkit-transition: color 0.2s ease;
    -o-transition: color 0.2s ease;
    transition: color 0.2s ease;
    cursor: pointer;
}

.taskCheckbox:hover {
    accent-color: darkgreen;
}

/* Deadline Text */
.deadlineTaskText {
    -webkit-box-flex: 1;
        -ms-flex-positive: 1;
            flex-grow: 1;
    text-align: left;
    cursor: pointer;
}

/* Delete Icon */
.deleteTask {
    color: red;
    cursor: pointer;
    -webkit-transform: scale(1.3);
        -ms-transform: scale(1.3);
            transform: scale(1.3);
    margin-left: 10px;
    -webkit-transition: color 0.2s ease;
    -o-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.deleteTask:hover {
    color: darkred;
}

.deleteTaskInstructions {
    color: red;
    -webkit-transform: scale(1.3);
        -ms-transform: scale(1.3);
            transform: scale(1.3);
    margin-left: 5px;
}

/* Status Classes */
.open {
    color: var(--text-color-dark);
    font-weight: 500;
}

.in-progress {
    color: #B10606;
    font-weight: 500;
}

.done {
    color: grey;
    text-decoration: line-through;
}

/* Reset button ------------------------------------------------- */
#resetButton {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    background-color: var(--highlight-color);
    color: var(--text-color-light);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

#resetButton:hover {
    background-color: darkred;
}

/* Scroll button ------------------------------------------------ */
#scrollButton {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 1.5rem;
    -webkit-transition: color 0.2s ease, background-color 0.2s ease;
    -o-transition: color 0.2s ease, background-color 0.2s ease;
    transition: color 0.2s ease, background-color 0.2s ease;
    background-color: var(--highlight-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: solid transparent 2px;
}

#scrollButton:hover {
    background-color: var(--text-color-light);
    color: var(--text-color-dark);
    border-color: var(--highlight-color);
}

/* Footer ----------------------------------------------------- */
#footer i {
    color: var(--text-color-light);
    font-size: 1.5rem;
}

#footer i:hover {
    color: var(--highlight-color);
}

/* 404 page --------------------------------------------------- */
.not-found-page {
    background-color: var(--background-color-primary);
}

.not-found-page h1, 
.not-found-page h2 {
    color: var(--text-color-dark);
}
.back-home-button {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    background-color: var(--highlight-color);
    color: var(--text-color-light);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.back-home-button:hover {
  background-color: var(--highlight-color-dark);
  color: var(--text-color-light);
}

/* Responsive layout for small screens ------------------------ */
@media (max-width: 576px) {
    /* Show task input section element in column */
    .task-input-wrapper {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: stretch;
            -ms-flex-align: stretch;
                align-items: stretch;
    }

    #taskInput {
        width: 100%;
        margin-bottom: 0;
    }

    #deadlineInput {
        display: block;
        margin: 0 auto 0 auto; /* center and space below */
    }

    /* Change height for deadlineLabel so there is less space between the input elements */
    #deadlineLabel {
        height: 20px;
        line-height: 20px;
    }

    #addButton {
        width: 100%;
    }

    #resetButton {
        background-color: darkred;
    }

    #scrollButton {
        font-size: 1rem;
        width: 40px;
        height: 40px;
    }
}