/*
* Configuration Panel Styles
* Panel di configurazione sistema simile al template customizer
******************************************************************************/

/* Configuration Panel Main Container */
#configuration-panel {
  position: fixed;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 0.3125rem 1.375rem 0 rgba(34, 48, 62, 0.18);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: inherit;
  width: 400px;
  top: 0;
  right: 0;
  transform: translateX(420px);
  transition: transform 0.2s ease-in;
  background: var(--bs-body-bg, #fff);
}

/* Dark theme support */
[data-bs-theme=dark] #configuration-panel {
  box-shadow: 0 0.3125rem 1.375rem 0 rgba(20, 20, 29, 0.26);
}

/* Panel open state */
#configuration-panel.config-panel-open {
  transform: none;
  transition-delay: 0.1s;
}

/* Configuration Panel Open Button */
.config-panel-open-btn {
  position: absolute;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dc3545;
  height: 38px;
  border-bottom-left-radius: 50%;
  border-top-left-radius: 50%;
  box-shadow: 0 0.125rem 0.25rem 0 rgba(220, 53, 69, 0.4);
  color: #fff;
  font-size: 18px;
  width: 38px;
  top: 240px;
  left: 0;
  opacity: 1;
  transform: translateX(-58px);
  transition: all 0.1s linear 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.config-panel-open-btn i {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-panel-open-btn:hover {
  color: #fff;
  text-decoration: none;
  background: #0d6efd;
}

.config-panel-open-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Hide button when panel is open */
#configuration-panel.config-panel-open .config-panel-open-btn {
  opacity: 0;
  transform: none;
  transition-delay: 0s;
}

/* Panel Inner Content */
.config-panel-inner {
  position: relative;
  overflow: auto;
  flex: 0 1 auto;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Panel Header */
.config-panel-header {
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  background: var(--bs-body-bg, #fff);
}

.config-panel-header h3 {
  color: var(--bs-heading-color, #212529);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.config-panel-header p {
  color: var(--bs-body-color, #6c757d);
  opacity: 0.8;
}

.config-panel-header a:hover,
.config-panel-header a:hover .icon-base {
  color: inherit !important;
}

/* Close button */
.config-panel-close-btn {
  color: var(--bs-body-color, #6c757d);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}

.config-panel-close-btn:hover {
  color: #dc3545;
  text-decoration: none;
}

/* Panel Sections */
.config-panel-section {
  padding-bottom: 1rem;
}

.config-panel-section h5 {
  color: var(--bs-heading-color, #212529);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-panel-section .bg-label-primary {
  background-color: rgba(13, 110, 253, 0.1) !important;
  color: #0d6efd;
}

.config-panel-section .bg-label-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
  color: #ffc107;
}

.config-panel-section .bg-label-info {
  background-color: rgba(13, 202, 240, 0.1) !important;
  color: #0dcaf0;
}

/* Panel Links */
.config-panel-inner ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.config-panel-inner ul li {
  margin-bottom: 0;
}

.config-panel-inner ul li a {
  color: var(--bs-body-color, #212529);
  text-decoration: none;
  padding: 0.5rem 0;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
}

.config-panel-inner ul li a:hover {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.08);
  text-decoration: none;
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.config-panel-inner ul li a i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

/* Divider */
.config-panel-inner hr {
  border-color: var(--bs-border-color, #dee2e6);
  opacity: 0.5;
  margin: 1.5rem 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  #configuration-panel {
    display: none;
    visibility: hidden;
  }
}

/* RTL Support */
:dir(rtl) #configuration-panel:not(.config-panel-open) {
  transform: translateX(-420px);
}

:dir(rtl) .config-panel-open-btn {
  transform: translateX(58px);
}

:dir(rtl) .config-panel-open-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
}

/* Animation improvements */
.config-panel-inner ul li a {
  transform: translateX(0);
  transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.config-panel-inner ul li a:hover {
  transform: translateX(0.25rem);
}

:dir(rtl) .config-panel-inner ul li a:hover {
  transform: translateX(-0.25rem);
}

/* Special styling for different colored items */
.config-panel-inner ul li a.text-warning {
  color: #ffc107 !important;
}

.config-panel-inner ul li a.text-warning:hover {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107 !important;
}

/* Loading state (if needed) */
.config-panel-loading {
  pointer-events: none;
  opacity: 0.6;
}

.config-panel-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
}

/* Scrollbar styling for webkit browsers */
.config-panel-inner::-webkit-scrollbar {
  width: 6px;
}

.config-panel-inner::-webkit-scrollbar-track {
  background: transparent;
}

.config-panel-inner::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.config-panel-inner::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Bootstrap 5 compatibility */
.px-6 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.py-4 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.pt-6 {
  padding-top: 1.5rem !important;
}

.pb-6 {
  padding-bottom: 1.5rem !important;
}

.me-3 {
  margin-right: 0.75rem !important;
}

.me-5 {
  margin-right: 1.25rem !important;
}

.mt-6 {
  margin-top: 1.5rem !important;
}

.mb-3 {
  margin-bottom: 0.75rem !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.small {
  font-size: 0.875em;
}

.fw-light {
  font-weight: 300 !important;
}

.rounded-1 {
  border-radius: 0.25rem !important;
}

.icon-lg {
  font-size: 1.25rem;
}

.text-heading {
  color: var(--bs-heading-color, #212529) !important;
}