@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(120%); }
}

@keyframes progress-animation {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --border-color: #334155;
    --hover-color: #2d3748;
    --checkbox-background: #334155;
    --progress-background: #334155;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #eab308;
}

[data-theme="light"] {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --hover-color: #f8fafc;
    --checkbox-background: #e2e8f0;
    --progress-background: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    padding: 2rem;
    transition: all 0.3s ease;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: var(--hover-color);
    transform: scale(1.05);
}

/* Header */
h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Progress Container */
.progress-container {
    margin-bottom: 2rem;
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.progress-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: var(--progress-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 12px;
    background-image: linear-gradient(
        45deg, 
        rgba(255,255,255,.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,.15) 50%, 
        rgba(255,255,255,.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-animation 1s linear infinite;
}

.progress-text {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Add Item Form */
.add-item-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-item-form input,
.add-item-form select {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 1rem;
    flex: 1;
    transition: all 0.3s ease;
}

.add-item-form input:focus,
.add-item-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.add-item-form button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    min-width: 100px;
}

.add-item-form button:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Categories and Items */
.category {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
}

.category:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.category h2 {
    color: var(--secondary-color);
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.checklist-item:hover {
    background-color: var(--hover-color);
    border-radius: 8px;
    transform: translateX(-4px);
}

.checklist-item:last-child {
    border-bottom: none;
}

/* Custom Checkbox */
.checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--checkbox-background);
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-custom:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-custom.checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-custom.checked::after {
    display: block;
}

.item-label {
    margin-right: 8px;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Delete Button */
.delete-item {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.checklist-item:hover .delete-item {
    opacity: 0.7;
}

.delete-item:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    padding: 1rem;
    border-radius: 12px;
    background: var(--card-background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: slideIn 0.3s ease forwards;
}

.notification.success {
    border-right: 4px solid var(--success-color);
}

.notification.error {
    border-right: 4px solid var(--error-color);
}

.notification.warning {
    border-right: 4px solid var(--warning-color);
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1rem;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.notification-close {
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-size: 1.2rem;
}

.notification-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .theme-toggle {
        top: auto;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .add-item-form {
        flex-direction: column;
    }

    .notification {
        min-width: auto;
        width: calc(100vw - 40px);
        margin: 0 20px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .category h2 {
        font-size: 1.25rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}