* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estructura general y contenedor principal */

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #f4f7f8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: #1e1e1e;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

/* Formulario de creación de tareas */

#task-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#task-title {
    flex: 1 1 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #333;
    background-color: #2d2d2d !important;
    color: #fff;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

#task-title:hover {
    border-color: rgba(0, 123, 255, 0)
}

#task-title:focus {
    border-color: #007bff;
    outline: none;
}

#task-form button {
    flex: 0 0 auto;
    padding: 10px 20px;
    background-color: #007bff;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#task-form button:hover {
    background-color: #0056b3;
}

/* Lista de tareas y estados */

#task-list {
    list-style: none;
    padding: 0;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.task-text {
    flex: 1;
    font-size: 16px;
    color: #eee;
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #666;
}

.task-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
    align-items: center;
    margin-left: 10px;
}

#task-list .task-item .task-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#task-list .task-item .task-actions button:hover {
    transform: scale(1.1);
}

.edit-btn {
    font-size: 16px;
}

.action-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    display: block;
}

/* Modal de edición de tareas */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.modal-content h2 {
    margin-bottom: 12px;
}

#edit-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#edit-task-title {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #333;
    background-color: #2d2d2d;
    color: #fff;
    border-radius: 5px;
}

#edit-task-title:focus {
    border-color: #007bff;
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#cancel-edit,
#save-edit {
    padding: 8px 14px;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

#cancel-edit {
    background-color: #555;
}

#save-edit {
    background-color: #007bff;
}

/* Ajustes responsive */

@media (max-width: 400px) {
    #task-form {
        flex-direction: column;
    }
    #task-form button {
        width: 100%;
    }
}