/* TODO:
RESPONSIVIDADE */

/* reset */
*, *:before, *:after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Trebuchet MS', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color: var(--text-primary);
}
input, button, textarea, select { font: inherit; }

:root {
    --bg-page:       #f0f2f5;
    --bg-surface:    #ffffff;
    --bg-task:       #fafafa;
    --border:        #bfbfbf;
    --border-light:  #e8e8f0;
    --text-primary:  #1a1a2e;
    --text-muted:    #6b7280;
    --btn-hover:     #e0e0e0;
    --input-border:  #e0e0e8;
    --theme-btn-bg:  #c7c6c6;
}

body.dark-mode {
    --bg-page:       #0f1117;
    --bg-surface:    #1a1d27;
    --bg-task:       #22263a;
    --border:        #2e3349;
    --border-light:  #2e3349;
    --text-primary:  #e8eaf0;
    --text-muted:    #8b90a0;
    --btn-hover:     #2e3349;
    --input-border:  #2e3349;
    --theme-btn-bg:  #2e3349;
}

#changeTheme {
    background: var(--theme-btn-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 70%;
    border: none;
    cursor: pointer;

    position: fixed;
    bottom: 24px;
    right: 24px;

    width: 49px;
    height: 49px;

    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
    z-index: 9999;
}
#changeTheme:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
#changeTheme:active {
    transform: translateY(-1px) scale(0.99);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;     
    z-index: 10;
}
header h1 {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.5px;
}
header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-right {
    display: flex;
    align-items: center;
}

#addTaskBtn {
    border: 1.5px solid var(--border);
    background: none;
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
#addTaskBtn:hover{
    background: var(--btn-hover);
}
#addTaskBtn:active{
    transform: scale(0.97);
}

.board{
    display: flex;
    gap: 16px;
    padding: 24px;
    min-height: calc(100vh - 65px);
    align-items: flex-start;
}
.column {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 16px;
    flex: 1;
    min-width: 240px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}
.column.drag-over {
    border-color: var(--border);
    background: var(--bg-task);
}
.column h2 {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.column[data-status="todo"] h2  { 
    color: #4547b9; 
}
.column[data-status="doing"] h2 { 
    color: #e99f20; 
}
.column[data-status="done"] h2  { 
    color: #19d295; 
}

.task.dragging {
    opacity: 0.5;
    transform: rotate(1.5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: grabbing;
}

.task-title {
    font-weight: normal;
    margin-bottom: 4px;
    overflow-wrap: break-word;
}

.task {
    background: var(--bg-task);
    border: 1px solid var(--border-light);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: grab;
    transition: box-shadow 0.2s; transform: 0.15s; opacity: 0.2s;
    animation: slideIn 0.3s ease-out;
}

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

.task:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    overflow-wrap: break-word;
}

.task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 8px;
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}

.task-actions button:hover {
    opacity: 1;
    background: var(--btn-hover);
}

.task.drag-target {
    outline: 2px dashed #4f46e5;
    outline-offset: 2px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal input, .modal textarea {
    background: var(--bg-task);
    color: var(--text-primary);
    border: 1.5px solid var(--input-border);
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.modal input:focus, .modal textarea:focus {
    border-color: #4f46e5;
}

.modal input.error {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { 
    background: #4338ca; 
}

.btn-secondary {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 9px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover { 
    background: var(--btn-hover);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-danger:hover { background: #dc2626; }

.btn-edit {
    height: 24px;
}
.btn-delete {
    height: 24px;
}