/**
 * ============================================
 * 🎯 CSS MÓDULO GESTÃO DE PROJETOS v1.1
 * ============================================
 * Inclui: Gantt Chart interativo e exportação PDF
 */

/* Container Principal */
.projetos-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.projetos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.projetos-header h2 {
    margin: 0;
    font-size: 28px;
    color: #1f2937;
}

.projetos-header .text-muted {
    margin: 5px 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

/* Grid de Projetos */
.projetos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Card do Projeto */
.projeto-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left-width: 4px;
    border-left-style: solid;
}

.projeto-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Alerta do Card */
.projeto-alerta {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alerta-icone {
    font-size: 24px;
    line-height: 1;
}

.projeto-alerta div {
    flex: 1;
}

.projeto-alerta strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.projeto-alerta span {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

/* Informações do Projeto */
.projeto-info {
    padding: 20px;
}

.projeto-info h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1f2937;
}

.projeto-cliente {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.projeto-cliente i {
    margin-right: 6px;
}

/* Métricas */
.projeto-metricas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.metrica {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.metrica-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metrica-valor {
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}

.metrica-valor.destaque {
    color: #059669;
}

/* Barra de Progresso */
.progress-container {
    position: relative;
    height: 32px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

/* Footer do Card */
.projeto-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.projeto-acoes {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.empty-state i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 20px;
}

.empty-state p {
    color: #6b7280;
    margin: 0 0 24px 0;
}

.empty-state-small {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-small i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state-small p {
    color: #6b7280;
    margin: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Projeto Detalhes */
.projeto-detalhes {
    padding: 20px 0;
}

/* Alerta Grande */
.alerta-grande {
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.alerta-grande h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.alerta-grande p {
    margin: 0;
    font-size: 16px;
}

/* Métricas Grid (Visão Geral) */
.metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.metrica-card {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.metrica-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.metrica-card i {
    font-size: 24px;
    color: #6b7280;
}

.metrica-card.destaque {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

.metrica-card.destaque i,
.metrica-card.destaque .metrica-label,
.metrica-card.destaque .metrica-valor {
    color: white;
}

.metrica-card.destaque-success {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #1d4ed8;
}

.metrica-card.destaque-success i,
.metrica-card.destaque-success .metrica-label,
.metrica-card.destaque-success .metrica-valor {
    color: white;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 24px 0;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item strong {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 14px;
    color: #1f2937;
}

.descricao {
    margin: 24px 0;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.descricao strong {
    display: block;
    margin-bottom: 12px;
    color: #374151;
}

.descricao p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

/* Timeline */
.timeline-container {
    padding: 20px 0;
}

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    display: flex;
    gap: 16px;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.timeline-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.timeline-content p {
    margin: 0 0 12px 0;
    color: #6b7280;
    font-size: 14px;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.timeline-meta i {
    margin-right: 4px;
}

/* ============================================
 * 📅 GRÁFICO DE GANTT INTERATIVO
 * ============================================ */

/* Container Principal do Gantt */
.gantt-container {
    padding: 20px 0;
    background: white;
    border-radius: 12px;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.gantt-header h4 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

/* Legenda do Gantt */
.gantt-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gantt-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}

.gantt-legend-box {
    width: 20px;
    height: 14px;
    border-radius: 3px;
}

/* Wrapper do Gráfico */
.gantt-chart-wrapper {
    position: relative;
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    overflow-x: auto;
}

/* Escala de Tempo */
.gantt-scale {
    position: relative;
    height: 40px;
    border-bottom: 2px solid #d1d5db;
    margin-bottom: 20px;
}

.gantt-scale-mark {
    position: absolute;
    top: 0;
}

.gantt-scale-line {
    width: 1px;
    height: 100%;
    background: #d1d5db;
    margin-bottom: 5px;
}

.gantt-scale-label {
    position: absolute;
    top: 25px;
    left: -20px;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

/* Linha "Hoje" */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dc2626;
    z-index: 10;
    opacity: 0.7;
}

.gantt-today-label {
    position: absolute;
    top: -25px;
    left: -15px;
    background: #dc2626;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Container das Linhas */
.gantt-rows {
    position: relative;
}

/* Linha Individual do Gantt */
.gantt-row {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

/* Nome da Tarefa */
.gantt-task-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.gantt-task-icon {
    font-size: 16px;
    margin-right: 8px;
}

.gantt-task-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.gantt-task-name small {
    font-size: 12px;
    color: #6b7280;
}

/* Timeline da Tarefa */
.gantt-timeline {
    position: relative;
    height: 50px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Barra da Tarefa */
.gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gantt-bar:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 5;
}

.gantt-bar-label {
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Dependências (linha conectando predecessoras) */
.gantt-dependency {
    position: absolute;
    width: 2px;
    background: #9ca3af;
    top: 50%;
    left: 0;
    height: 20px;
    opacity: 0.5;
}

/* Rodapé do Gantt */
.gantt-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.gantt-footer small {
    color: #6b7280;
}

/* Avaliação */
.avaliacao-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.avaliacao-info p {
    margin: 8px 0;
    color: #374151;
}

.link-container {
    margin: 24px 0;
}

.link-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
}

/* Responsivo */
@media (max-width: 768px) {
    .projetos-grid {
        grid-template-columns: 1fr;
    }
    
    .projetos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .projeto-metricas {
        grid-template-columns: 1fr;
    }
    
    .metricas-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Alert */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.alert i {
    font-size: 20px;
    margin-top: 2px;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.mb-3 {
    margin-bottom: 16px !important;
}

/* Modal Large */
.modal-xl .modal-content {
    max-width: 1200px;
}

.modal-large {
    max-height: 70vh;
    overflow-y: auto;
}
