/* ===== RESET E VARIÁVEIS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Principais */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Cores do Tema Escuro */
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Sombras e Efeitos */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-card) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== CONTAINER PRINCIPAL ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--dark-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--dark-card);
    color: var(--text-primary);
    border: 1px solid var(--dark-border);
}

.btn-secondary:hover {
    background: var(--dark-border);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===== BARRA DE PESQUISA ===== */
.search-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.75rem;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn.active,
.view-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== CONTAINER BOARD + STATS ===== */
.board-stats-wrapper {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

/* ===== QUADRO KANBAN ===== */
.kanban-container {
    flex: 1;
    overflow-x: auto;
}

.kanban-board {
    display: flex;
    gap: 1.5rem;
    min-height: 500px;
    padding-bottom: 1rem;
}

/* ===== COLUNAS KANBAN ===== */
.kanban-column {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-width: 300px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

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

.column-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.column-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== TAREFAS ===== */
.kanban-tasks {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.task-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: var(--transition);
    position: relative;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.task-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
}

.task-card.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

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

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

.task-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.task-btn:hover {
    color: var(--text-primary);
    background: var(--dark-border);
}

.task-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-high {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-low {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.task-due-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-due-date.overdue {
    color: var(--danger-color);
}

/* Indicador de Status de Prazo */
.task-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    animation: fadeIn 0.3s ease;
}

.task-status-badge.on-time {
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.task-status-badge.overdue {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.task-status-badge.no-date {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===== ESTATÍSTICAS SIDEBAR ===== */
.stats-sidebar {
    min-width: 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateX(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.success {
    background: var(--success-color);
}

.stat-icon.warning {
    background: var(--warning-color);
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--dark-border);
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--dark-bg);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ===== BOTÃO ADICIONAR TAREFA ===== */
.add-task-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed var(--dark-border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.add-task-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .board-stats-wrapper {
        flex-direction: column;
    }

    .stats-sidebar {
        max-width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .stat-card {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .search-section {
        flex-direction: column;
        align-items: stretch;
    }

    .board-stats-wrapper {
        flex-direction: column;
    }

    .stats-sidebar {
        flex-direction: column;
        max-width: 100%;
    }

    .kanban-board {
        flex-direction: column;
        gap: 1rem;
    }

    .kanban-column {
        min-width: auto;
        max-width: none;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        top: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.success {
    border-left: 4px solid var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

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

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}