/* ===== VARIÁVEIS E BASE ===== */
:root {
    --bg-light: #f4f6fb;
    --bg-dark: #1e1e1e;
    --card-light: #ffffff;
    --card-dark: #2a2a2a;
    --primary: #4CAF50;
    --primary-hover: #43a047;
    --danger: #e53935;
    --warning: #fb8c00;
    --text-light: #333;
    --text-dark: #f4f4f4;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    margin: 0;
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
}

.app {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#themeToggle {
    font-size: 24px;
    border: none;
    background: none;
    cursor: pointer;
    transition: transform 0.2s;
}

#themeToggle:hover {
    transform: rotate(15deg) scale(1.1);
}

/* ===== FORMULÁRIO DE TAREFAS ===== */
.task-form {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.task-form input,
.task-form select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    flex: 1;
    font-size: 1rem;
}

.task-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.task-form button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ===== CONTROLES E FILTROS ===== */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.03);
    padding: 10px 15px;
    border-radius: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls button {
    background: none;
    border: 1px solid #ccc;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

/* ===== KANBAN (GRID) ===== */
.kanban {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.column {
    background: #eef1f7;
    padding: 15px;
    border-radius: 14px;
    min-height: 300px;
    transition: background 0.3s;
}

.column h3 {
    margin-top: 0;
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

/* ===== ITENS DA TAREFA COLORIDOS ===== */
ul {
    list-style: none;
    padding: 0;
}

.task-item {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: 0.2s;
    border-left: 6px solid transparent;
    background: var(--card-light); /* Fallback */
}

/* Cores de Fundo por Prioridade */
.task-item.alta { background: #fff5f5; border-color: var(--danger); }
.task-item.media { background: #fff9f0; border-color: var(--warning); }
.task-item.baixa { background: #f5fff5; border-color: var(--primary); }

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Botão Circular de Check */
.btn-complete {
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: 0.2s;
    color: transparent;
    font-weight: bold;
}

.btn-complete:hover {
    border-color: var(--primary);
}

/* Estilo para Tarefa Concluída */
.task-item.done {
    opacity: 0.6;
    background: #f0f0f0 !important;
    border-color: #bbb !important;
}

.task-item.done .btn-complete {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.task-item.done .task-text {
    text-decoration: line-through;
}

.task-content {
    flex: 1;
}

.task-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.task-text {
    font-weight: 500;
}

/* ===== BADGES E PRIORIDADES ===== */
.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    color: white;
}

.alta .badge { background: var(--danger); }
.media .badge { background: var(--warning); }
.baixa .badge { background: var(--primary); }

.late-badge {
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== AÇÕES (EDITAR/EXCLUIR) ===== */
.task-actions button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: 0.2s;
}

.task-actions button:hover {
    transform: scale(1.2);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal.show {
    display: flex;
}

.modal-box {
    background: white;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ===== DARK MODE OVERRIDES (CORES VIBRANTES) ===== */
.dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

.dark .column { background: #2b2b2b; }
.dark .task-item { color: white; }
.dark .task-item.alta { background: #442a2a; }
.dark .task-item.media { background: #443a2a; }
.dark .task-item.baixa { background: #2a442a; }
.dark .task-item.done { background: #333 !important; }

.dark .modal-box { background: var(--card-dark); color: white; }
.dark .controls { background: rgba(255,255,255,0.05); }
.dark .overdue { border-style: dashed; }
.dark .controls button { color: white; border-color: #444; }

/* ===== RESPONSIVIDADE ===== */

@media (max-width: 768px) {
    .kanban { grid-template-columns: 1fr; }
    .column { min-height: auto; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.5rem; }
    .task-form { flex-direction: column; }
    .task-form input, .task-form select, .task-form button { width: 100%; flex: none; }
    .controls { flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
    .filter-group { justify-content: space-between; }
    .task-main { flex-direction: column; align-items: flex-start; gap: 8px; }
}
