:root {
    --bg-image: url('src/background.jpg');
    --app-bg: rgba(255, 255, 255, 0.85);
    --text-color: #333;
    --h2-color: #002765;
    --accent: #ff5945; 
    --border: rgba(0, 0, 0, 0.1);
    --list-item-bg: rgba(0, 0, 0, 0.05);
}

.dark-theme {
    
    --bg-image: url('src/darkbackground.jpg');
    --app-bg: rgba(10, 10, 10, 0.75);
    --text-color: #fff;
    --h2-color: #fef08a;
    --accent: #fef08a;
    --border: rgba(255, 255, 255, 0.1);
    --list-item-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: background 0.4s ease, color 0.3s ease;
}

body {
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.todo-app {
    width: 100%;
    max-width: 500px;
    background: var(--app-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.todo-app h2 {
    color: var(--h2-color);
    font-weight: 600;
}

#theme-toggle {
    background: var(--accent);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.row {
    display: flex;
    background: var(--list-item-bg);
    border-radius: 30px;
    padding-left: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px;
    color: var(--text-color);
}

.add-btn {
    border: none;
    outline: none;
    padding: 12px 30px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    border-radius: 30px;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 13px;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

ul li {
    list-style: none;
    font-size: 17px;
    padding: 12px 45px;
    user-select: none;
    cursor: pointer;
    position: relative;
    color: var(--text-color);
    border-radius: 10px;
}

ul li:hover { background: var(--list-item-bg); }

ul li::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

ul li.checked {
    opacity: 0.6;
    text-decoration: line-through;
}

ul li.checked::before {
    background: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

ul li span {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    font-size: 20px;
    color: #888;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
}

ul li span:hover { background: rgba(255, 0, 0, 0.1); color: red; }

.fade-out {
    animation: fadeOutAnim 0.4s ease forwards;
}

@keyframes fadeOutAnim {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.edit-input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 5px;
    color: var(--text-color);
    padding: 5px;
    outline: none;
}
.clear-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 0 5px;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
}

.clear-btn:hover {
    color: #ef4444;
    opacity: 1;
}

.todo-app {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 
                0 0 20px rgba(254, 240, 138, 0.05);
    border: 1px solid rgba(254, 240, 138, 0.15); 
}

#list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

#list-container::-webkit-scrollbar {
    width: 6px;
}

#list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#list-container::-webkit-scrollbar-thumb {
    background: var(--accent); 
    border-radius: 10px;
}

.row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(254, 240, 138, 0.3);
    transform: translateY(-1px);
}

.clear-btn {
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    text-decoration: none;
}

ul li.checked {
    transition: color 0.3s ease;
}

ul li.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 45px;
    width: 0;
    height: 1px;
    background: var(--text-secondary);
    animation: strike 0.3s ease forwards;
}

@keyframes strike {
    to { width: calc(100% - 80px); }
}

ul li:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    border-left: 2px solid var(--accent);
    padding-left: 43px;
}

.clear-btn {
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.02);
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

ul li:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.1s ease; 
}

.add-btn:active, .filter-btn:active, #theme-toggle:active {
    transform: scale(0.92);
    filter: brightness(0.9); 
}

@media (max-width: 600px) {
    .todo-app {
        width: 95%; /* Que aproveche casi todo el ancho */
        padding: 20px;
    }

    ul li {
        padding: 15px 50px; /* Más espacio para el dedo */
        font-size: 16px; /* Texto un pelín más grande */
    }

    ul li span {
        width: 44px; /* Tamaño mínimo recomendado por Google para botones táctiles */
        height: 44px;
        line-height: 44px;
    }
}