:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(51, 65, 85, 0.8);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --ring: rgba(99, 102, 241, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Background Animations */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #ec4899;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: #06b6d4;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(100px, 50px);
    }
}

/* App Container (Glassmorphism) */
.app-container {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    text-align: center;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a5b4fc, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.app-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Input Section */
.input-group {
    display: flex;
    gap: 0.75rem;
    position: relative;
}

#task-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

#task-input::placeholder {
    color: var(--text-muted);
}

#task-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.add-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

/* List Header */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.list-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.stats {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Task List */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 10px;
}

/* Task Item */
.task-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

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

.checkbox {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: all 0.2s ease;
}

.checkbox::before {
    content: "";
    width: 12px;
    height: 12px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    background-color: CanvasText;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox:checked::before {
    transform: scale(1);
}

.task-title {
    font-size: 1rem;
    transition: all 0.3s ease;
    word-break: break-word;
}

.task-item.completed .task-title {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    display: none;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.task-list:empty+.empty-state,
.task-list:has(> .empty-state:only-child) .empty-state {
    display: block;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .add-btn {
        padding: 1rem;
        justify-content: center;
    }
}

/* Footer (Discreet) */
.app-footer {
    position: absolute;
    bottom: 1rem;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 0 1rem;
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin: 0;
}