:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #8b5cf6; /* Violet */
    --accent-hover: #7c3aed;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --font-family: 'Inter', 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;
}

/* Background Ambient Shapes */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-color), transparent);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #3b82f6, transparent);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

/* Main Container */
.container {
    width: 90%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: slideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Input Area */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    position: relative;
}

input[type="text"] {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

button#add-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    width: 54px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

button#add-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

button#add-btn:active {
    transform: scale(0.95);
}

/* 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 rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    animation: itemEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes itemEnter {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.todo-item.removing {
    animation: itemExit 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

@keyframes itemExit {
    to { opacity: 0; transform: scale(0.9) translateX(20px); margin-bottom: -60px; }
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.todo-item.completed .checkbox {
    background: var(--success-color);
    border-color: var(--success-color);
}

.checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.todo-item.completed .checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.text {
    font-size: 1rem;
    transition: all 0.3s ease;
    word-break: break-all;
}

.todo-item.completed .text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-style: italic;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.empty-state.hidden {
    display: none;
}
