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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --border-color: #bdc3c7;
    --text-color: #2c3e50;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.status.online {
    background: #d4edda;
    color: #155724;
}

.status.offline {
    background: #f8d7da;
    color: #721c24;
}

.install-btn {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.install-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

main {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.todo-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.todo-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.add-btn {
    padding: 12px 24px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--light-bg);
    color: var(--text-color);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #d5dbdb;
}

.filter-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.stats {
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.todo-list {
    list-style: none;
    flex: 1;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

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

.todo-item:hover {
    background: white;
    box-shadow: var(--shadow);
    border-color: var(--secondary-color);
}

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

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #95a5a6;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success-color);
    flex-shrink: 0;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    word-break: break-word;
    transition: all 0.3s ease;
}

.todo-delete {
    padding: 6px 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.todo-delete:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.todo-delete:active {
    transform: scale(0.95);
}

.clear-btn {
    width: 100%;
    padding: 12px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.clear-btn:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
}

footer {
    background: #f8f9fa;
    color: #7f8c8d;
    padding: 15px 20px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
}

@media (max-width: 480px) {
    header h1 {
        font-size: 24px;
    }

    .status-bar {
        flex-direction: column;
        gap: 10px;
    }

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

    .add-btn {
        width: 100%;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }
}

/* Animation pour les changements */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.todo-item.removing {
    animation: fadeOut 0.3s ease forwards;
}
