/* === FONT IMPORTS === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* === CUSTOM FONT (LOCAL) === */
@font-face {
    font-family: 'Ahsing';
    src: url('../fonts/Ahsing-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === LIGHT THEME VARIABLES (Default) === */
:root {
    /* Backgrounds */
    --bg: #fff;
    --bg-hovr: #000;

    /* Text */
    --txt: #000;
    --txt-hovr: #fff;

    /* Glass Effects */
    --glass: rgba(0, 0, 0, 0.025);
    --glass-hovr: rgba(0, 0, 0, 0.05);

    /* Borders */
    --border: 1px solid rgba(0, 0, 0, 0.1);

    /* Hover States / Accents */
    --hover-bg: #0f0f0f;
    --hover-c: #fff;
}

/* === DARK THEME VARIABLES (Toggle Class) === */
.darkMode {
    /* Backgrounds */
    --bg: #0f0f0f;
    --bg-hovr: #fff;

    /* Text */
    --txt: #fff;
    --txt-hovr: #000;

    /* Glass Effects */
    --glass: rgba(255, 255, 255, 0.025);
    --glass-hovr: rgba(255, 255, 255, 0.05);

    /* Borders */
    --border: 1px solid rgba(255, 255, 255, 0.1);

    /* Hover States / Accents */
    --hover-bg: #fff;
    --hover-c: #000;
}

/* === BASE === */
body {
    width: 95vw;
    margin: auto;
    background-color: var(--bg);
    color: var(--txt);
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

::-webkit-scrollbar {
    display: none;
}

/* === HEADER === */
.header {
    width: 95vw;
    max-width: 1100px;
    margin: 0 auto;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header .logo {
    font-family: "Ahsing", "Poppins", sans-serif;
    font-size: 1.9rem;
    font-weight: 500;
    color: var(--txt);
    user-select: none;
}

/* Dark/Light Toggle Button */
.dark-toggle {
    height: 49px;
    width: 49px;
    border: none;
    border-radius: 50%;
    background-color: var(--glass);
    border: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dark-toggle span {
    position: absolute;
    font-size: 24px;
    color: var(--txt);
    transition: opacity 0.3s ease, transform 0.3s ease;

}

.dark-toggle span:last-child {
    opacity: 0;
    transform: rotate(-360deg);
}

.darkMode .dark-toggle span:first-child {
    opacity: 0;
    transform: rotate(360deg);
}

.darkMode .dark-toggle span:last-child {
    opacity: 1;
    transform: rotate(0deg);
}

.dark-toggle:hover {
    background-color: var(--hover-bg);
}

.dark-toggle:hover span {
    color: var(--hover-c);
}

/* === CONTAINER === */
.container {
    width: 500px;
    max-width: 95vw;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === FORM SECTION === */
.form {
    width: 100%;
    padding: 10px;
    border-radius: 30px;
    border: var(--border);
    background-color: var(--glass);
    flex-shrink: 0;
}

h1 {
    text-transform: uppercase;
    text-align: center;
    font-weight: bold;
    padding: 10px;
}

.form-subtext {
    font-size: 14px;
    font-weight: 500;
    color: var(--txt);
    text-align: center;
    margin-bottom: 15px;
}

.form form {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 10px;
}

.form textarea {
    border: var(--border);
    border-radius: 30px;
    background: transparent;
    field-sizing: content;
    resize: none;
    outline: none;
    align-content: center;
    font-size: 14px;
    min-height: 42px;
    max-height: 200px;
    padding: 5px 21px;
    color: var(--txt);
    overflow: hidden;

}

textarea::placeholder {
    color: var(--txt);
    opacity: 0.75;
}

.form button {
    height: 42px;
    padding: 0 28px;
    border: var(--border);
    border-radius: 30px;
    background-color: var(--glass);
    color: var(--txt);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form form button:hover {
    background-color: var(--bg-hovr);
    color: var(--txt-hovr);
}

/* === FILTER BUTTONS === */
.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.filter-buttons button {
    height: 42px;
    padding: 0px 28px;
    border: var(--border);
    border-radius: 30px;
    background-color: var(--glass);
    color: var(--txt);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-buttons button:hover {
    background-color: var(--glass-hovr);
    transform: translateY(-2.5px);
}

.filter-buttons button.active {
    background-color: var(--hover-bg);
    color: var(--hover-c);
    /* transform: scale(1.05); */
}

/* === TASK LIST === */
.list-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.list {
    list-style: none;
}

.list li {
    min-height: 42px;
    margin-top: 10px;
    padding: 5px 10px;
    display: grid;
    grid-template-columns: 30px 30px 1fr 30px;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    background-color: var(--glass);
    border: var(--border);
    border-radius: 30px;
    transition: all 0.3s ease;
    animation: fadeIn 0.75s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list li:hover {
    background-color: var(--glass-hovr);
    transform: translateY(-2.5px);
}

/* === TASK ITEM CONTENT === */
.list li .content {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
    max-height: 3rem;
    transition: max-height 0.5s ease;
}

.list li .content:hover {
    white-space: normal;
    max-height: 10em;
}

/* === STAR ICON === */
.star-icon span {
    cursor: pointer;
    font-size: 24px;
    transition: color 0.3s ease;
    color: var(--txt);
}

.star-icon span.active {
    font-variation-settings:
        'FILL' 1,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    user-select: none;
    color: gold;
}

.star-icon span:hover {
    color: gold;
}

/* === ICONS === */
.list li .complete-icon span,
.list li .close-icon span {
    font-size: 24px;
    display: flex;
    cursor: pointer;
    user-select: none;
}

.list li.complete {
    opacity: 0.75;
}

.list li.complete .content {
    text-decoration: line-through;
}

.list li.complete .complete-icon span {
    color: rgb(0, 200, 0);
}

.list li.complete .close-icon span {
    color: rgb(200, 0, 0);
}

.close-icon span:hover {
    color: red;
    font-weight: bolder;
}

/* === REMOVAL ANIMATION === */
.list li.removed {
    opacity: 0;
    transform: scale(0.75);
}

/* Clear All Button */
.clear-all {
    height: 42px;
    padding: 0 28px;
    border: 1px solid red;
    border-radius: 30px;
    background-color: transparent;
    color: red;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.clear-all:hover {
    background-color: red;
    color: #fff;
    transform: translateY(-2.5px);
}

/* Back to Top Button */
.back-to-top {
    height: 42px;
    padding: 0 28px;
    border: 1px solid var(--txt);
    border-radius: 30px;
    background-color: var(--glass);
    color: var(--txt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease, transform 0.3s ease;
}

/* Hover effect */
.back-to-top:hover {
    background-color: var(--hover-bg);
    color: var(--hover-c);
    transform: translateY(-2.5px);
}


/* === RESPONSIVE === */
@media (max-width: 450px) {
    .form form {
        grid-template-columns: 1fr;
    }

    .form form button {
        width: 100%;
    }
}