/* Estilos personalizados para página de representantes */

/* Seção de filtros */
.filtros-representantes {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
}

.filtros-representantes:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.filtros-representantes label {
    color: #495057;
    font-size: 0.95rem;
}

.filtros-representantes .text_refrimate {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Info de contato */
.info-contato {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-contato:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-contato h6 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #007bff;
    font-weight: 600;
}

.info-contato h6 i {
    margin-right: 8px;
}

.info-contato .list-unstyled li {
    padding: 5px 0;
    color: #495057;
    line-height: 1.6;
}

.info-contato .list-unstyled li i {
    color: #6c757d;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Card de representante */
.agent-card {
    transition: all 0.3s ease;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Lista de cidades */
.cidades-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.cidades-list h6 {
    color: #495057;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    margin-bottom: 15px;
}

.cidades-list ul {
    column-count: 2;
    column-gap: 20px;
    margin-bottom: 0;
    padding-left: 20px;
}

.cidades-list li {
    break-inside: avoid;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #495057;
    position: relative;
    padding-left: 5px;
}

.cidades-list li::before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
    left: 0;
}

/* Scrollbar personalizada */
.cidades-list::-webkit-scrollbar {
    width: 8px;
}

.cidades-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cidades-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.cidades-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Header do card */
.card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border-bottom: none;
    padding: 15px 20px;
}

.card-header h5 {
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 20px;
}

.card-body h6 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.card-body .list-unstyled {
    margin-bottom: 0;
}

.card-body .list-unstyled li {
    padding: 5px 0;
    color: #495057;
    line-height: 1.6;
}

/* Ícones */
.list-unstyled li i {
    width: 20px;
    margin-right: 5px;
}

/* Loading spinner */
.spinner-border {
    border-width: 0.3em;
}

/* Overlay de loading */
#loadingOverlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
}

#loadingOverlay .spinner-border {
    animation: spinner-grow 0.75s linear infinite;
}

/* Animações suaves */
.agent-card,
.filtros-representantes,
.select2-container,
.form-control {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Efeito hover nos selects */
.form-control:hover {
    border-color: #80bdff;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Badge para contadores */
.badge {
    font-weight: 600;
    padding: 5px 10px;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-card {
    animation: fadeIn 0.4s ease forwards;
}

/* =====================================
   MELHORIAS MOBILE
   ===================================== */

@media (max-width: 768px) {
    /* Filtros em mobile */
    .filtros-representantes {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .filtros-representantes .text_refrimate {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    /* Cards em mobile */
    .agent-card {
        margin-bottom: 15px;
    }
    
    /* Header do card menor em mobile */
    .agent-card .card-header {
        padding: 12px 15px;
    }
    
    .agent-card .card-header h5 {
        font-size: 1.1rem;
    }
    
    /* Padding reduzido em mobile */
    .agent-card .card-body {
        padding: 15px;
    }
    
    /* Colunas empilhadas em mobile */
    .agent-card .row > div {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Títulos menores em mobile */
    .agent-card h6,
    .card-body h6 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    /* Lista de cidades em 1 coluna em mobile */
    .cidades-list {
        max-height: 250px;
        padding: 10px;
    }
    
    .cidades-list ul {
        column-count: 1;
        font-size: 0.9rem;
        padding-left: 15px;
    }
    
    .cidades-list li {
        margin-bottom: 6px;
    }
    
    /* Ajustes para informações de contato em mobile */
    .list-unstyled li {
        font-size: 0.9rem;
        margin-bottom: 8px !important;
    }
    
    .list-unstyled li strong {
        display: inline-block;
        min-width: 80px;
    }
    
    /* Container mais estreito em mobile */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Ajustes para a seção info-contato em mobile */
    .info-contato {
        padding: 15px !important;
    }
    
    .info-contato h6 {
        font-size: 1rem;
    }
    
    /* Filtros em mobile - espaçamento */
    .form-group label {
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 0.95rem;
    }
    
    /* Select2 em mobile */
    .select2-container--bootstrap4 .select2-selection {
        font-size: 0.95rem;
        padding: 8px;
    }
    
    /* Margens reduzidas em mobile */
    .rel-agent {
        padding-bottom: 10px !important;
    }
    
    /* Espaçamento entre cards */
    .agents > .col-12 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .cidades-list ul {
        column-count: 2;
    }
    
    .agent-card .card-body {
        padding: 20px;
    }
}

/* Dispositivos muito pequenos */
@media (max-width: 480px) {
    .filtros-representantes {
        padding: 12px;
    }
    
    .filtros-representantes .text_refrimate {
        font-size: 0.95rem;
    }
    
    .agent-card .card-header {
        padding: 10px 12px;
    }
    
    .agent-card .card-header h5 {
        font-size: 1rem;
    }
    
    .agent-card .card-body {
        padding: 12px;
    }
    
    .card-body h6,
    .agent-card h6 {
        font-size: 0.95rem;
    }
    
    .list-unstyled li {
        font-size: 0.85rem;
    }
    
    .cidades-list {
        font-size: 0.85rem;
        max-height: 200px;
        padding: 8px;
    }
    
    .cidades-list ul {
        padding-left: 12px;
    }
    
    .info-contato {
        padding: 12px !important;
    }
    
    .info-contato h6 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
}
