/*
 * Estilos modernos para item-demanda.html
 * Design responsivo com cards e sistema de cores semântico
 */

/* Container principal do card */
.demanda-card-modern {
    margin-bottom: 12px;
    list-style: none;
}

/* Cores das abas baseadas no sistema original - regras mais específicas */
.agile-list li.demanda-card-modern.evento-normal {
    border-left: 3px solid #23c6c8 !important; /* Ciano - A vencer */
}

.agile-list li.demanda-card-modern.evento-em-atraso {
    border-left: 3px solid #ed5565 !important; /* Vermelho - Em atraso */
}

.agile-list li.demanda-card-modern.evento-warning {
    border-left: 3px solid #f8ac59 !important; /* Laranja - Próximo vencimento */
}

/* Fallback para demandas sem classe específica */
.agile-list li.demanda-card-modern {
    border-left: 3px solid #999999 !important; /* Cinza padrão */
}

.demanda-card-container {
    background: #ffffff;
    border: 1px solid #e7eaec;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.demanda-card-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    border-color: #d1dade;
}

/* Estados do card baseados no status */
.demanda-card-container.demanda-normal {
    border-left: 4px solid #23c6c8;
}

.demanda-card-container.demanda-warning {
    border-left: 4px solid #f8ac59;
    background-color: #fffbf0;
}

.demanda-card-container.demanda-atraso {
    border-left: 4px solid #ed5565;
    background-color: #fff5f5;
}

/* Cabeçalho do card */
.demanda-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.demanda-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demanda-title-link {
    text-decoration: none;
    color: #676a6c;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.demanda-title-link:hover {
    color: #1c84c6;
    text-decoration: none;
}

.demanda-title {
    line-height: 1.3;
    word-break: break-word;
}

.demanda-priority-icon {
    color: #ed5565;
    font-size: 12px;
}

.demanda-id-badge {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #495057;
    white-space: nowrap;
}

.demanda-type {
    background: #6c757d;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    margin-right: 4px;
}

.demanda-number {
    font-size: 10px;
}

.demanda-status-section {
    margin-left: 8px;
}

.demanda-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demanda-status-badge.status-normal {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.demanda-status-badge.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.demanda-status-badge.status-atraso {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Seção principal de informações */
.demanda-main-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    flex-wrap: wrap;
    gap: 8px;
}

.demanda-date-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #676a6c;
}

.demanda-icon {
    color: #a7b1c2;
    font-size: 12px;
}

.demanda-date {
    font-weight: 500;
}

.demanda-relative-time {
    color: #a7b1c2;
    font-size: 11px;
    font-style: italic;
}

.demanda-indicators {
    display: flex;
    gap: 6px;
    align-items: center;
}

.demanda-recurrent-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.demanda-priority-badge {
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Pessoas inline */
.demanda-people-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.demanda-people-inline .demanda-icon {
    font-size: 10px;
    color: #666;
    margin-right: 2px;
}



.person-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.responsavel-chip {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.responsavel-chip:hover {
    background: #bbdefb;
    transform: scale(1.02);
}

.cliente-chip {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.cliente-chip:hover {
    background: #e1bee7;
    transform: scale(1.02);
}

.more-people-chip {
    background: #fff3e0 !important;
    color: #ef6c00 !important;
    border: 1px solid #ffcc02 !important;
    cursor: default;
    transition: all 0.2s ease;
}

.more-people-chip:hover {
    background: #ffcc02 !important;
    color: #bf360c !important;
    transform: scale(1.02);
}



.person-initial {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.person-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Indicador de vazio */
.demanda-empty-people {
    text-align: center;
    padding: 8px;
    color: #a7b1c2;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

.demanda-empty-people .fa {
    margin-right: 4px;
}

/* Responsividade */
@media (max-width: 768px) {
    .demanda-card-container {
        padding: 12px;
    }
    
    .demanda-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .demanda-title-section {
        width: 100%;
    }
    
    .demanda-status-section {
        margin-left: 0;
    }
    
    .demanda-main-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .person-name {
        max-width: 60px;
    }
}

@media (max-width: 480px) {
    .demanda-card-container {
        padding: 10px;
    }
    
    .demanda-title-link {
        font-size: 13px;
    }
    
    .people-chips {
        gap: 2px;
    }
    
    .person-chip {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .person-name {
        max-width: 50px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demanda-card-modern {
    animation: slideIn 0.3s ease-out;
}

/* Estados de loading */
.demanda-card-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.demanda-card-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

/* Melhorias de acessibilidade */
.demanda-card-container:focus {
    outline: 2px solid #1c84c6;
    outline-offset: 2px;
}

.person-chip:focus {
    outline: 1px solid #1c84c6;
    outline-offset: 1px;
}

/* Print styles */
@media print {
    .demanda-card-container {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 8px;
    }
    
    .demanda-card-container:hover {
        transform: none;
        box-shadow: none;
    }
}