:root {
    --bg-color: #e0e5ec;
    --text-color: #4a5568;
    --text-secondary: #718096;
    --shadow-light: #ffffff;
    --shadow-dark: #a3b1c6;
    --accent-color: #667eea;
    --success-color: #48bb78;
    --warning-color: #f6ad55;
    --danger-color: #f56565;
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 
        9px 9px 16px var(--shadow-dark),
        -9px -9px 16px var(--shadow-light);
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), #9f7aea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.date-display {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    text-align: center;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    transition: var(--transition);
}

.stat-card:active {
    box-shadow: 
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Add Task Section */
.add-task-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    background: var(--bg-color);
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: 
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
}

.task-input {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
}

.task-input::placeholder {
    color: var(--text-secondary);
}

.priority-select {
    padding: 10px 15px;
    background: var(--bg-color);
    border: none;
    border-radius: 12px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    box-shadow: 
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
    transition: var(--transition);
}

.priority-select:focus {
    box-shadow: 
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
}

.add-btn {
    padding: 12px;
    background: var(--bg-color);
    border: none;
    border-radius: 12px;
    color: var(--accent-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
}

.add-btn:active {
    transform: translateY(0);
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--bg-color);
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.filter-btn:hover {
    transform: translateY(-2px);
}

.filter-btn.active {
    color: var(--accent-color);
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

/* Tasks List */
.tasks-section {
    min-height: 300px;
    margin-bottom: 20px;
}

.tasks-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    margin-bottom: 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

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

.task-item.completed {
    opacity: 0.7;
}

.task-item.completed .task-content {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: 
        inset 3px 3px 6px var(--shadow-dark),
        inset -3px -3px 6px var(--shadow-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.task-checkbox:hover {
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

.task-checkbox.checked {
    background: var(--success-color);
    box-shadow: 
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.task-content {
    flex: 1;
    font-size: 16px;
    color: var(--text-color);
}

.task-priority {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-high {
    background: var(--danger-color);
    color: white;
}

.priority-medium {
    background: var(--warning-color);
    color: white;
}

.priority-low {
    background: var(--success-color);
    color: white;
}

.task-delete {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
}

.task-delete:hover {
    color: var(--danger-color);
    background: rgba(245, 101, 101, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state-sub {
    font-size: 14px;
    opacity: 0.7;
}

/* Actions Section */
.actions-section {
    margin-top: 30px;
    text-align: center;
}

.clear-btn {
    padding: 12px 30px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--border-radius);
    color: var(--danger-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
}

.clear-btn:active {
    transform: translateY(0);
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 30px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .app-title {
        font-size: 28px;
    }

    .stats-section {
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 20px;
    }

    .filter-section {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .task-item {
        padding: 15px;
    }

    .task-content {
        font-size: 15px;
    }

    .input-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .task-input {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }

    .priority-select {
        flex: 1;
    }
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    z-index: 1000;
    display: none;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

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

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --text-color: #eee;
        --text-secondary: #999;
        --shadow-light: #252541;
        --shadow-dark: #0f0f1e;
    }
}