/* ================================================
   TASKFLOW PRO - DASHBOARD CUSTOM STYLES
   ================================================
   Este arquivo contém todos os estilos customizados
   para o dashboard, organizados por seções.
   ================================================ */

/* ===== CSS VARIABLES ===== */
:root {
    /* Cores principais */
    --color-primary: #667EEA;
    --color-primary-dark: #5A67D8;
    --color-success: #48BB78;
    --color-info: #4299E1;
    --color-warning: #ED8936;
    --color-error: #F56565;
    --color-gray-dark: #2D3748;
    --color-gray-medium: #4A5568;
    --color-gray-light: #A0AEC0;
    
    /* Status Colors - Cores para status das tarefas */
    --status-not-started: #6c757d;
    --status-not-started-hover: #5a6268;
    --status-in-progress: #007bff;
    --status-in-progress-hover: #0056b3;
    --status-in-review: #fd7e14;
    --status-in-review-hover: #e8690b;
    --status-completed: #28a745;
    --status-completed-hover: #1e7e34;
    --status-blocked: #dc3545;
    --status-blocked-hover: #c82333;
    
    /* Layout - Variáveis de layout otimizadas */
    --sidebar-width: 140px;
    --border-radius: 6px;
    --box-shadow-light: 0 2px 8px rgba(102, 126, 234, 0.13);
    --box-shadow-medium: 0 4px 16px rgba(90, 103, 216, 0.3);
    --transition-fast: 0.2s ease;
}

/* ===== BASE STYLES - Estilos base otimizados ===== */
body {
    background: #F7FAFC;
    color: var(--color-gray-dark);
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

/* ===== REDUÇÃO GLOBAL DE TAMANHOS ===== */
* {
    font-size: 0.85rem !important;
}

body {
    font-size: 0.8rem !important;
}

.btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.8rem !important;
}

.form-control {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
}

.navbar-brand {
    font-size: 2.2rem !important;
}

/* ===== TÍTULOS COMPACTOS ===== */
h1.mb-4 {
    font-size: 1.4rem !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

/* Títulos de página específicos */
h1, h2, h3 {
    clear: both;
    z-index: 1;
    position: relative;
}

/* ===== LAYOUT DA SIDEBAR ===== */

/* Sidebar - Barra lateral otimizada */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 1.25rem 0.5rem 1rem 0.5rem;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
}

/* Conteúdo principal otimizado */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 0.5rem 0.5rem 0.5rem 0.8rem;
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: auto;
}

/* ===== SIDEBAR NAVIGATION - Navegação da sidebar ===== */

/* Links de navegação otimizados */
.sidebar .nav-link {
    color: var(--color-gray-dark);
    font-weight: 500;
    font-size: 11px;
    padding: 0.35rem 0.35rem;
    margin-bottom: 0.15rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-link i {
    width: 13px;
    margin-right: 0.35rem;
    font-size: 11px;
}

/* ===== CARDS DE MÉTRICAS - Cards do dashboard ===== */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-light);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.card-body {
    padding: 0.3rem;
}

/* Cards de métricas otimizados */
.bg-primary .card-body h4,
.bg-success .card-body h4,
.bg-info .card-body h4,
.bg-warning .card-body h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.05rem;
}

.bg-primary .card-body small,
.bg-success .card-body small,
.bg-info .card-body small,
.bg-warning .card-body small {
    font-size: 0.6rem;
    opacity: 0.9;
}

/* Ajustes para ícones dos cards */
.card-body .fa-lg {
    font-size: 0.8rem;
}

/* ===== RESPONSIVE DESIGN - Design responsivo ===== */

/* Botão de logout */
#nav-logout {
    color: var(--color-error) !important;
    font-weight: 600;
    position: absolute;
    bottom: 32px;
    left: 24px;
    border: 1px solid var(--color-error);
    background: transparent;
}

#nav-logout:hover {
    background: var(--color-error) !important;
    color: #fff !important;
}

/* ===== TITLE AND BUTTONS - Títulos e botões ===== */

/* Título do projeto */
.project-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--color-primary);
    text-shadow: 1px 2px 8px rgba(90, 103, 216, 0.3);
    margin-bottom: 1.5rem;
}

/* Botões animados */
.btn-animated {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.7rem 1.7rem;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--box-shadow-light);
    transition: all var(--transition-fast);
    outline: none;
    cursor: pointer;
}

.btn-animated:hover,
.btn-animated:focus {
    background: var(--color-primary-dark);
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--box-shadow-medium);
}

/* ===== IMAGE COMPONENTS - Componentes de imagem ===== */

/* Foto de perfil */
.profile-pic {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}

.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Foto de colaborador */
.collab-pic {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    margin-right: 10px;
}

/* ===== TASK COMPONENTS - Componentes de tarefa ===== */

/* Cards de tarefa */
.task-card {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: var(--box-shadow-light);
    padding: 0.7rem 0.9rem;
    font-size: 0.97em;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: move;
    transition: all var(--transition-fast);
}

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

.task-card .card-body {
    padding: 0.7rem 0.5rem;
}

/* Estados especiais para cards */
.task-card.has-assignee {
    border-left: 3px solid var(--color-info);
}

/* Colunas de tarefa - visibilidade */
.main-task-columns-row {
    display: none;
}

.main-task-columns-row.active {
    display: flex !important;
}

/* ===== COLUMN BUTTONS - Botões das colunas ===== */

/* Botões base das colunas */
.btn-coluna-tarefa {
    color: #fff !important;
    border: none !important;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.btn-coluna-tarefa:focus,
.btn-coluna-tarefa:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===== STATUS SPECIFIC COLORS - Cores específicas por status ===== */

/* Não iniciada */
.btn-coluna-tarefa[data-col="not_started"] {
    background: var(--status-not-started) !important;
    border-color: var(--status-not-started) !important;
}

.btn-coluna-tarefa[data-col="not_started"]:hover {
    background: var(--status-not-started-hover) !important;
}

/* Em progresso */
.btn-coluna-tarefa[data-col="in_progress"] {
    background: var(--status-in-progress) !important;
    border-color: var(--status-in-progress) !important;
}

.btn-coluna-tarefa[data-col="in_progress"]:hover {
    background: var(--status-in-progress-hover) !important;
}

/* Em revisão */
.btn-coluna-tarefa[data-col="in_review"] {
    background: var(--status-in-review) !important;
    border-color: var(--status-in-review) !important;
}

.btn-coluna-tarefa[data-col="in_review"]:hover {
    background: var(--status-in-review-hover) !important;
}

/* Completada */
.btn-coluna-tarefa[data-col="completed"] {
    background: var(--status-completed) !important;
    border-color: var(--status-completed) !important;
}

.btn-coluna-tarefa[data-col="completed"]:hover {
    background: var(--status-completed-hover) !important;
}

/* Bloqueada */
.btn-coluna-tarefa[data-col="blocked"] {
    background: var(--status-blocked) !important;
    border-color: var(--status-blocked) !important;
}

.btn-coluna-tarefa[data-col="blocked"]:hover {
    background: var(--status-blocked-hover) !important;
}

/* ===== NOTIFICATIONS - Notificações ===== */
.notification-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

/* ===== TEAM SELECTOR - Seletor de equipe ===== */
.team-selector .current-team-info {
    transition: var(--transition-fast);
}

.team-selector .current-team-info:hover {
    background: #f8f9fa !important;
    transform: scale(1.02);
}

/* ===== FORM VALIDATION STYLES - Estilos de validação ===== */

/* Estados válidos e inválidos */
.form-control.is-valid {
    border-color: var(--color-success);
    box-shadow: 0 0 0 0.2rem rgba(72, 187, 120, 0.25);
}

.form-control.is-invalid {
    border-color: var(--color-error);
    box-shadow: 0 0 0 0.2rem rgba(245, 101, 101, 0.25);
}

/* Mensagens de feedback */
.valid-feedback {
    display: block;
    color: var(--color-success);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.invalid-feedback {
    display: block;
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-error-message {
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

/* Animação de entrada */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Labels dos formulários */
label {
    font-weight: 500;
    color: var(--color-gray-dark);
    margin-bottom: 0.5rem;
}

/* Texto de ajuda */
.form-text {
    font-size: 0.8rem;
    color: var(--color-gray-light);
}

/* Estados de foco */
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Melhorias nos modais */
.modal-body .form-group:last-child {
    margin-bottom: 0;
}

/* Estado de carregamento dos botões */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animação de rotação */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN - Design responsivo otimizado ===== */

/* Lista de colaboradores disponíveis */
#available-participants,
#edit-available-participants {
    background: #fff;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

#available-participants:hover,
#edit-available-participants:hover {
    border-color: var(--color-primary);
    background: #f8f9ff;
}

/* Item individual de colaborador */
.participant-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    background: #fff;
}

.participant-item:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateX(2px);
}

.participant-item.selected {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

/* Avatar do participante */
.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid transparent;
}

.participant-item.selected .participant-avatar {
    border-color: #fff;
}

/* Informações do participante */
.participant-info {
    flex-grow: 1;
}

.participant-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0;
}

.participant-role {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
}

/* Checkbox do participante */
.participant-checkbox {
    margin-left: 10px;
    transform: scale(1.2);
}

/* Lista de participantes selecionados */
.selected-participants-list {
    min-height: 40px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}

/* Badge de participante selecionado */
.selected-participant-badge {
    display: inline-flex;
    align-items: center;
    background: var(--color-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 2px 4px 2px 0;
    transition: all 0.2s ease;
}

.selected-participant-badge:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Avatar pequeno no badge */
.selected-participant-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
    object-fit: cover;
}

/* Botão remover participante */
.remove-participant {
    background: transparent;
    border: none;
    color: #fff;
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-participant:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Estados especiais */
.participant-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.participant-item.disabled:hover {
    background: #fff;
    color: inherit;
    transform: none;
}

/* Contador de participantes */
.participants-counter {
    background: var(--color-info);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
}

/* Busca de participantes */
.participant-search {
    margin-bottom: 10px;
}

.participant-search input {
    border-radius: 20px;
    padding-left: 35px;
    font-size: 0.9rem;
}

.participant-search .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray-light);
}

/* Responsivo */
@media (max-width: 768px) {
    .participants-selector {
        padding: 10px;
    }
    
    .participant-item {
        padding: 6px 10px;
    }
    
    .participant-avatar {
        width: 28px;
        height: 28px;
    }
    
    .participant-name {
        font-size: 0.85rem;
    }
    
    .participant-role {
        font-size: 0.75rem;
    }
    
    .selected-participant-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

/* Animações */
@keyframes participantAdded {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.selected-participant-badge.newly-added {
    animation: participantAdded 0.4s ease;
}

/* ===== RESPONSIVE DESIGN - Design responsivo otimizado ===== */

/* Para telas menores que 1200px (incluindo zoom 125% em 1920px) */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 200px;
    }
    
    .main-content {
        padding: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .bg-primary .card-body h4,
    .bg-success .card-body h4,
    .bg-info .card-body h4,
    .bg-warning .card-body h4 {
        font-size: 1.5rem;
    }
}

/* Para zoom 100% em telas normais ou menores que 992px */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 180px;
    }
    
    .sidebar {
        padding: 1rem 0.5rem;
    }
    
    .sidebar .nav-link {
        font-size: 12px;
        padding: 0.5rem 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .row.mb-4 .col-md-3 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 900px) {
    /* Colunas de tarefa em dispositivos móveis */
    .main-task-columns-row {
        flex-direction: column;
    }

    /* Sidebar responsiva */
    .sidebar {
        width: 100vw;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        flex-direction: row;
        padding: 1rem;
    }

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

    .sidebar .nav-link {
        margin: 0 0.5rem 0 0;
        white-space: nowrap;
    }

    /* Conteúdo principal responsivo */
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .project-title {
        font-size: 2rem;
    }

    #nav-logout {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    /* Ajustes para telas muito pequenas */
    .btn-animated {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .project-title {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 0.5rem;
    }
}

/* ===== OTIMIZAÇÕES PARA ZOOM 100% ===== */
@media screen and (min-width: 1024px) {
    /* Reduz espaçamentos gerais */
    .container-fluid {
        padding: 0.5rem 0.8rem;
    }
    
    /* Cards mais compactos */
    .row.mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .row {
        margin-bottom: 0.5rem;
    }
    
    .col-md-3 {
        padding: 0.25rem;
    }
    
    .col-md-6 {
        padding: 0.25rem;
    }
    
    /* Cards de métricas com altura fixa */
    .bg-primary,
    .bg-success, 
    .bg-info,
    .bg-warning {
        min-height: 45px;
        display: flex;
        align-items: center;
    }
    
    /* Otimiza altura dos gráficos */
    .chart-container {
        height: 150px !important;
    }
    
    /* Cards dos gráficos mais compactos */
    .card-header {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    /* Reduz padding dos títulos */
    h1, h2, h3, h4, h5 {
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    /* Otimiza barra lateral */
    .sidebar {
        padding: 0.5rem;
    }
}

/* ===== LAYOUT DE PROJETOS E PÁGINAS ===== */
.container-fluid {
    padding: 0.75rem 0.75rem 0.75rem 0.5rem !important;
}

.row {
    margin-bottom: 1rem;
    margin-left: 0.25rem;
}

/* Cards de projeto */
.project-card {
    margin-bottom: 1rem;
    margin-left: 0.25rem;
    clear: both;
}

/* Evita sobreposição de elementos */
.btn-primary, .btn-success {
    margin-top: 0.5rem;
    z-index: 10;
    position: relative;
}

/* Progress bars */
.progress {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Espaçamento entre seções */
.mb-4 {
    margin-bottom: 1rem !important;
}

/* ===== BOTÃO SAIR DA EQUIPE ===== */
.text-center .btn-outline-danger {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
    border-width: 1px !important;
    border-radius: 4px !important;
    margin: 0.5rem auto;
    display: block;
    width: auto;
    white-space: nowrap;
    max-width: 120px;
}

.text-center .btn-outline-danger:hover {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
}

/* Ícones em botões pequenos do sair da equipe */
.text-center .btn-outline-danger i {
    font-size: 0.65rem !important;
    margin-right: 0.3rem;
}

/* ===== BOTÕES DAS COLUNAS DE TAREFAS ===== */
.btn-coluna-tarefa.btn-outline-danger {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    border-width: 1px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
    white-space: nowrap;
    max-width: none !important;
}

.btn-coluna-tarefa.btn-outline-danger:hover {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
}

.btn-coluna-tarefa.btn-outline-danger i {
    font-size: 0.85rem !important;
    margin-right: 0.3rem;
}

/* ===== CARDS DE PROJETOS ===== */
.project-card {
    transition: var(--transition-fast);
    border: 1px solid rgba(0,0,0,0.1);
}

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

.project-card .card-title {
    color: var(--color-gray-dark);
    font-weight: 600;
    font-size: 1rem;
}

.project-card .progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
}

.project-card .progress-bar {
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 3px;
}

.project-card .dropdown-toggle {
    border: none !important;
    background: transparent !important;
    color: var(--color-gray-medium) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8rem !important;
}

.project-card .dropdown-toggle:hover {
    color: var(--color-primary) !important;
    background: rgba(102, 126, 234, 0.1) !important;
}

.border-dashed {
    border: 2px dashed #dee2e6 !important;
    background: #f8f9fa;
}

.border-dashed:hover {
    border-color: var(--color-primary) !important;
    background: rgba(102, 126, 234, 0.05);
}

/* Ajuste geral para botões pequenos */
.btn-sm {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.7rem !important;
}
