/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variáveis CSS para temas */
:root {
    /* Tema Claro (padrão) */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --task-bg: #f8f9fa;
    --task-border: #667eea;
    --task-completed: #28a745;
    --shadow: 0 10px 30px rgba(0,0,0,0.2);
    --input-border: #e0e0e0;
    --input-focus: #667eea;
    --btn-primary: #667eea;
    --btn-primary-hover: #5a6fd8;
    --btn-edit: #ffc107;
    --btn-edit-hover: #e0a800;
    --btn-delete: #dc3545;
    --btn-delete-hover: #c82333;
    --message-success: #28a745;
    --message-error: #dc3545;
    --message-info: #17a2b8;
}

/* Tema Escuro */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: #2d3748;
    --task-bg: #1a202c;
    --task-border: #4a90e2;
    --task-completed: #48bb78;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
    --input-border: #2d3748;
    --input-focus: #4a90e2;
    --btn-primary: #4a90e2;
    --btn-primary-hover: #357abd;
    --btn-edit: #ed8936;
    --btn-edit-hover: #dd6b20;
    --btn-delete: #e53e3e;
    --btn-delete-hover: #c53030;
    --message-success: #48bb78;
    --message-error: #e53e3e;
    --message-info: #4299e1;
}

/* Transições suaves para mudança de tema */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Estilos do corpo da página */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

/* Container principal */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Cabeçalho */
.header {
    background: var(--bg-primary);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    flex: 1;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

/* Botão de alternar tema */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 1.5em;
    transition: transform 0.5s ease;
}

[data-theme="dark"] .theme-icon {
    transform: rotate(180deg);
}

/* Seção de input */
.input-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

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

#taskInput {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#taskInput:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#taskInput::placeholder {
    color: var(--text-secondary);
}

#addTask {
    padding: 15px 25px;
    background: var(--btn-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#addTask:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#addTask:active {
    transform: translateY(0);
}

/* Estatísticas */
.stats {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Seção de tarefas */
.tasks-section {
    padding: 30px;
    background: var(--bg-secondary);
}

/* Item de tarefa */
.task-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--task-bg);
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--task-border);
    border: 1px solid var(--border-color);
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: var(--task-completed);
}

/* Checkbox da tarefa */
.task-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--task-completed);
}

/* Texto da tarefa */
.task-text {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
}

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

/* Ações da tarefa */
.task-actions {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-delete {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-edit {
    background: var(--btn-edit);
    color: #333;
}

.btn-edit:hover {
    background: var(--btn-edit-hover);
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--btn-delete);
    color: white;
}

.btn-delete:hover {
    background: var(--btn-delete-hover);
    transform: translateY(-1px);
}

/* Estado vazio */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 18px;
}

.empty-state div {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Mensagens de notificação */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.message.success {
    background: var(--message-success);
}

.message.error {
    background: var(--message-error);
}

.message.info {
    background: var(--message-info);
}

/* Animações */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animação de entrada para tarefas */
.task-item {
    animation: fadeIn 0.5s ease;
}

/* Efeito de pulse no botão de tema */
.theme-toggle:hover .theme-icon {
    animation: pulse 1s infinite;
}

/* Responsividade para mobile */
@media (max-width: 480px) {
    .input-group {
        flex-direction: column;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .input-section,
    .tasks-section {
        padding: 20px;
    }
    
    .theme-toggle {
        width: 45px;
        height: 45px;
    }
}

/* Melhorias de acessibilidade */
.task-checkbox:focus,
#taskInput:focus,
#addTask:focus,
.btn-edit:focus,
.btn-delete:focus,
.theme-toggle:focus {
    outline: 2px solid var(--input-focus);
    outline-offset: 2px;
}

/* Estados de loading (para futuras funcionalidades) */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Scrollbar personalizada */
.tasks-section::-webkit-scrollbar {
    width: 8px;
}

.tasks-section::-webkit-scrollbar-track {
    background: var(--task-bg);
    border-radius: 4px;
}

.tasks-section::-webkit-scrollbar-thumb {
    background: var(--btn-primary);
    border-radius: 4px;
}

.tasks-section::-webkit-scrollbar-thumb:hover {
    background: var(--btn-primary-hover);
}

/* Efeitos especiais para tema escuro */
[data-theme="dark"] .task-item {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .task-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

/* Animação de transição de tema */
.container,
.task-item,
#taskInput,
#addTask {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
} 