/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    text-align: center;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.logo p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main {
    padding: 3rem 0;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
    text-align: center;
}

.search-section h2 {
    font-size: 2rem;
    color: #1e40af;
    margin-bottom: 2rem;
    font-weight: 600;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.search-icon {
    color: #6b7280;
    font-size: 1.2rem;
    margin-left: 1.5rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1.2rem 1rem;
    font-size: 1rem;
    background: transparent;
}

.search-input::placeholder {
    color: #9ca3af;
}

.clear-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.clear-btn:hover {
    color: #ef4444;
}

.search-stats {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Results Section */
.credenciados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.credenciado-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    border: none;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out forwards;
}

.credenciado-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
}

.credenciado-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0wIDBoNDB2NDBoLTQweiIvPjxwYXRoIGQ9Ik0zMCAxMGwtNSAyLTUgNS0xMCAxIDMgMTAgMTAgNSAxMC01IDMtMTAtMTAtMXoiIHN0cm9rZT0icmdiYSg1OSwgMTMwLCAyNDYsIDAuMSkiIHN0cm9rZS13aWR0aD0iMC41Ii8+PC9nPjwvc3ZnPg==');
    opacity: 0.05;
    z-index: 0;
}

.credenciado-card > * {
    position: relative;
    z-index: 1;
}

.credenciado-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

.credenciado-header {
    margin-bottom: 1.5rem;
}

.credenciado-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.credenciado-type {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.credenciado-info {
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-icon {
    color: #3b82f6;
    font-size: 1rem;
    margin-top: 0.1rem;
    min-width: 16px;
}

.info-text {
    flex: 1;
    color: #4b5563;
    line-height: 1.5;
}

.phone-link {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.phone-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.especialidades {
    margin-top: 1.5rem;
}

.especialidades-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.especialidades-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.especialidade-tag {
    background: #ebf5ff;
    color: #1e40af;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(30, 64, 175, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: inline-block;
    margin: 0.2rem;
}

.especialidade-tag:hover {
    background: #dbeafe;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(30, 64, 175, 0.15);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.no-results p {
    font-size: 1rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0wIDBoNjB2NjBoLTYweiIvPjxwYXRoIGQ9Ik0zNiAzNGwxMC01djE0bC0xMC01LTEwIDV2LTE0bDEwIDV6IiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS1vcGFjaXR5PSIwLjEiIHN0cm9rZS13aWR0aD0iMC41Ii8+PC9nPjwvc3ZnPg==');
    opacity: 0.1;
}

/* styles.css */

/*  Sobrescreve cores padrão do Bootstrap para o painel */
.admin-container {
  background: #fff;
}

/* Botões de ação personalizados */
.edit-btn, .delete-btn {
  margin-right: 0.5rem;
}

/* Cards para lista administrativa */
.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

@media (max-width: 576px) {
  .admin-list-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Estilos do painel administrativo */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
}

/* DataTable personalizada */
.dataTables_wrapper {
    margin-top: 1rem;
}

.dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.5rem 1rem;
}

.dataTables_length select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.25rem 0.5rem;
}

table.dataTable thead th {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

table.dataTable tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

/* Formulários SweetAlert2 */
.swal2-popup {
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.swal2-title {
    color: #495057;
    font-weight: 600;
}

.swal2-input, .swal2-textarea {
    border-radius: 8px !important;
    border: 1px solid #ced4da !important;
    padding: 0.75rem !important;
    margin: 0.5rem auto !important;
    max-width: 90% !important;
}

.swal2-input:focus, .swal2-textarea:focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Toast notifications */
.swal2-toast {
    border-radius: 12px !important;
}

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

.card {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 0.25rem 0;
        border-radius: 8px !important;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .table-responsive {
        border-radius: 8px;
    }
}

/* Indicadores visuais para estatísticas */
.card .fa-users {
    color: #007bff;
}

.card .fa-stethoscope {
    color: #28a745;
}

.card .fa-phone {
    color: #17a2b8;
}

.card .fa-whatsapp {
    color: #25d366;
}

/* Melhorias no modal de importação */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

/* Estilo para inputs de arquivo */
.form-control[type="file"] {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-control[type="file"]:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

/* Validação de formulários */
.is-valid {
    border-color: #28a745 !important;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading spinner personalizado */
.spinner-border-custom {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid rgba(0, 123, 255, 0.25);
    border-right-color: #007bff;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

/* Efeitos de transição suaves */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Melhorias para tabela responsiva */
.table-responsive {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Estilo para badges e tags */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Footer do painel (se necessário) */
.admin-footer {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* Estilos para tooltips personalizados */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

/* Melhorias para acessibilidade */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Indicadores de carregamento */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   MELHORIAS PARA SWEETALERT2 FORMS
   ========================================== */

/* Melhorias para formulários do SweetAlert2 */
.swal2-popup.swal-wide {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.swal2-html-container.swal-html-container {
    margin: 0 !important;
    padding: 1.5rem !important;
    text-align: left !important;
}

.swal2-input, .swal2-textarea {
    font-size: 0.95rem !important;
    padding: 0.75rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.5rem !important;
    margin: 0.25rem 0 !important;
    box-shadow: none !important;
    transition: all 0.15s ease-in-out !important;
}

.swal2-input:focus, .swal2-textarea:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: 0 !important;
}

.swal2-input::placeholder, .swal2-textarea::placeholder {
    color: #6c757d !important;
    opacity: 0.7 !important;
}

/* Labels customizados */
.form-label.fw-bold {
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
}

/* Validação visual */
.swal2-input[style*="border-color: rgb(40, 167, 69)"],
.swal2-textarea[style*="border-color: rgb(40, 167, 69)"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.82 1.82 3.75-3.75L9.75 4.8 4.07 10.5z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1rem 1rem !important;
}

.swal2-input[style*="border-color: rgb(220, 53, 69)"],
.swal2-textarea[style*="border-color: rgb(220, 53, 69)"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.25 5.25 1.5 1.5m0 0 1.5 1.5m-1.5-1.5 1.5-1.5m-1.5 1.5-1.5 1.5'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1rem 1rem !important;
}

/* Melhorias para o título do modal */
.swal2-title {
    padding: 1rem 1.5rem 0.5rem !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

/* Melhorias para os botões */
.swal2-actions {
    padding: 1rem 1.5rem 1.5rem !important;
    gap: 0.75rem !important;
}

.swal2-confirm, .swal2-cancel {
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
    border: none !important;
    font-size: 0.95rem !important;
}

.swal2-confirm:hover, .swal2-cancel:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Responsividade para modais */
@media (max-width: 768px) {
    .swal2-popup.swal-wide {
        width: 90% !important;
        margin: 0 5% !important;
    }
    
    .swal2-html-container.swal-html-container {
        padding: 1rem !important;
    }
    
    .row {
        margin: 0 !important;
    }
    
    .col-md-6, .col-12 {
        padding: 0.25rem !important;
    }
    
    .swal2-input, .swal2-textarea {
        font-size: 1rem !important;
        padding: 0.875rem !important;
    }
}

