*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root{
    --background: #2a2d3b;
    --secondrybgcolor: #3a3f52;
    --text: #e0e0e0;
    --purple: #8a89c0;
    --teal: #6a9c89;
}
body{
    background-color: var(--background);
    color: var(--text);
    padding: 0 15px;
}
.container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .task-list,
    form {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}
main{
    width: 75%;
}
.statContainer{
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 20px;
    border: 2px solid var(--purple);
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .statContainer {
        flex-direction: row;
        align-items: center;
        padding: 30px 40px;
        gap: 40px;
    }
}

#number{
    width: 100%;
    height: 80px;
    background-color: var(--secondrybgcolor);
    border: 2px solid var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    margin-top: 15px;
}

@media (min-width: 768px) {
    #number {
        width: 100px;
        height: 100px;
        margin-top: 0;
    }
}

.progressBar{
    width: 100%;
    height: 10px;
    background-color: var(--secondrybgcolor);
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

.details{
    width: 100%;
}

.progress{
    height: 100%;
    background-color: var(--purple);
    width: 0%;
    transition: width 0.3s ease;
}

form {
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    gap: 15px;
    background: transparent;
    position: relative;
}

@media (min-width: 768px) {
    form {
        margin: 40px 0;
    }
}

.input-container {
    flex: 1;
    position: relative;
    background: linear-gradient(45deg, 
        #8a89c0, 
        #6a9c89, 
        #89c0b8, 
        #c089b8, 
        #c0a089);
    background-size: 300% 300%;
    padding: 2px;
    border-radius: 50px;
    animation: gradientBG 8s ease infinite;
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

@media (min-width: 1200px) {
    .input-container {
        max-width: 900px;
    }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

input {
    width: 100%;
    padding: 14px 18px;
    background: var(--secondrybgcolor);
    border: none;
    border-radius: 50px;
    outline: none;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    padding-right: 60px;
}

@media (min-width: 480px) {
    input {
        padding: 16px 20px;
        font-size: 18px;
    }
}

input:focus {
    box-shadow: 0 0 0 2px rgba(106, 90, 205, 0.3);
}

button {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 46px;
    border: none;
    background: linear-gradient(45deg, #6a5acd, #9370db);
    color: white;
    border-radius: 50px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@media (min-width: 480px) {
    button {
        width: 50px;
        font-size: 24px;
    }
}

button:hover {
    background: linear-gradient(45deg, #9370db, #6a5acd);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(147, 112, 219, 0.5);
}

.task-list{
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    list-style: none;
    padding: 0;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .task-list {
        gap: 20px;
    }
}

.taskItem {
    display: flex;
    padding: 14px 20px;
    background-color: var(--secondrybgcolor);
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    gap: 15px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
main{
    width: 99%;
}
@media (min-width: 768px) {
    .taskItem {
        padding: 16px 24px;
    }
    
    .taskItem:hover {
        transform: translateY(-2px);
        box-shadow: 1px 1px 20px 1px  #8a89c02f;
    }
}

.task {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
}

.task p {
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
    max-width: 100%;
    box-sizing: border-box;
}

.task input[type="checkbox"] {
    min-width: 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--purple);
    position: relative;
    transition: all 0.2s ease;
}

.task input[type="checkbox"]:checked {
    background-color: var(--purple);
    border-color: var(--purple);
}
.task input[type="checkbox"]:hover {
    transform: scale(1.02);
}

.task input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 479px) {
    .container {
        margin: 15px auto;
    }
    
    .task {
        font-size: 14px;
    }
    
    .taskItem {
        padding: 10px 12px;
    }
    
    .icons {
        gap: 6px;
    }
}

/* Completed state */
.task.completed p {
    color: var(--teal);
    text-decoration: line-through;
}

.taskItem img {
    width: 24px;
    height: 24px;
    margin: 0 5px;
    cursor: pointer;
}

.icons .edit-btn {
    filter: invert(47%) sepia(87%) saturate(360%) hue-rotate(198deg) brightness(103%) contrast(101%);
    transition: transform 0.2s ease;
	transform-origin: center;
  }
.icons .delete-btn {
    filter: invert(16%) sepia(89%) saturate(6549%) hue-rotate(1deg) brightness(87%) contrast(121%);
    transition: transform 0.2s ease;
	transform-origin: center;
  }
.icons img:hover{
	animation: subtleTwist 0.4s ease 1;
}
/* for subtle twist animation  */
@keyframes subtleTwist {
	0%, 100% { transform: rotate(0deg); }
	25% { transform: rotate(-13deg); }
	50% { transform: rotate(6.5deg); }
	75% { transform: rotate(-3.25deg); }
}