/* --- ESTILOS GENERALES --- */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
    color: #333;
}

.hidden {
    display: none !important;
}

/* --- MODAL DE LOGIN --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content h2 { margin-bottom: 20px; color: #222; }

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.error-msg { color: #dc3545; font-size: 14px; margin-top: 10px; }

/* --- CONTENEDOR PRINCIPAL --- */
#appContainer {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 { margin: 0; color: #1a1a1a; }

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* --- FORMULARIO DE TAREAS --- */
.form-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.form-card h3 { margin-top: 0; margin-bottom: 20px; }

input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
}

textarea { resize: vertical; }

.btn-primary {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary:hover { background-color: #218838; }

/* --- LISTA DE TAREAS REPARADA (FLEXBOX) --- */
#listaTareas {
    list-style: none;
    padding: 0;
}

.task-item {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between; /* Separa info de acciones */
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.task-item:hover { transform: translateY(-2px); }

/* Izquierda: Checkbox + Texto */
.task-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex: 1;
}

.task-info input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 5px;
    cursor: pointer;
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-content strong { font-size: 1.1em; color: #333; }
.text-content small { color: #666; line-height: 1.4; }

.badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: bold;
    padding: 3px 10px;
    background: #f0f2f5;
    border-radius: 12px;
    width: fit-content;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Derecha: Acciones */
.actions {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.actions button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.actions button:hover { background: #e2e6ea; border-color: #adb5bd; }

/* Estado completado */
.task-item.completed {
    opacity: 0.6;
    background: #f1f3f5;
}

.task-item.completed .text-content strong,
.task-item.completed .text-content small {
    text-decoration: line-through;
    color: #888;
}

/* Responsive */
@media (max-width: 600px) {
    .task-item { flex-direction: column; align-items: flex-start; }
    .actions { margin-left: 0; margin-top: 15px; width: 100%; justify-content: flex-end; }
}

/* --- PAGINACIÓN --- */
.paginacion-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-page {
    background-color: #f0f2f5;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    transition: background 0.2s;
}

.btn-page:hover:not(:disabled) {
    background-color: #e2e6ea;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paginacion-container span {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}