/* Estilos para la sección de configuración */

/* Layout general */
.config-layout {
    display: flex;
    gap: 20px;
}
.config-main-content {
    flex: 3;
}
.config-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Pestañas de navegación */
.tabs-container {
    margin-bottom: 20px;
    padding: 0;
    background-color: rgba(255,255,255,0.2);
    border-radius: 8px;
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--border-color-light);
    flex-wrap: wrap;
}

.tab-item {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

/* Formularios y controles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.input-group.full-width {
    grid-column: span 2;
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.section-group {
    margin-bottom: 30px;
}

.section-group h4 {
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 8px;
}

/* Apariencia y personalización */
.appearance-preview {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 30px;
}

.logo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(255,255,255,0.5);
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.upload-controls {
    flex: 1;
}

.custom-file-upload {
    display: inline-block;
    padding: 10px 15px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-file-upload:hover {
    background-color: var(--primary-dark);
}

.file-input {
    display: none;
}

.file-hint {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Temas y colores */
.theme-options {
    margin-bottom: 20px;
}

.theme-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.theme-card {
    width: 120px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 10px;
    background-color: rgba(255,255,255,0.3);
    border: 2px solid transparent;
}

.theme-card:hover {
    background-color: rgba(255,255,255,0.5);
}

.theme-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(74, 108, 247, 0.2);
}

.theme-preview {
    height: 80px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.default-theme {
    background: linear-gradient(135deg, #4A6CF7 0%, #00D8FF 100%);
}

.dark-theme {
    background: linear-gradient(135deg, #333333 0%, #666666 100%);
}

.light-theme {
    background: linear-gradient(135deg, #E1E5EB 0%, #FFFFFF 100%);
}

.blue-theme {
    background: linear-gradient(135deg, #0056b3 0%, #17a2b8 100%);
}

.color-picker-section {
    background-color: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
}

.color-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.color-input {
    flex: 1;
    min-width: 150px;
}

/* Interruptores y controles deslizantes */
.switch-label {
    display: block;
    margin-bottom: 10px;
}

.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(--primary);
}

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

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

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

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

.interface-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.rangeslider {
    height: 10px;
    background-color: #E1E5EB;
    border-radius: 5px;
    margin: 15px 0;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
}

/* Gestión de usuarios */
.roles-filter {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.role-badge {
    padding: 6px 12px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.role-badge:hover {
    background-color: rgba(255,255,255,0.5);
}

.role-badge.active {
    background-color: var(--primary);
    color: white;
}

.user-table, .roles-table, .backup-table, .api-keys-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.user-table th, .roles-table th, .backup-table th, .api-keys-table th {
    text-align: left;
    padding: 12px 15px;
    background-color: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--border-color-light);
    font-weight: 600;
}

.user-table td, .roles-table td, .backup-table td, .api-keys-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color-light);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
}

.user-position {
    font-size: 0.85em;
    color: var(--text-muted);
}

.role-tag {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    display: inline-block;
}

.role-tag.admin {
    background-color: rgba(114, 115, 229, 0.15);
    color: #7273e5;
}

.role-tag.manager {
    background-color: rgba(52, 128, 222, 0.15);
    color: #3480de;
}

.role-tag.reception {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.role-tag.staff {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.status-tag {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    display: inline-block;
}

.status-tag.active {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.status-tag.inactive {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.actions-dropdown {
    position: relative;
    display: inline-block;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 5px;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--text-dark);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    min-width: 160px;
    padding: 8px 0;
    margin-top: 5px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown-toggle:focus + .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 8px 15px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: rgba(0,0,0,0.05);
}

.dropdown-menu a.text-danger {
    color: #dc3545;
}

.dropdown-menu a.text-success {
    color: #28a745;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.role-name {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-block;
}

.role-name.admin {
    background-color: rgba(114, 115, 229, 0.15);
    color: #7273e5;
}

.role-name.manager {
    background-color: rgba(52, 128, 222, 0.15);
    color: #3480de;
}

.role-name.reception {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.role-name.staff {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.permissions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.permission-tag {
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
    font-size: 0.8em;
}

.role-actions {
    margin-top: 20px;
    text-align: right;
}

/* Integraciones */
.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 8px 15px;
    background-color: rgba(255,255,255,0.2);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background-color: rgba(255,255,255,0.4);
}

.category-btn.active {
    background-color: var(--primary);
    color: white;
}

.integration-category-content {
    display: none;
}

.integration-category-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

.integration-card {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.integration-card:hover {
    background-color: rgba(255,255,255,0.5);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.integration-logo {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.integration-logo img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
}

.integration-details {
    flex: 1;
    margin-bottom: 15px;
}

.integration-details h4 {
    margin-bottom: 8px;
}

.integration-details p {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.integration-status {
    font-size: 0.85em;
    color: var(--text-muted);
}

.integration-status.connected {
    color: #28a745;
}

.integration-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.view-more-integrations {
    text-align: center;
    margin: 20px 0;
}

.api-keys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color-light);
}

.api-key {
    display: flex;
    align-items: center;
    gap: 5px;
}

.api-key code {
    background-color: rgba(0,0,0,0.05);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Webhooks */
.section-intro {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.endpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.no-endpoints-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    color: var(--text-muted);
    background-color: rgba(0,0,0,0.02);
    border-radius: 8px;
    margin-bottom: 30px;
}

.no-endpoints-message i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.webhook-events {
    margin-top: 30px;
}

.event-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.event-group {
    background-color: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 6px;
}

.event-group h5 {
    margin-bottom: 10px;
    font-weight: 600;
}

.event-item {
    margin-bottom: 8px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-container input:checked ~ .checkmark:after {
    content: "";
    position: absolute;
    display: block;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Configuración avanzada - Copias de seguridad */
.backup-info {
    margin-bottom: 30px;
}

.backup-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 2em;
}

.status-icon.success {
    color: #28a745;
}

.backup-schedule h4 {
    margin-bottom: 15px;
}

.schedule-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.backup-history h4 {
    margin-bottom: 15px;
}

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

.status.success {
    color: #28a745;
}

.backup-actions {
    text-align: right;
}

/* Logs del sistema */
.logs-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background-color: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    align-items: flex-end;
}

.log-viewer {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
}

.log-entries {
    display: flex;
    flex-direction: column;
}

.log-entry {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    width: 160px;
    color: #6c757d;
}

.log-level {
    width: 80px;
    font-weight: bold;
    text-align: center;
    padding: 2px 5px;
    border-radius: 3px;
}

.log-level.error {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.log-level.warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.log-level.info {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.log-module {
    width: 120px;
    font-weight: 500;
}

.log-message {
    flex: 1;
}

.log-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Configuración SMTP */
.test-email-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color-light);
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 992px) {
    .config-layout {
        flex-direction: column;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .input-group.full-width {
        grid-column: span 1;
    }
    .tabs-nav {
        flex-wrap: wrap;
    }
    .interface-options {
        grid-template-columns: 1fr;
    }
    .appearance-preview {
        flex-direction: column;
    }
    .integration-cards {
        grid-template-columns: 1fr;
    }
    .event-groups {
        grid-template-columns: 1fr;
    }
}
