/* Variáveis CSS para o Design System */
:root {
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --bg-color: #0f172a; /* Slate 900 - Dark mode lindo */
    --surface: #1e293b; /* Slate 800 */
    --surface-hover: #334155; /* Slate 700 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border: #334155;
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease-out;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Form Input */
.task-input-container {
    background-color: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: fadeIn 0.8s ease-out;
}

#task-form {
    display: flex;
    gap: 0.75rem;
}

#task-title {
    flex: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#task-title:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

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

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* Tasks Box */
.tasks-container {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.tasks-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasks-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.task-count {
    background-color: var(--surface-hover);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Task List */
.task-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar */
.task-list::-webkit-scrollbar {
    width: 6px;
}
.task-list::-webkit-scrollbar-track {
    background: transparent;
}
.task-list::-webkit-scrollbar-thumb {
    background-color: var(--surface-hover);
    border-radius: var(--radius-full);
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    animation: slideInLeft 0.3s ease-out;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: var(--surface-hover);
}

.task-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.checkbox {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: var(--transition);
    background-color: var(--bg-color);
}

.checkbox::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    background-color: white;
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox:checked::before {
    transform: scale(1);
}

.task-text {
    font-size: 1rem;
    transition: var(--transition);
    word-break: break-all;
}

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

.task-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.task-item:hover .task-actions {
    opacity: 1;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    transition: var(--transition);
}

.btn-delete:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--surface-hover);
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--surface);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    z-index: 50;
    font-weight: 500;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Responsividade */
@media (max-width: 640px) {
    .task-actions {
        opacity: 1; /* Sempre mostra botões no mobile */
    }
}
