:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-accent: #8b5cf6;
    --secondary-accent: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Mesh */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
    filter: blur(40px);
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: 1rem;
    transition: transform 0.3s ease;
}

header {
    margin-bottom: 2rem;
}

header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#date-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Input Area */
.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    position: relative;
}

input[type="text"] {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

input[type="date"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 50px;
    /* fallback */
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="date"]:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

#add-btn {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
    border: none;
    border-radius: 16px;
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

#add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.5);
}

#add-btn:active {
    transform: translateY(0);
}

/* Todo List */
.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.3s ease-out forwards;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Custom Checkbox */
.check-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.todo-item.completed .check-btn {
    background: var(--success);
    border-color: var(--success);
}

.check-btn svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    color: white;
}

.todo-item.completed .check-btn svg {
    opacity: 1;
    transform: scale(1);
}

.task-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 400;
    word-break: break-all;
    transition: color 0.3s ease;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.task-date {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.todo-item:hover .delete-btn,
.delete-btn:focus {
    opacity: 1;
    transform: translateX(0);
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.empty-state.visible {
    display: block;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}