
        :root {
            --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --primary-gradient-hover: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
            --bg-gradient: linear-gradient(135deg, rgba(245, 247, 250, 0.92) 0%, rgba(228, 232, 240, 0.92) 100%);
            --card-bg: rgba(255, 255, 255, 0.95);
            --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.04);
            --text-title: #1a202c;
            --text-main: #2d3748;
            --text-muted: #718096;
            --danger: #fc8181;
            --success: #68d391;
            --warning: #f6ad55;
            --radius-lg: 20px;
            --radius-md: 14px;
            --radius-sm: 10px;
            --glass-border: 1px solid rgba(255, 255, 255, 0.4);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }

        body {
            background: 
                var(--bg-gradient),
                url('https://images.unsplash.com/photo-1545235617-9465d2a55698?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2080&q=80') center/cover no-repeat fixed;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            position: relative;
            overflow-x: hidden;
        }

        .bg-blur {
            position: fixed;
            width: min(400px, 80vw);
            height: min(400px, 80vw);
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.15;
            z-index: -1;
            pointer-events: none;
        }

        .bg-1 {
            background: #667eea;
            top: 5%;
            left: 5%;
            animation: float 20s infinite ease-in-out;
        }

        .bg-2 {
            background: #764ba2;
            bottom: 5%;
            right: 5%;
            animation: float 25s infinite ease-in-out reverse;
        }

        .bg-3 {
            background: #68d391;
            top: 50%;
            left: 10%;
            animation: float 30s infinite ease-in-out 5s;
            opacity: 0.1;
        }

        @keyframes float {
            0%, 100% { 
                transform: translateY(0) scale(1) rotate(0deg); 
            }
            33% { 
                transform: translateY(-30px) scale(1.05) rotate(120deg); 
            }
            66% { 
                transform: translateY(15px) scale(0.95) rotate(240deg); 
            }
        }

        /* Container */
        .container {
            width: 100%;
            max-width: 520px;
            min-width: 280px;
            animation: slideUp 0.6s ease-out;
            margin: 0 auto;
        }

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

        .app-card {
            background: var(--card-bg);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-radius: var(--radius-lg);
            box-shadow: 
                var(--card-shadow),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
            padding: clamp(25px, 5vw, 40px);
            border: var(--glass-border);
            position: relative;
            overflow: hidden;
            transition: transform 0.3s ease;
        }

        .app-card:hover {
            transform: translateY(-5px);
        }

        .app-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--primary-gradient);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 30px;
            flex-wrap: wrap;
            gap: 16px;
        }

        .header-left h1 {
            font-size: clamp(24px, 5vw, 28px);
            font-weight: 700;
            color: var(--text-title);
            letter-spacing: -0.5px;
            display: flex;
            align-items: center;
            gap: 10px;
            line-height: 1.2;
        }

        .header-left h1 i {
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            font-size: 1.2em;
        }

        .header-left p {
            color: var(--text-muted);
            font-size: clamp(14px, 3vw, 15px);
            margin-top: 4px;
            line-height: 1.4;
        }

        .stats {
            background: rgba(102, 126, 234, 0.08);
            padding: 10px 16px;
            border-radius: var(--radius-md);
            font-weight: 600;
            color: var(--text-title);
            border: 1px solid rgba(102, 126, 234, 0.2);
            font-size: clamp(14px, 3vw, 16px);
            white-space: nowrap;
        }

        .input-section {
            position: relative;
            margin-bottom: 30px;
        }

        .input-group {
            display: flex;
            gap: 0;
            background: rgba(248, 250, 252, 0.9);
            border-radius: var(--radius-md);
            border: 1px solid rgba(226, 232, 240, 0.8);
            transition: var(--transition);
            overflow: hidden;
            min-height: 56px;
        }

        .input-group:focus-within {
            border-color: #667eea;
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
            transform: translateY(-2px);
        }

        .input-group input {
            flex: 1;
            border: none;
            outline: none;
            background: transparent;
            padding: clamp(14px, 3vw, 18px) 20px;
            font-size: clamp(15px, 3vw, 16px);
            color: var(--text-main);
            font-weight: 500;
            min-width: 0; 
        }

        .input-group input::placeholder {
            color: #a0aec0;
            font-weight: 400;
        }

        .btn-add {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0 clamp(20px, 4vw, 26px);
            cursor: pointer;
            font-weight: 600;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            letter-spacing: 0.3px;
            font-size: clamp(14px, 3vw, 16px);
            white-space: nowrap;
        }

        .btn-add:hover, .btn-add:focus {
            background: var(--primary-gradient-hover);
            padding-right: clamp(24px, 5vw, 30px);
        }

        .btn-add:active {
            transform: scale(0.98);
        }

        #todo-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            max-height: min(400px, 60vh);
            overflow-y: auto;
            overflow-x: hidden;
            padding-right: 8px;
            margin-bottom: 10px;
        }

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

        #todo-list::-webkit-scrollbar-track {
            background: rgba(241, 241, 241, 0.5);
            border-radius: 10px;
        }

        #todo-list::-webkit-scrollbar-thumb {
            background: rgba(203, 213, 224, 0.7);
            border-radius: 10px;
        }

        #todo-list::-webkit-scrollbar-thumb:hover {
            background: rgba(160, 174, 192, 0.9);
        }

        /* Todo Item */
        .todo-item {
            display: flex;
            align-items: center;
            padding: clamp(14px, 3vw, 18px) 20px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: var(--radius-md);
            border: 1px solid rgba(237, 242, 247, 0.8);
            transition: var(--transition);
            position: relative;
            animation: fadeIn 0.4s ease-out;
            gap: 12px;
        }

        @keyframes fadeIn {
            from { 
                opacity: 0; 
                transform: translateX(-10px) scale(0.98); 
            }
            to { 
                opacity: 1; 
                transform: translateX(0) scale(1); 
            }
        }

        .todo-item:hover {
            border-color: rgba(102, 126, 234, 0.3);
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        }

        .todo-item.completed {
            background: rgba(247, 250, 252, 0.8);
            opacity: 0.9;
        }

        .todo-item.deleting {
            animation: slideOut 0.3s ease forwards;
        }

        @keyframes slideOut {
            to {
                opacity: 0;
                transform: translateX(100px) scale(0.8);
            }
        }

        .checkbox {
            width: 24px;
            height: 24px;
            border: 2px solid #cbd5e0;
            border-radius: var(--radius-sm);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            flex-shrink: 0;
            position: relative;
        }

        .checkbox:hover {
            border-color: #667eea;
        }

        .checkbox::after {
            content: '✓';
            color: white;
            font-size: 14px;
            font-weight: bold;
            opacity: 0;
            transform: scale(0.5);
            transition: var(--transition);
        }

        .todo-item.completed .checkbox {
            background: var(--success);
            border-color: var(--success);
        }

        .todo-item.completed .checkbox::after {
            opacity: 1;
            transform: scale(1);
        }

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

        .todo-text {
            flex: 1;
            font-size: clamp(15px, 3vw, 16px);
            color: var(--text-main);
            font-weight: 500;
            line-height: 1.5;
            cursor: pointer;
            transition: var(--transition);
            word-break: break-word;
            padding-right: 8px;
        }

        .priority {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            transition: var(--transition);
        }

        .priority.high { 
            background: var(--danger); 
            box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.2);
        }
        .priority.medium { 
            background: var(--warning); 
            box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.2);
        }
        .priority.low { 
            background: #a0aec0; 
            box-shadow: 0 0 0 3px rgba(160, 174, 192, 0.2);
        }

        .actions {
            display: flex;
            gap: 6px;
            opacity: 0.5;
            transition: var(--transition);
            flex-shrink: 0;
        }

        .todo-item:hover .actions,
        .todo-item:focus-within .actions {
            opacity: 1;
        }

        .btn-action {
            width: 34px;
            height: 34px;
            border: none;
            background: #f1f5f9;
            border-radius: var(--radius-sm);
            cursor: pointer;
            color: var(--text-muted);
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        .btn-action:hover, .btn-action:focus {
            background: #e2e8f0;
            color: var(--text-title);
            transform: translateY(-1px);
        }

        .btn-edit:hover, .btn-edit:focus {
            background: rgba(102, 126, 234, 0.1);
            color: #667eea;
        }

        .btn-delete:hover, .btn-delete:focus {
            background: rgba(252, 129, 129, 0.1);
            color: var(--danger);
        }

        .edit-input {
            flex: 1;
            border: 2px solid #667eea;
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            font-size: 16px;
            outline: none;
            color: var(--text-main);
            font-weight: 500;
            background: #fff;
            margin-right: 10px;
            min-width: 0;
        }

        .empty-state {
            text-align: center;
            padding: clamp(30px, 8vw, 40px) 20px;
            color: var(--text-muted);
            animation: fadeIn 0.5s ease;
        }

        .empty-state i {
            font-size: clamp(36px, 10vw, 48px);
            margin-bottom: 16px;
            opacity: 0.5;
            display: block;
        }

        .empty-state p {
            font-size: clamp(14px, 3vw, 16px);
            line-height: 1.5;
        }

        .footer {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid rgba(226, 232, 240, 0.8);
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
            color: var(--text-muted);
            font-size: clamp(13px, 3vw, 14px);
        }

        .task-count {
            white-space: nowrap;
        }

        .filters {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .filter-btn {
            padding: 6px 12px;
            border-radius: 20px;
            border: 1px solid rgba(226, 232, 240, 0.8);
            background: #fff;
            color: var(--text-muted);
            cursor: pointer;
            font-size: clamp(12px, 2.5vw, 13px);
            font-weight: 500;
            transition: var(--transition);
            white-space: nowrap;
        }

        .filter-btn.active, .filter-btn:hover, .filter-btn:focus {
            background: var(--primary-gradient);
            color: white;
            border-color: transparent;
        }

        @media (max-width: 600px) {
            body {
                padding: 12px;
                align-items: flex-start;
                padding-top: 20px;
            }
            
            .app-card { 
                padding: 25px 20px;
                backdrop-filter: blur(15px);
            }
            
            .header { 
                flex-direction: column; 
                align-items: stretch; 
                gap: 16px; 
                margin-bottom: 24px;
            }
            
            .header-left h1 {
                justify-content: center;
                text-align: center;
            }
            
            .stats {
                align-self: center;
                text-align: center;
            }
            
            .input-group {
                flex-direction: column;
                background: transparent;
                gap: 12px;
                border: none;
            }
            
            .input-group input {
                background: rgba(248, 250, 252, 0.9);
                border: 1px solid rgba(226, 232, 240, 0.8);
                border-radius: var(--radius-md);
                padding: 16px;
            }
            
            .btn-add {
                border-radius: var(--radius-md);
                padding: 16px;
                width: 100%;
            }
            
            .todo-item {
                padding: 16px;
                gap: 10px;
            }
            
            .actions {
                opacity: 1;
                position: absolute;
                right: 16px;
                top: 50%;
                transform: translateY(-50%);
                background: rgba(255, 255, 255, 0.9);
                padding: 4px;
                border-radius: var(--radius-sm);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }
            
            .footer {
                flex-direction: column;
                text-align: center;
                gap: 20px;
            }
            
            .filters {
                justify-content: center;
            }
        }

        @media (max-width: 400px) {
            .app-card {
                padding: 20px 16px;
            }
            
            .todo-item {
                flex-wrap: wrap;
            }
            
            .checkbox {
                order: 1;
            }
            
            .priority {
                order: 2;
            }
            
            .todo-text {
                order: 3;
                width: 100%;
                margin-top: 8px;
                margin-bottom: 8px;
            }
            
            .actions {
                order: 4;
                position: static;
                transform: none;
                justify-content: flex-end;
                width: 100%;
                background: transparent;
                box-shadow: none;
                padding: 0;
            }
        }

        #todo-list {
    max-height: 250px;   
    overflow-y: auto;   
}

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

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

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.todo-item .actions button {
    margin-left: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.todo-item .actions button:nth-child(1) {
    background-color: #4f46e5; 
    color: white;
}

.todo-item .actions button:nth-child(1):hover {
    background-color: #3730a3; 
}

.todo-item .actions button:nth-child(2) {
    background-color: #ef4444; 
    color: white;
}

.todo-item .actions button:nth-child(2):hover {
    background-color: #b91c1c; 
}


        @media (hover: none) and (pointer: coarse) {
            .btn-action, .filter-btn, .checkbox {
                min-height: 44px;
                min-width: 44px;
            }
            
            .btn-action {
                width: 44px;
                height: 44px;
            }
            
            .actions {
                opacity: 1;
            }
            
            .todo-item:hover {
                transform: none;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

       