/* ---imports--- */
@import "variables.css";

/* ---!site body!--- */
body {
    /* -layout- */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
    font-family: sans-serif;

    /* -styles- */
    background: var(--bg);
    transition: 1s ease-in-out;
    background-attachment: fixed;
    /* -dark theme- */

}

h1 {
    /* -layout- */
    text-align: center;

    /* -styles- */
    color: #eaeaea;
    font-size: 2.5rem;   
}


/* ---!add task section!--- */
#addTask {
    /* -layout- */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 500px;
    gap: 16px;
    padding: 16px;
    border-radius: 38px;

    /* -styles- */
    background-color: rgb(from var(--primary-bg) r g b / 0.25);
    backdrop-filter: blur(12px);
    border: 1px solid rgb(from var(--border) r g b / 0.2);
    transition: 0.3s ease-in-out;
}

/* --habit form-- */
#habbitForm {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 4px;
}

.header h2 {
    /* -layout- */
    text-align: center;
    margin: 0;

    /* -style- */
    color: var(--primary-text);
    transition: 0.3s ease-in-out;
    font-size: 20px;
    font-weight: bold;
}

/* -habit form header- */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

#theme-toggle .icon-sun, #theme-toggle .icon-moon {
    display: none;
}
[data-theme="light"] #theme-toggle .icon-moon {
    display: inline-block;
}
[data-theme="dark"] #theme-toggle .icon-sun {
    display: inline-block;
}

#theme-toggle {
    /* -layout- */
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;

    /* -style- */
    background-color: rgb(from var(--second-bg) r g b / 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

#theme-toggle i {
    font-size: 24px;
    color: var(--primary-text);
}

#theme-toggle:hover {
    background-color: rgb(from var(--second-bg) r g b / 0.7);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

#theme-toggle:active {
    transform: scale(0.97);
    transition: 0.2s;
}

/* -input- */
input[type=text] {
    /* -layout- */
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 12px;

    /* -styles- */
    background-color: var(--second-bg);
    border: 2px solid var(--border);
    color: var(--primary-text);
    transition: 0.3s ease-in-out;
    font-size: 17px;
}
input[type=text]:focus {
    border-color: var(--accent); 
    box-shadow: 4px 4px 12px rgba(0, 127, 255, 0.4); 
}

/* -button- */
#add {
    /* -layout- */
    width: 100%;
    padding: 8px 16px;
    border-radius: 32px;

    /* -style- */
    background-color: var(--accent);
    color: #eaeaea;
    font-size: 14px;
    border: 1px solid rgb(from var(--accent-hover) r g b / 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: 0.2s;
    cursor: pointer;
}
#add i {font-size: 20px;}

#add:hover {
    background-color: var(--accent-hover);
    border: 1px solid rgb(from var(--accent) r g b / 0.2);
    transition: 0.2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

#add:active {
    transform: scale(0.97);
    transition: 0.2s;
}

/* ---!tasks section!--- */
#Tasks {
    /* -layout- */
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    border-radius: 38px;

    /* -style- */
    background-color: rgb(from var(--primary-bg) r g b / 0.25);
    backdrop-filter: blur(12px);
    border: 1px solid rgb(from var(--border) r g b / 0.2);
    transition: 0.3s ease-in-out;
}

.tasks-header h2 {
    /* -layout- */
    text-align: center;
    margin: 0;

    /* -style- */
    color: var(--primary-text);
    transition: 0.3s ease-in-out;
    font-size: 20px;
    font-weight: bold;
}

/* -tasks list- */
#taskList {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
    gap: 8px;
}

li {
    /* -layout- */
    display: flex;
    position: relative;
    padding-top: 42px;
    flex-direction: column;
    text-align: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    gap: 16px;
    border-radius: 22px;
    box-sizing: border-box;

    /* -style- */
    background-color: var(--second-bg);
    border: 1px solid rgb(from var(--border) r g b / 1);
    font-size: 17px;
    color: var(--primary-text);
    transition: 0.3s ease-in-out;

    word-break: break-word;
}

.time {
    /* -layout- */
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
    line-height: 1;

    /* -style- */
    color: var(--second-text);
    transition: 0.3s ease-in-out;
    font-size: 12px;
}

li > span {
    width: 100%;
    padding-right: 60px;
    box-sizing: border-box;
}

.btn-container {
    display: flex;
    gap: 4px;
    width: 100%;
}

.complete-btn, .edit-btn, button.delete-btn {
    /* -layout- */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    box-sizing: border-box;
    gap: 6px;
    padding: 4px 0;
    border-radius: 6px;
    /* border: none; */
    font-size: 12px;
    cursor: pointer;
}
.complete-btn i, .edit-btn i, button.delete-btn i {
    font-size: 17px;
}

.complete-btn {
    width: 25%;
    background-color: var(--accent);
    color: #fff;
    transition: background-color 0.3s ease;
    border: 1px solid rgb(from var(--accent-hover) r g b / 0.5);
}

.complete-btn:hover {
    background-color: var(--accent-hover);
    transition: background-color 0.3s ease;
    border: 1px solid rgb(from var(--accent) r g b / 0.5);
}

.edit-btn {
    width: 25%;
    color: var(--primary-text);
    background-color: var(--third-bg);
    transition: background-color 0.3s ease;
    border: none;
    transition: 0.3s ease-in-out;
}

.edit-btn:hover {
    background-color: #dcdcdc;
    transition: background-color 0.3s ease;
}

button.delete-btn {
    width: 50%;
    justify-content: flex-start; 
    padding-left: 12px;
    color: var(--error);
    background-color: var(--second-bg);
    transition: 0.3s ease-in-out;
    font-weight: bold;
    border: none;
}
