@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "DM Sans", Arial, Helvetica, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #222;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem;
    background-image: url(https://images.pexels.com/photos/574283/pexels-photo-574283.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Header */
.header {
    width: 100%;
    text-align: center;
    padding: 1.25rem 0;
}

.logo-container h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03rem;
    color: #222;
}

/* Main Container */
.container {
    background: #fff;
    width: 100%;
    max-width: 26.25rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.1);
    text-align: center;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Input Section */
.todo-input {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

#taskInput {
    flex: 1;
    padding: 0.75rem;
    border: 0.0625rem solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease-in-out;
}

#taskInput:focus {
    border-color: #007aff;
    box-shadow: 0 0 0.25rem rgba(0, 122, 255, 0.5);
}

#addTaskBtn {
    background: #007aff;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease-in-out, transform 0.1s;
}

#addTaskBtn:hover {
    background: #005ecb;
}

#addTaskBtn:active {
    transform: scale(0.98);
}

/* Task List */
#taskList {
    list-style: none;
    padding: 0;
}

/* Task Items */
.task-item {
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.625rem;
    transition: background 0.2s ease-in-out, transform 0.1s;
}

.task-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Task Text */
.task-text {
    flex: 1;
    font-size: 1rem;
}

/* Completed Task */
.task-item.completed .task-text {
    text-decoration: line-through;
    color: #888;
}

/* Task Actions (Icons) */
.task-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Edit & Delete Icons */
.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.task-actions i {
    font-size: 1.125rem;
    color: #666;
    transition: color 0.2s ease-in-out, transform 0.1s;
}

.task-actions i:hover {
    color: #222;
    transform: scale(1.2);
}

.task-actions i:active {
    transform: scale(0.9);
}

/* Empty Message */
#emptyMessage {
    color: #666;
}

/* ==================== */
/* Media Queries */
/* ==================== */

/* Tablet (1120px) */
@media (max-width: 70rem) {
    .container {
        max-width: 90%; /* Slightly wider for tablets */
        padding: 1.25rem;
    }

    .logo-container h1 {
        font-size: 1.5rem; /* Slightly smaller header */
    }

    h2 {
        font-size: 1.125rem; /* Smaller heading */
    }

    #taskInput {
        font-size: 0.9375rem; /* Slightly smaller input text */
    }

    #addTaskBtn {
        font-size: 0.9375rem; /* Slightly smaller button text */
    }

    .task-text {
        font-size: 0.9375rem; /* Slightly smaller task text */
    }

    .task-actions i {
        font-size: 1rem; /* Slightly smaller icons */
    }
}

/* Mobile (480px) */
@media (max-width: 30rem) {
    .container {
        max-width: 95%; /* Full width for mobile */
        padding: 1rem;
    }

    .logo-container h1 {
        font-size: 1.25rem; /* Smaller header */
    }

    h2 {
        font-size: 1rem; /* Smaller heading */
    }

    .todo-input {
        flex-direction: column; /* Stack input and button vertically */
        gap: 0.5rem;
    }

    #taskInput {
        width: 100%; /* Full width input */
        font-size: 0.875rem; /* Smaller input text */
    }

    #addTaskBtn {
        width: 100%; /* Full width button */
        font-size: 0.875rem; /* Smaller button text */
    }

    .task-text {
        font-size: 0.875rem; /* Smaller task text */
    }

    .task-actions i {
        font-size: 0.9375rem; /* Smaller icons */
    }
}
