/* Variables */
:root {
    --primary: #4E86D4;
    --secondary: #1BBAFF;
    --accent: #F1B501;
    --success: #62C516;
    --danger: #FF6A6A;
    --purple: #4B3FC5;
    --white: #FFFFFF;
    --dark-blue: #222D5D;
    --medium-blue: #3E6791;
    --light-blue: #4DACD9;
    --light-purple: #A8B0CE;
    --gray: #f5f5f5;
    --dark-gray: #e0e0e0;
    --text-dark: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: var(--text-dark);
    overflow-x: hidden; /* Adicionado para remover a rolagem lateral */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Container */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    height: 100vh;
    background: var(--dark-blue);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition);
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-frame {
    width: 280px;
    height: 100vh;
    border: none;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul li {
    position: relative;
    margin-bottom: 5px;
}

.sidebar-menu ul li a {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.sidebar-menu ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu ul li.active a {
    background: var(--primary);
}

.sidebar-menu ul li a i {
    font-size: 18px;
    margin-right: 10px;
    width: 25px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0; /* Changed from 280px */
    padding: 20px;
    transition: var(--transition);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--dark-gray);
}

.header h1 {
    color: var(--dark-blue);
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    margin-right: 10px;
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Sections */
.content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.profile-section, .permissions-section {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.profile-section h2, .permissions-section h2 {
    color: var(--dark-blue);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center; /* Adicionado para centralizar o texto */
}

.profile-actions {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 6px 10px; /* Reduced padding */
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center; /* Center the text */
    align-items: center;
    gap: 8px;
    font-size: 14px;
    width: 120px; /* Set a fixed width for consistency */
}

.btn-primary:hover {
    background: var(--medium-blue);
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--dark-gray);
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Profile Cards */
.profiles-list {
    max-height: 500px;
    overflow-y: auto;
}

.profile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    background: var(--gray);
    transition: var(--transition);
}

.profile-card:hover {
    background: var(--dark-gray);
}

.profile-card.active {
    border-left: 4px solid var(--primary);
}

.profile-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.profile-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
}

.profile-status.active {
    background: rgba(98, 197, 22, 0.2);
    color: var(--success);
}

.profile-status.inactive {
    background: rgba(255, 106, 106, 0.2);
    color: var(--danger);
}

.btn-edit, .btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: var(--transition);
}

.btn-edit {
    color: var(--primary);
}

.btn-delete {
    color: var(--danger);
}

.btn-edit:hover, .btn-delete:hover {
    transform: scale(1.1);
}

/* Permissions Grid */
.selected-profile {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--medium-blue);
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.permission-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--dark-gray);
    cursor: pointer;

}

.permission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--light-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.card-icon i {
    font-size: 24px;
    color: var(--dark-blue);
}

.permission-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--dark-blue);
}

.permission-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    height: 40px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--success);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Permission Details */
.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--white);
    border-radius: 5px;
    margin-bottom: 10px;
}

.permission-item .switch {
    width: 44px;
    height: 22px;
}

.permission-item .slider:before {
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
}

.permission-item input:checked + .slider:before {
    transform: translateX(22px);
}

.permission-details {
    background: var(--gray);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.permission-details h3 {
    color: var(--dark-blue);
    margin-bottom: 20px;
    font-size: 18px;
}

.permission-list {
    margin-bottom: 20px;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--white);
    border-radius: 5px;
    margin-bottom: 10px;
}

.permission-item span {
    flex: 1;
    margin-right: 0px;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap; /* Add this to prevent wrapping */
    white-space: nowrap; /* Add this to keep text on one line */
}

.btn-secondary {
    background: var(--light-purple);
    color: var(--dark-blue);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--dark-gray);
}

/* Modal - correção */
.modal {
    display: none; /* Inicialmente escondido */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Quando visível, usando flexbox para centralização */
.modal.visible {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0 auto; /* Centraliza horizontalmente */
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-header .close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #4a90e2;
    outline: none;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option label {
    margin: 0;
    cursor: pointer;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer button {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

.btn-primary {
    background-color: #4a90e2;
    border: none;
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-dark);
}

.modal-body {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--dark-gray);
    border-radius: 5px;
    outline: none;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--dark-gray);
}

/* Responsive */
@media (max-width: 992px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        margin-left: 0; /* Ensure consistency in responsive mode */
    }
    
        
    .main-content {
        margin-left: 70px;
    }
    
    
}

@media (max-width: 768px) {
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info {
        margin-top: 10px;
    }
    
    .profile-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
}
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px; /* Adjust the padding as needed */
    position: absolute;
    top: 10px;
    left: auto; /* Certifique-se de que left não esteja definido */
    right: 20px;
    background-color: #3498db; /* azul */
    color: #ffffff; /* branco */
    line-height: 1.2;  /* Adjust the line-height if necessary */
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    }

    .back-button i {
    margin-right: 5px; /* Add some space between the icon and text */
    }

.btn-toggle-status {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: var(--transition);
    color: var(--success);
}

.btn-toggle-status.inactive {
    color: var(--danger);
}

.btn-toggle-status:hover {
    transform: scale(1.1);
}
