/* 
 * Estilos Ultra Profissionais para Módulo de Usuários
 * Design System: Clean, Modern, Accessible
 */

/* === FORMULÁRIO DE USUÁRIOS === */
.modal-xl .modal-dialog {
    max-width: 1200px;
}

/* Seções do formulário */
.form-section {
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    color: white;
    padding: 12px 16px;
    margin: 0 -15px 20px -15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section h6 {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section i {
    margin-right: 8px;
    opacity: 0.9;
}

/* Campos de formulário aprimorados */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.form-control:focus {
    border-color: #2D9CDB;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: white;
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* Help text estilizado */
.form-text {
    color: #6c757d;
    font-size: 11px;
    margin-top: 4px;
    font-style: italic;
}

/* Select aprimorado */
.form-control[type="select"], select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* === INTERFACE DE PERMISSÕES POR MÓDULOS === */
.permissions-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.permissions-grid .card {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.permissions-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.permissions-grid .card-header {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

/* Items de permissão com checkboxes */
.permission-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.permission-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.permission-item:hover {
    border-color: #2D9CDB;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.permission-item:hover::before {
    background: #2D9CDB;
    width: 6px;
}

.permission-item.permission-active {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #f0f9f0 100%);
}

.permission-item.permission-active::before {
    background: #28a745;
    width: 6px;
}

.permission-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.permission-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.permission-active .permission-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transform: scale(1.1);
}

.permission-text {
    flex-grow: 1;
    margin-top: 2px;
}

.permission-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 2px;
}

.permission-description {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
}

/* Custom switches */
.custom-switch .custom-control-label::before {
    border-radius: 25px;
    background-color: #e9ecef;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #28a745;
    border-color: #28a745;
    transform: scale(1.1);
}

.custom-switch .custom-control-label::after {
    border-radius: 50%;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: white;
    transform: translateX(0.75rem) scale(1.1);
}

/* === TABELA DE USUÁRIOS === */
.table-professional {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.table-professional thead th {
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 16px 12px;
}

.table-professional tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.table-professional tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    transform: scale(1.001);
}

.table-professional tbody td {
    padding: 16px 12px;
    vertical-align: middle;
    border: none;
}

/* Badges aprimorados */
.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    border: none;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    border: none;
}

.badge-primary {
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    border: none;
}

/* === BOTÕES === */
.btn {
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 12px;
    padding: 10px 16px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* Botões em grupo */
.btn-group .btn {
    margin-right: 4px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* === ALERTAS === */
.alert {
    border: none;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* === MODAIS === */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    color: white;
    border: none;
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    border: none;
    padding: 20px 24px;
    background: #f8f9fa;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .modal-xl .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .permission-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .permissions-grid .card-body .row > div {
        margin-bottom: 16px;
    }
    
    .btn-group .btn {
        margin-bottom: 8px;
        width: 100%;
    }
}

/* === ANIMAÇÕES === */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.modal.show .modal-dialog {
    animation: slideInUp 0.3s ease-out;
}

.permission-item.permission-active .permission-icon {
    animation: pulse 0.6s ease-in-out;
}

/* === INDICADORES DE LOADING === */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* === ACESSIBILIDADE === */
.form-control:focus,
.btn:focus,
.custom-control-input:focus ~ .custom-control-label::before {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
