:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #ec4899;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-color: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    --danger: #ef4444;
    --success: #22c55e;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: moveBlob 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #a5b4fc;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #f9a8d4;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #c4b5fd;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -10s;
}

@keyframes moveBlob {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 50px) rotate(20deg); }
}

.app-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width:100%;
    max-width: 800px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #4f46e5, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
    color: var(--text-muted);
}

.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.stat-box {
    text-align: center;
    flex: 1;
    position: relative;
}

.stat-box:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-section {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.progress-percent {
    color: var(--primary-color);
    font-weight: 700;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.input-group {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 16px;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#todo-input {
    flex: 2;
    background: transparent;
    border: none;
    padding: 0.8rem;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-family);
    outline: none;
}

#todo-input::placeholder {
    color: #94a3b8;
}

#todo-date {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.6rem;
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.add-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.actions-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

#search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.9rem;
}

.delete-all-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-all-btn:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.3);
}

.filter-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.3);
}

.todo-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.todo-item {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.05);
}

.todo-item.completed {
    opacity: 0.7;
    background: #f1f5f9;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.check-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.todo-item.completed .check-btn {
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
}

.todo-info {
    display: flex;
    flex-direction: column;
}

.todo-text {
    font-size: 1.05rem;
    font-weight: 500;
    word-break: break-word;
    color: var(--text-color);
}

.todo-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.delete-btn {
    background: #fee2e2;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.6rem;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    margin-left: 0.5rem;
}

.edit-btn {
    background: #e0f2fe;
    border: none;
    color: #0284c7;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.6rem;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    margin-left: 0.5rem;
}

/* Show buttons on hover */
.todo-item:hover .delete-btn,
.todo-item:hover .edit-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.edit-btn:hover {
    background: #0284c7;
    color: white;
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
}

.fall {
    transform: translateY(10rem) rotateZ(20deg);
    opacity: 0;
}

@media (max-width: 600px) {
    .app-container {
        padding: 1.5rem;
        width: 95%;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #todo-input {
        width: 100%;
    }

    #todo-date {
        width: 100%;
    }

    .add-btn {
        width: 100%;
        border-radius: 8px;
    }
    
    .actions-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .delete-all-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-section {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.5rem;
        text-align: center;
    }

    /* Show actions by default on mobile */
    .delete-btn, .edit-btn {
        opacity: 1;
    }
}

.app-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.8rem;
    color: var(--text-muted);
}
