/**
 * Permission Quick Access Sidebar Styles
 */

/* Sidebar Container */
.permission-sidebar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.permission-sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.permission-sidebar-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .permission-sidebar-content {
    width: 100%;
    right: 0;
  }
}

/* Sidebar Header */
.permission-sidebar-header {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f5f5f5;
}

.permission-sidebar-header h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.permission-sidebar-header code {
  background-color: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #d9534f;
}

.permission-sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.permission-sidebar-close:hover {
  color: #000;
}

/* Sidebar Body */
.permission-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

/* Tabs */
.permission-sidebar-body .nav-tabs {
  border-bottom: 1px solid #ddd;
  margin-bottom: 15px;
}

.permission-sidebar-body .nav-tabs > li > a {
  padding: 8px 12px;
  font-size: 13px;
}

.permission-sidebar-body .tab-pane {
  padding: 10px 0;
}

/* Form Elements */
.permission-sidebar-body .form-group {
  margin-bottom: 15px;
}

.permission-sidebar-body .form-group label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 5px;
  display: block;
  color: #333;
}

.permission-sidebar-body .form-control {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.permission-sidebar-body .form-control:focus {
  outline: none;
  border-color: #0275d8;
  box-shadow: 0 0 0 0.2rem rgba(2, 117, 216, 0.25);
}

/* FAQ Panels */
.perm-faq {
  margin-top: 12px;
}

.perm-faq .panel {
  border: 1px solid #e5e9f0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  background-color: #fafbfc;
}

.perm-faq .panel + .panel {
  margin-top: 8px;
}

.perm-faq .panel-heading {
  background: linear-gradient(90deg, #f6f9ff, #fbfdff);
  padding: 10px 12px;
  border-bottom: 1px solid #e5e9f0;
}

.perm-faq .panel-title a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #1b4d8b;
  font-weight: 600;
  text-decoration: none;
}

.perm-faq .panel-title a:after {
  content: '\f107';
  font-family: 'FontAwesome';
  font-size: 14px;
  color: #6c7a90;
  transition: transform 0.2s ease;
}

.perm-faq .panel-title a.collapsed:after {
  transform: rotate(-90deg);
}

.perm-faq .panel-body {
  background: #fff;
  padding: 12px;
  line-height: 1.55;
  font-size: 12.5px;
  color: #2c3e50;
}

.perm-faq .faq-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.perm-faq .faq-point:before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f85ff;
  margin-top: 6px;
  flex-shrink: 0;
}

.perm-faq .faq-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.perm-faq .faq-pill {
  background: #e8f1ff;
  color: #1b4d8b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Buttons */
.permission-sidebar-body .btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 10px;
}

.permission-sidebar-body .btn-primary {
  background-color: #0275d8;
  border-color: #0275d8;
  color: #fff;
}

.permission-sidebar-body .btn-primary:hover {
  background-color: #025aa5;
  border-color: #01549b;
}

/* Lock Icon Button (next to form fields) */
.permission-lock-icon {
  margin-left: 5px;
  padding: 6px 8px !important;
  vertical-align: top;
}

.permission-lock-icon i {
  margin-right: 0;
}

.permission-lock-icon:hover {
  background-color: #d9edf7;
  color: #31708f;
}

/* Disabled field style by permission */
.permission-field-disabled,
.permission-field-disabled .select2-selection,
.permission-field-disabled .form-control {
  opacity: 0.6;
  pointer-events: none;
}

/* Field wrapper adjustment */
.form-group {
  position: relative;
}

.permission-lock-icon {
  display: inline-block;
  margin-top: 25px;
}

/* Scrollbar Styling for Sidebar */
.permission-sidebar-body::-webkit-scrollbar {
  width: 6px;
}

.permission-sidebar-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.permission-sidebar-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.permission-sidebar-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Animation */
.permission-sidebar-modal {
  animation: sidebarFadeIn 0.3s ease-in-out;
}

@keyframes sidebarFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.permission-sidebar-content {
  animation: sidebarSlideIn 0.3s ease-in-out;
}

@keyframes sidebarSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Print Styles */
@media print {
  .permission-lock-icon,
  .permission-sidebar-modal {
    display: none !important;
  }
}
