@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/InterVar.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-primary: #0D3B66; /* Dark Blue */
    --color-primary-hover: #0b3257; /* Dark Blue */
    --color-button-text: #FFFFFF; /* White */
    --color-base-background: #F5F6FA; /* Light Gray */
    --color-title: #1E1E1E; /* Dark Gray */
    --color-text: #5A5A5A; /* Medium Gray */ 
    --color-secondary: rgb(250, 235, 215);
    --color-danger: #931515; /* Dark Red */
    --color-danger-focus: #6e1010; /* Darkened Red */
    --color-completed: #d3f0ed; /* Light Teal */
    --color-done: #27948a; /* Teal */
    --color-done-focus: #124540; /* Teal Darkened */
    --color-button-focus: #6c6868;

    --ff-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --border-section: 1px solid #dcdcdc;
}

body {
    font-family: var(--ff-sans);
    background-color: var(--color-base-background);
}

main {
    display: grid;
    grid-template-rows: repeat(3, auto);
    gap: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    /* min-height: 100dvh;  */
}

.app-title {
    color: var(--color-primary);
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin: 32px 0;
}

@media (max-width: 600px) {
    .app-title {
        font-size: 28px;
    }
}

main section {
    border-radius: 10px;
}

button:focus {
    outline: 2px solid var(--color-button-focus);
}

#section-header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 12px 32px;
    border: var(--border-section);
    background-color: var(--color-button-text);
}

main section {
    padding: 5px 32px;
}

@media (max-width: 600px) {
    main section {
        padding: 5px 24px;
    }
}

#section-list {
    background-color: var(--color-button-text);
    border: var(--border-section);
    padding-top: 12px;
    padding-bottom: 12px;
}

#section-list h2 {
    color: var(--color-title);
    font-size: 24px;
    font-weight: 500;
    text-align: left;
    margin: 0;
}

@media (max-width: 600px) {
    #section-list h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }
}

.ctn-new-task {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

@media (max-width: 600px) {
    .ctn-new-task {
        flex-direction: column;
    }
}

.ctn-new-task #todo-input {
    font-family: var(--ff-sans);
    font-size: 16px;
    font-weight: 100;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #F5F6FA;
    border-radius: 6px;
}

.ctn-new-task #show-calendar {
    -webkit-appearance: none; /* elimina estilo nativo en Safari/iOS */
    -moz-appearance: none;    /* elimina estilo nativo en Firefox */
    appearance: none;         /* estándar */

    background-color: #fff;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    height: 44px;
    width: 124px;
}

.header-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.date-box {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.date-box label {
    position: absolute;
    top: -6px;
    background-color: #fff;
    padding: 0 10px;
    font-family: var(--ff-sans);
    font-size: x-small;
    color: var(--color-button-focus);
}


.ctn-new-task #add-task-btn {
    font-size: 16px;
    font-weight: 600;
    height: 44px;
    width: 74px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background-color: var(--color-primary);
    color: var(--color-button-text);
    transition: background-color 0.3s ease;
}

.ctn-new-task #add-task-btn:hover{
    background-color: var(--color-primary-hover);
}

.ctn-new-task #add-task-btn:disabled { 
    background-color: var(--color-button-focus);
    cursor: not-allowed;
}

.ctn-new-task #add-task-btn:disabled:focus {
    background-color: var(--color-button-focus);
}

.ctn-list {
    width: 100%;
    /* max-width: 500px; */
    margin: 0 auto;
}

.ctn-list .completed .task-text {
    color: #111;
}

.ctn-list .task-text {
    font-size: 16px;
    font-weight: lighter;
    line-height: 19px;
    color: var(--color-text);
}

.ctn-list ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 0;
}

.ctn-list ul li {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease; /* Transitions */
    transform: translateY(0);
}

.ctn-list ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

@media (max-width: 600px) {
    .ctn-list ul li:last-child {
        padding-bottom: 10px;
    }
}

@media (max-width: 600px) {
    .ctn-list ul li {
        flex-direction: column;
        align-items: center;
        border-radius: 8px;
        border: 1px solid #eee;
        margin-bottom: 10px;
    }
}

.task-enter { /* When creating a Task */
    opacity: 0;
    transform: translateY(-10px);

}

.task-enter-active {
    opacity: 1;
    transform: translateY(0);
}

.task-exit { /* When deleting a Task */
    opacity: 0;
    transform: translateY(10px);
}

@media (min-width: 600px) {
    .ctn-list ul li:last-child {
        border: none;
    }
}

.ctn-list ul li.completed {
    background-color: var(--color-completed);
    border-radius: 3px;
}

.ctn-list ul li .complete-btn {
    cursor: pointer;
    background-color: var(--color-done);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    transition: background-color 0.3s ease;
}

.ctn-list ul li .complete-btn:hover {
    background-color: var(--color-done-focus);
}

.ctn-list ul li .delete-btn {
    cursor: pointer;
    background-color: var(--color-danger);
    color: #fff;
    border: none;
    border-radius: 4px;;
    padding: 8px 12px;
    transition: background-color 0.3s ease;
}

.ctn-list ul li .delete-btn:hover {
    background-color: var(--color-danger-focus);
}

.ctn-list li .actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ctn-list li .actions .date-text {
    font-family: var(--ff-sans);
    font-size: 12px;
    font-weight: 200;
    width: 100%;
    padding: 6px 12px;
    border: 1px solid #F5F6FA;
    border-radius: 6px;
}

.ctn-list li .actions .date-text.ontime {
    border-color: #1e951e;
    background: #efffef;
}

.ctn-list li .actions .date-text.late {
    border-color: #be0e0e;
    background: #f4e7e7;
}

.ctn-list li .actions .date-text.soon {
    background: #ececce;
    border-color: #b0b012;
}

.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content:space-between;
    background-color: var(--color-button-text);
    padding: 12px 32px;
    border-radius: 10px;
    gap: 10px;
    border: var(--border-section);
    margin: 0;
}

/* @media (max-width: 600px) {
    .footer {
        flex-direction: column;
        text-align: center;
    }
    
} */

.footer p {
    font-family: var(--ff-sans);
    font-weight: 200;
    font-size: large;
    margin: 0;
    color: var(--color-text);
}

.footer img {
    display: block;
    width: 4rem;
}