/* ============================================================
    Importación de fuentes externas para mejorar la tipografía
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,200;0,400;0,500;0,600;0,700;1,600&display=swap');

/* ============================================================
    Reset de estilos y configuración global
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
    Estilos generales del body y fondo de la app
   ============================================================ */
body {
    font-family: "Jost", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url(./images/background-image.jpg) no-repeat center center/cover;
}

/* ============================================================
    Contenedor principal centrado con layout de sidebar
   ============================================================ */
.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-height: 100vh;
    padding: 40px 20px;
    gap: 30px;
}

/* ============================================================
    Sidebar para gestión de listas - Microsoft To-Do Style
   ============================================================ */
.lists-sidebar {
    width: 280px;
    max-height: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 40px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.create-list-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(4, 252, 87, 0.8);
    border: 2px solid rgba(4, 252, 87, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-list-btn:hover {
    transform: scale(1.1);
    background: #04fc57;
    box-shadow: 0 4px 15px rgba(4, 252, 87, 0.3);
}

.lists-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.list-item.active {
    background: rgba(4, 252, 87, 0.2);
    border-color: rgba(4, 252, 87, 0.4);
}

.list-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
}

.list-name {
    flex: 1;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: text;
    transition: all 0.2s ease;
}

.list-name:hover {
    opacity: 0.8;
}

.list-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* ============================================================
    Header de la aplicación con opciones de lista
   ============================================================ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0;
    flex: 1;
}

.list-options {
    display: flex;
    gap: 10px;
}

.list-option-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.list-option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.list-option-btn:first-child:hover {
    background: rgba(4, 252, 87, 0.3);
    border-color: rgba(4, 252, 87, 0.5);
}

.list-option-btn:last-child:hover {
    background: rgba(248, 0, 0, 0.3);
    border-color: rgba(248, 0, 0, 0.5);
}

/* ============================================================
    Tarjeta principal de la Todo App - Ajustada para layout con sidebar
   ============================================================ */
.todo-app {
    width: 100%;
    max-width: 550px;
    max-height: none;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 25px;
    color: #fff;
    border-radius: 25px;
    box-shadow: 0 0 120px rgba(0, 0, 0, 0.6), 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    overflow: visible;
}



/* ============================================================
    Sección de estadísticas y barra de progreso - Mejorada
   ============================================================ */
.stat-container {
    padding: 25px 30px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.stat-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.35);
}

.details {
    width: 100%;
}

.details h3 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    transition: all 0.3s ease;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Barra de progreso visual - Más visible y atractiva */
#progressbar {
    width: 100%;
    height: 14px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    margin-top: 15px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Indicador de progreso - Con animación suave */
#progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #04fc57, #00d547, #04fc57);
    background-size: 200% 100%;
    border-radius: 25px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 15px rgba(4, 252, 87, 0.6);
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Efecto de brillo en el progreso */
#progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
    border-radius: 25px;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================================
    Estadísticas numéricas de tareas - Mejoradas
   ============================================================ */
#numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(255, 194, 209, 0.5), rgba(255, 154, 189, 0.5));
    font-weight: bold;
    margin-top: 15px;
    font-size: 1.4rem;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(255, 194, 209, 0.3);
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

#numbers:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 8px 25px rgba(255, 194, 209, 0.4);
}

/* ============================================================
    Área de entrada para agregar nuevas tareas - Mejorada
   ============================================================ */
.input-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px; /* Mayor espacio entre input y botón */
}

.input-area input {
    flex: 1;
    padding: 15px 20px; /* Mayor padding */
    font-size: 1.2rem; /* Fuente más grande */
    border: none;
    outline: none;
    border-radius: 25px; /* Más redondeado */
    background: rgba(255, 255, 255, 0.1); /* Fondo más sutil */
    color: #fff; /* Texto blanco */
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.input-area input:focus {
    border-color: #04fc57;
    box-shadow: 0 0 20px rgba(4, 252, 87, 0.3);
    transform: scale(1.02);
}

.input-area input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Botón para agregar tarea - Más grande y atractivo */
.input-area button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Mayor padding */
    border-radius: 50%;
    color: #fff;
    font-size: 1.3rem; /* Icono más grande */
    background: rgba(4, 252, 87, 0.8);
    border: 2px solid rgba(4, 252, 87, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(4, 252, 87, 0.3);
}

.input-area button:hover {
    transform: scale(1.1);
    background: #04fc57;
    box-shadow: 0 6px 20px rgba(4, 252, 87, 0.4);
}

/* ============================================================
    Contenedor de la lista de tareas y estado vacío - Mejorado
   ============================================================ */
.todos-container {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 0;
}

/* ============================================================
    Lista de tareas - UI más grande y clara
   ============================================================ */
#task-list {
    width: 100%;
}

#task-list li {
    list-style: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    padding: 18px 22px;
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#task-list li:hover {
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    border-color: rgba(4, 252, 87, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
}

/* ============================================================
    Checkbox personalizado para marcar tareas completadas - Mejorado
   ============================================================ */
#task-list li .checkbox {
    min-width: 24px; /* Más grande */
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#task-list li .checkbox:checked {
    background: #04fc57;
    border-color: #04fc57;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(4, 252, 87, 0.5);
}

#task-list li .checkbox:checked::before {
    content: '✔';
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.1rem; /* Más grande */
    font-weight: bold;
}

/* Texto de la tarea - Mayor tamaño */
#task-list li span {
    flex: 1;
    margin: 0 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-weight: 500;
}

/* ============================================================
    Imagen mostrada cuando no hay tareas
   ============================================================ */
.empty-image {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ============================================================
    Botones de edición y eliminación de tareas - Mejorados
   ============================================================ */
.task-buttons {
    display: flex;
    gap: 12px; /* Mayor espacio */
    margin-right: auto;
}

.task-buttons button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 36px; /* Más grandes */
    height: 36px;
    color: #fff;
    font-size: 0.9rem; /* Ligeramente más grande */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.task-buttons button:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Botón de edición - Color azul */
.task-buttons .edit-btn {
    background: rgba(30, 144, 255, 0.8);
    border: 2px solid rgba(30, 144, 255, 0.4);
}

.task-buttons .edit-btn:hover {
    background: #1e90ff;
    border-color: #1e90ff;
}

/* Botón de eliminación - Color púrpura */
.task-buttons .delete-btn {
    background: rgba(178, 0, 248, 0.8);
    border: 2px solid rgba(178, 0, 248, 0.4);
}

.task-buttons .delete-btn:hover {
    background: #b200f8;
    border-color: #b200f8;
}

/* ============================================================
    Tareas completadas: estilo tachado y color atenuado
   ============================================================ */
#task-list li.completed span {
    text-decoration: line-through;
    color: #aaa; 
}

/* ============================================================
    Animación de confeti para cuando se completan todas las tareas
   ============================================================ */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================================
    Responsive Design - Mobile adaptado para sidebar
   ============================================================ */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
        height: auto;
        min-height: 100vh;
    }
    
    .lists-sidebar {
        width: 100%;
        max-width: 400px;
        max-height: 200px;
        order: -1;
    }
    
    .lists-container {
        max-height: 120px;
    }
    
    .todo-app {
        width: 100%;
        max-width: 400px;
        max-height: none;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .list-option-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}