/**
 * @file settings.css
 * @brief Settings tab styling - separated from view logic for MVC compliance
 * @note Modern, responsive design with professional appearance
 * @copyright Copyright (c) 2025 GLT Design. All rights reserved.
 */

/* Settings Header */
.settings-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
}

/* Settings Sidebar */
.settings-sidebar .card {
  border-radius: 12px;
  overflow: hidden;
}

.settings-nav .list-group-item {
  border: none;
  padding: 0.875rem 1.25rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.settings-nav .list-group-item:hover {
  background-color: #f8f9fa;
  border-left-color: #0d6efd;
  transform: translateX(2px);
}

.settings-nav .list-group-item.active {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: white;
  border-left-color: #0a58ca;
  font-weight: 500;
}

.settings-nav .list-group-item.active i {
  color: white;
}

.settings-nav .list-group-item i {
  width: 20px;
  color: #6c757d;
  transition: color 0.2s ease;
}

/* Settings Sections */
.settings-section .card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.settings-section .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  padding: 1.25rem 1.5rem;
}

.settings-section .card-header h6 {
  font-weight: 600;
  color: #495057;
  margin: 0;
}

.settings-section .card-body {
  padding: 1.5rem;
}

/* User Info Badge */
.settings-user-info .badge {
  font-size: 0.875rem;
  border-radius: 8px;
}

/* Form Improvements */
.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 0.625rem 0.875rem;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Button Improvements */
.btn {
  border-radius: 8px;
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

/* Table Improvements */
.table {
  margin-bottom: 0;
}

.table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  padding: 1rem 0.75rem;
}

.table td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Badge Improvements */
.badge {
  border-radius: 6px;
  font-weight: 500;
}

/* Alert Improvements */
.alert {
  border-radius: 10px;
  border: none;
  padding: 1rem 1.25rem;
}

/* Modal Improvements */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  border-radius: 12px 12px 0 0;
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .settings-header {
    padding: 1rem;
  }

  .settings-header .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .settings-sidebar {
    margin-bottom: 1.5rem;
  }

  .settings-nav .list-group-item {
    padding: 0.75rem 1rem;
  }
}

/* Loading State */
.settings-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation for Section Transitions */
.settings-section {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Action Button Groups */
.btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Status Badges */
.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

/* Enhanced Focus States */
.form-control:focus,
.form-select:focus,
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Improved Hover States */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* Card Hover Effects */
.settings-section .card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* Loading Spinner for Settings */
.settings-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

/* Enhanced Typography */
.settings-section h6 {
  font-size: 1rem;
  line-height: 1.5;
}

.settings-section .card-header h6 {
  display: flex;
  align-items: center;
}

.settings-section .card-header h6 i {
  margin-right: 0.5rem;
  font-size: 1.1em;
}

/* Improved Form Layout */
.form-floating {
  margin-bottom: 1rem;
}

.form-floating > .form-control,
.form-floating > .form-select {
  height: calc(3.5rem + 2px);
  line-height: 1.25;
}

/* Enhanced Alert Styling */
.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 1.25rem 1rem;
}

/* Improved Modal Animations */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

/* Enhanced Table Actions */
.table .btn-group {
  white-space: nowrap;
}

.table .btn-group .btn {
  margin: 0 1px;
}

/* Improved Navigation Active State */
.settings-nav .list-group-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #0a58ca;
}

/* Enhanced Card Headers */
.card-header .btn {
  margin-left: auto;
}

/* Improved Form Validation */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #198754;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Input Group Validation Border Radius Fix */
/* Fix for input groups with prepended text (like language codes) */
.input-group .form-control.is-invalid {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

.input-group .form-control.is-valid {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

/* Specific fix for payment type modal language input groups */
#paymentTypeModal .input-group .form-control.is-invalid {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

#paymentTypeModal .input-group .form-control.is-valid {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Ensure input group text maintains proper styling */
.input-group .input-group-text {
  border-top-left-radius: 0.375rem !important;
  border-bottom-left-radius: 0.375rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Fix for standalone form controls (not in input groups) */
.form-control.is-invalid:not(.input-group .form-control) {
  border-radius: 0.375rem !important;
}

.form-control.is-valid:not(.input-group .form-control) {
  border-radius: 0.375rem !important;
}

/* Enhanced Accessibility */
.settings-nav .list-group-item:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

.btn:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* User Management Folder Cards */
.user-folder {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.user-folder:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Folder Tab (Top part that looks like a folder tab) */
.folder-tab {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.folder-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d6efd, #0b5ed7);
  border-radius: 8px 8px 0 0;
}

.folder-tab-content {
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 0;
}

.folder-icon {
  font-size: 1.25rem;
  color: #0d6efd;
  margin-right: 0.5rem;
}

/* User Initials Circle */
.user-initials-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-initials-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* Folder Info Container */
.folder-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

.folder-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.05rem;
  line-height: 1.1;
}

.folder-name {
  font-weight: 600;
  color: #495057;
  font-size: 1.2rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

.folder-actions .btn {
  color: #6c757d;
  border: none;
  background: transparent;
  padding: 0.25rem;
}

.folder-actions .btn:hover {
  color: #495057;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Folder Body (Main content area) */
.folder-body {
  padding: 1rem;
  background: #fff;
}

.folder-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

.info-item i {
  width: 20px;
  color: #6c757d;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.info-text {
  color: #495057;
  flex-grow: 1;
}

.info-item .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  margin-left: 0.25rem;
}

/* Dropdown Menu Styling */
.user-folder .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  min-width: 180px;
  max-width: 200px;
  transform: translateX(-50%);
}

/* Ensure dropdowns don't cause overflow */
.dropdown-menu {
  max-width: calc(100vw - 2rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Specific targeting for payment types dropdown menus */
.user-folder .dropdown-menu,
.payment-type-card .dropdown-menu,
[data-bs-toggle="dropdown"] + .dropdown-menu {
  max-width: calc(100vw - 4rem) !important;
  min-width: 120px !important;
  width: auto !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
}

/* Force dropdown positioning to stay within viewport */
.dropdown-menu.show {
  position: absolute !important;
  will-change: transform;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  max-width: calc(100vw - 4rem) !important;
}

.user-folder .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.user-folder .dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(2px);
}

.user-folder .dropdown-item.text-danger:hover {
  background-color: #f8d7da;
  color: #721c24;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .folder-tab {
    padding: 0.5rem 0.75rem;
  }

  .folder-name {
    font-size: 1rem;
    line-height: 1.3;
  }

  .folder-subtitle {
    font-size: 0.75rem;
  }

  .user-initials-circle {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
  }

  .folder-body {
    padding: 0.75rem;
  }

  .info-item {
    font-size: 0.8rem;
  }

  .info-item i {
    width: 18px;
    font-size: 0.8rem;
  }
}

/* Desktop Folder Layout */
@media (min-width: 1200px) {
  /* Large screens: 3 folders per row */
  .user-folder {
    min-height: 200px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  /* Medium-large screens: 2 folders per row */
  .user-folder {
    min-height: 180px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  /* Tablet screens: 2 folders per row */
  .user-folder {
    min-height: 160px;
  }
}

@media (max-width: 767px) {
  /* Mobile screens: 1 folder per row */
  .user-folder {
    min-height: 140px;
  }
}

/* Empty State Styling */
.text-center .display-4 {
  color: #dee2e6;
  font-size: 3rem;
}

/* Improved Mobile Navigation */
@media (max-width: 991px) {
  .settings-sidebar {
    margin-bottom: 2rem;
  }

  .settings-nav .list-group-item {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .settings-nav .list-group-item i {
    width: 24px;
    font-size: 1.1rem;
  }
}

/* Enhanced Mobile Table Responsiveness */
@media (max-width: 991px) {
  .table-responsive {
    border-radius: 8px;
  }

  .table th,
  .table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  .btn-group-sm .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}

/* Folder Animation */
.user-folder {
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered Animation for Multiple Folders */
.user-folder:nth-child(1) {
  animation-delay: 0.1s;
}
.user-folder:nth-child(2) {
  animation-delay: 0.2s;
}
.user-folder:nth-child(3) {
  animation-delay: 0.3s;
}
.user-folder:nth-child(4) {
  animation-delay: 0.4s;
}
.user-folder:nth-child(5) {
  animation-delay: 0.5s;
}

/* Folder Hover Effects */
.user-folder:hover .folder-tab {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.user-folder:hover .folder-icon {
  color: #0b5ed7;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* Create User Modal Folder Styling */
.create-user-folder {
  background: #fff;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.create-user-folder .folder-tab {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
  position: relative;
}

.create-user-folder .folder-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #198754, #157347);
  border-radius: 12px 12px 0 0;
}

.create-user-folder .folder-icon {
  font-size: 1.5rem;
  color: #198754;
  margin-right: 0.75rem;
}

.create-user-folder .folder-name {
  font-weight: 600;
  color: #495057;
  font-size: 1rem;
}

.create-user-folder .folder-actions .btn {
  color: #6c757d;
  font-size: 1.2rem;
}

.create-user-folder .folder-actions .btn:hover {
  color: #495057;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Modal Folder Body */
.modal .folder-body {
  padding: 2rem;
  background: #fff;
}

.modal .folder-body.compact-modal {
  padding: 1.5rem;
}

.folder-info-section {
  border-bottom: 1px solid #f1f3f4;
  padding-bottom: 1.5rem;
}

.folder-info-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title {
  color: #495057;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.section-title i {
  color: #0d6efd;
}

/* Info Items in Modal */
.modal .info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.modal .info-item.compact {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
}

.modal .info-item:hover {
  background: #f1f3f4;
  border-color: #dee2e6;
}

.modal .info-item i {
  width: 24px;
  color: #6c757d;
  margin-right: 1rem;
  margin-top: 0.5rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.modal .info-content {
  flex-grow: 1;
  width: 100%;
}

.modal .info-content .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.modal .info-content .form-control,
.modal .info-content .form-select {
  border-radius: 6px;
  border: 1px solid #ced4da;
  font-size: 0.9rem;
}

.modal .info-content .form-control:focus,
.modal .info-content .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* UNIFIED TOGGLE SYSTEM - Added to existing styles */

/* Base Toggle Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.5rem;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 1.5rem;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 1.1rem;
  width: 1.1rem;
  left: 0.2rem;
  bottom: 0.2rem;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #198754;
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px #198754;
}

input:checked + .toggle-slider:before {
  transform: translateX(1.5rem);
}

/* Toggle Item Container */
.toggle-item {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.toggle-item:hover {
  background: #f1f3f4 !important;
  border-color: #dee2e6 !important;
}

.toggle-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-label-group {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.toggle-icon {
  width: 20px;
  color: #6c757d;
  margin-right: 0.75rem;
  font-size: 1rem;
  text-align: center;
}

.toggle-label {
  font-weight: 500;
  color: #495057;
  font-size: 0.875rem;
  cursor: pointer;
  flex-grow: 1;
}

.toggle-description {
  color: #6c757d;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

/* Compact Toggle Variant */
.toggle-item.compact {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.toggle-item.compact .toggle-switch {
  width: 2.5rem;
  height: 1.25rem;
}

.toggle-item.compact .toggle-slider:before {
  height: 0.9rem;
  width: 0.9rem;
}

.toggle-item.compact input:checked + .toggle-slider:before {
  transform: translateX(1.25rem);
}

.toggle-item.compact .toggle-label {
  font-size: 0.8rem;
}

.toggle-item.compact .toggle-description {
  font-size: 0.75rem;
}

/* Toggle Group Container */
.toggle-group {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.toggle-group .toggle-item {
  background: #fff !important;
  margin-bottom: 0.5rem;
}

.toggle-group .toggle-item:last-child {
  margin-bottom: 0;
}

/* Responsive Toggle Adjustments */
@media (max-width: 768px) {
  .toggle-item {
    padding: 0.5rem;
  }

  .toggle-icon {
    width: 18px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
  }

  .toggle-label {
    font-size: 0.8rem;
  }

  .toggle-description {
    font-size: 0.75rem;
  }

  .toggle-switch {
    width: 2.5rem;
    height: 1.25rem;
  }

  .toggle-slider:before {
    height: 0.9rem;
    width: 0.9rem;
  }

  input:checked + .toggle-slider:before {
    transform: translateX(1.25rem);
  }
}

/* END UNIFIED TOGGLE SYSTEM */

/* Toggle Switches */
.toggle-item {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
}

.toggle-item:hover {
  background: #f1f3f4 !important;
  border-color: #dee2e6 !important;
}

.form-check-input {
  width: 3rem;
  height: 1.5rem;
  border-radius: 1rem;
  background-color: #dee2e6;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-check-input:checked {
  background-color: #198754;
  border-color: #198754;
}

.form-check-input:focus {
  border-color: #198754;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.form-check-label {
  cursor: pointer;
  margin-left: 0.75rem;
  font-weight: 500;
}

.form-text {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Modal Footer Styling */
.modal-footer.bg-light {
  background-color: #f8f9fa !important;
  padding: 1rem 2rem;
}

.modal-footer .btn {
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  border-radius: 6px;
}

.modal-footer .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.modal-footer .btn-success {
  background-color: #198754;
  border-color: #198754;
}

.modal-footer .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Modal Adjustments */
@media (max-width: 768px) {
  .modal .folder-body {
    padding: 1.5rem;
  }

  .modal .info-item {
    padding: 0.5rem;
    margin-bottom: 1rem;
  }

  .modal .info-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 0.95rem;
  }

  .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
  }

  .modal-footer {
    padding: 1rem 1.5rem;
  }
}

/* Animation for Modal */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

/* Enhanced Toggle Animation */
.form-check-input {
  position: relative;
}

.form-check-input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-check-input:checked::before {
  transform: translateX(1.5rem);
}

/* Compact Modal Styling */
.compact-modal .input-group-text {
  background-color: #f8f9fa;
  border-color: #ced4da;
  color: #6c757d;
  width: 40px;
  justify-content: center;
}

.compact-modal .input-group-sm .form-control,
.compact-modal .input-group-sm .form-select {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.compact-modal .input-group-sm .input-group-text {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
}

/* Compact Toggle Groups */
.toggle-group {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.toggle-group:hover {
  background: #f1f3f4;
  border-color: #dee2e6;
}

.toggle-item-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-item-compact i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.toggle-label {
  font-weight: 500;
  color: #495057;
  font-size: 0.875rem;
  flex-grow: 1;
}

.toggle-item-compact .form-check {
  margin: 0;
}

.toggle-item-compact .form-check-input {
  width: 2.5rem;
  height: 1.25rem;
  margin: 0;
}

.toggle-item-compact .form-check-input::before {
  width: 0.9rem;
  height: 0.9rem;
  top: 2px;
  left: 2px;
}

.toggle-item-compact .form-check-input:checked::before {
  transform: translateX(1.25rem);
}

/* Responsive Compact Modal */
@media (max-width: 768px) {
  .compact-modal {
    padding: 1rem;
  }

  .toggle-group {
    padding: 0.5rem;
  }

  .toggle-label {
    font-size: 0.8rem;
  }

  .toggle-item-compact .form-check-input {
    width: 2rem;
    height: 1rem;
  }

  .toggle-item-compact .form-check-input::before {
    width: 0.7rem;
    height: 0.7rem;
  }

  .toggle-item-compact .form-check-input:checked::before {
    transform: translateX(1rem);
  }
}

/* User Card Field Styling */
.user-card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-field-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.user-field-item:hover {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.field-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.field-icon {
  width: 20px;
  color: #6c757d;
  font-size: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.field-label {
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 60px;
}

.field-text {
  color: #495057;
  font-size: 0.875rem;
  font-weight: 500;
  flex-grow: 1;
}

.user-field-item .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-left: auto;
}

/* Email field special styling */
.user-field-item:first-child {
  border-color: #dee2e6;
}

.user-field-item:first-child .field-text {
  color: #0d6efd;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .user-field-item {
    padding: 0.5rem;
  }

  .field-container {
    gap: 0.5rem;
  }

  .field-icon {
    width: 18px;
    font-size: 0.875rem;
  }

  .field-label {
    font-size: 0.8rem;
    min-width: 50px;
  }

  .field-text {
    font-size: 0.8rem;
  }

  .user-field-item .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* User Details Grid */
.user-details-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-detail-card {
  display: flex;
  align-items: center;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 38px;
  overflow: hidden;
}

.user-detail-card:hover {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.user-detail-card:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.user-detail-card i {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e9ecef;
  border-right: 1px solid #ced4da;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  color: #6c757d;
  min-width: 38px;
  width: 38px;
  align-self: stretch;
  flex-shrink: 0;
}

.detail-value {
  color: #495057;
  font-weight: 400;
  font-size: 0.875rem;
  flex-grow: 1;
  padding: 0.375rem 0.75rem;
  background: #fff !important;
  border: none;
  outline: none;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Language label text overflow styling */
.language-label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: auto;
  max-width: calc(100% - 2rem);
  flex: 1 1 auto;
  min-width: 0;
  display: inline-block;
}

.user-detail-card .badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.75rem;
}

/* Clean card styling with consistent appearance */
.user-detail-card {
  background: #fff !important;
  border-radius: 8px !important;
}

/* Colored borders and icons based on status */
.user-detail-card.bg-danger.bg-opacity-10 {
  border-color: rgba(220, 53, 69, 0.3) !important;
}

.user-detail-card.bg-danger.bg-opacity-10 i {
  background-color: rgba(220, 53, 69, 0.1) !important;
  border-right-color: rgba(220, 53, 69, 0.3) !important;
  color: #dc3545;
}

.user-detail-card.bg-warning.bg-opacity-10 {
  border-color: rgba(255, 193, 7, 0.3) !important;
}

.user-detail-card.bg-warning.bg-opacity-10 i {
  background-color: rgba(255, 193, 7, 0.1) !important;
  border-right-color: rgba(255, 193, 7, 0.3) !important;
  color: #ffc107;
}

.user-detail-card.bg-info.bg-opacity-10 {
  border-color: rgba(13, 202, 240, 0.3) !important;
}

.user-detail-card.bg-info.bg-opacity-10 i {
  background-color: rgba(13, 202, 240, 0.1) !important;
  border-right-color: rgba(13, 202, 240, 0.3) !important;
  color: #0dcaf0;
}

.user-detail-card.bg-primary.bg-opacity-10 {
  border-color: rgba(13, 110, 253, 0.3) !important;
}

.user-detail-card.bg-primary.bg-opacity-10 i {
  background-color: rgba(13, 110, 253, 0.1) !important;
  border-right-color: rgba(13, 110, 253, 0.3) !important;
  color: #0d6efd;
}

.user-detail-card.bg-success.bg-opacity-10 {
  border-color: rgba(25, 135, 84, 0.3) !important;
}

.user-detail-card.bg-success.bg-opacity-10 i {
  background-color: rgba(25, 135, 84, 0.1) !important;
  border-right-color: rgba(25, 135, 84, 0.3) !important;
  color: #198754;
}

.user-detail-card.bg-secondary.bg-opacity-10 {
  border-color: rgba(108, 117, 125, 0.3) !important;
}

.user-detail-card.bg-secondary.bg-opacity-10 i {
  background-color: rgba(108, 117, 125, 0.1) !important;
  border-right-color: rgba(108, 117, 125, 0.3) !important;
  color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .user-detail-card i {
    font-size: 1rem;
    margin-right: 10px;
    width: 18px;
  }

  .detail-value {
    font-size: 0.85rem;
  }

  .user-detail-card .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Personal Information Button Group Styling */
/* High specificity rules to override Bootstrap defaults */

/* Force rounded corners on Cancel buttons when they're the last visible button */
#personal-info-form .input-group #cancel-pending-email-btn,
#personal-info-form .input-group #cancel-pending-password-btn,
#personal-info-form .input-group #cancel-pending-2fa-btn {
  border-top-right-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Force rounded corners on Change/Enable/Reset buttons when they're the last visible button */
#personal-info-form .input-group #change-email-btn,
#personal-info-form .input-group #change-password-btn,
#personal-info-form .input-group #enable-2fa-btn,
#personal-info-form .input-group #reset-2fa-btn {
  border-top-right-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
}

/* Ensure Pending buttons (first in group) have NO rounded corners */
#personal-info-form .input-group #pending-email-btn,
#personal-info-form .input-group #pending-password-btn,
#personal-info-form .input-group #pending-2fa-btn {
  border-radius: 0 !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* General input group button styling with high specificity */
#personal-info-form .input-group .btn:last-child:not(.dropdown-toggle) {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

#personal-info-form .input-group .btn:first-child:not(:last-child) {
  border-top-left-radius: 0.375rem !important;
  border-bottom-left-radius: 0.375rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

#personal-info-form .input-group .btn:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

#personal-info-form .input-group .btn:only-child {
  border-radius: 0.375rem !important;
}

/* Additional fallback rules for maximum compatibility */
.settings-section .input-group .btn.btn-outline-danger {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

.settings-section .input-group .btn.btn-outline-primary {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

.settings-section .input-group .btn.btn-outline-success {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

.settings-section
  .input-group
  .btn.btn-outline-warning:not(#pending-email-btn):not(
    #pending-password-btn
  ):not(#pending-2fa-btn) {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

/* Timeline Styles for Change History */
.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  z-index: 2;
}

.timeline-marker.pending {
  background-color: #fff3cd;
  border: 2px solid #ffc107;
  color: #856404;
}

.timeline-marker.completed {
  background-color: #d1e7dd;
  border: 2px solid #198754;
  color: #0f5132;
}

.timeline-content {
  flex-grow: 1;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-item.pending-change .timeline-content {
  border-color: #ffc107;
  background: #fffbf0;
}

/* Timeline line connecting items */
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2.5rem;
  bottom: -1.5rem;
  width: 2px;
  background: linear-gradient(to bottom, #dee2e6 0%, #dee2e6 100%);
  z-index: 1;
}

.timeline-item.pending-change:not(:last-child)::before {
  background: linear-gradient(to bottom, #ffc107 0%, #dee2e6 50%);
}

/* Timeline separator */
.timeline-separator {
  position: relative;
  margin: 2rem 0;
  text-align: center;
}

.separator-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #dee2e6;
  z-index: 1;
}

.separator-text {
  position: relative;
  display: inline-block;
  background: #fff;
  padding: 0 1rem;
  z-index: 2;
  color: #6c757d;
  font-weight: 500;
}

/* Responsive timeline adjustments */
@media (max-width: 767px) {
  .timeline-item {
    padding-left: 2.5rem;
  }

  .timeline-marker {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .timeline-item:not(:last-child)::before {
    left: 0.75rem;
    top: 2rem;
  }

  .timeline-content {
    padding: 0.75rem;
  }
}

/* UNIFIED CHECKBOX SYSTEM */

/* Traditional Checkbox Style - Global class for standard checkboxes */
.form-check-traditional .form-check-input {
  width: 1em !important;
  height: 1em !important;
  border-radius: 0.25em !important;
  background-color: var(--bs-body-bg) !important;
  border: var(--bs-border-width) solid var(--bs-border-color) !important;
  transition: none !important;
  margin-right: 0.375rem !important;
}

.form-check-traditional .form-check-input::before {
  display: none !important;
}

.form-check-traditional .form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.form-check-traditional .form-check-input:focus {
  border-color: #86b7fe !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.form-check-traditional .form-check-label {
  margin-left: 0 !important;
}

/* Checkbox Item Container */
.checkbox-item {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  background: #f1f3f4 !important;
  border-color: #dee2e6 !important;
}

.checkbox-item-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.checkbox-label-group {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.checkbox-icon {
  width: 20px;
  color: #6c757d;
  margin-right: 0.75rem;
  font-size: 1rem;
  text-align: center;
}

.checkbox-label {
  font-weight: 500;
  color: #495057;
  font-size: 0.875rem;
  cursor: pointer;
  flex-grow: 1;
}

.checkbox-description {
  color: #6c757d;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

/* Compact Checkbox Variant */
.checkbox-item.compact {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.checkbox-item.compact .checkbox-label {
  font-size: 0.8rem;
}

.checkbox-item.compact .checkbox-description {
  font-size: 0.75rem;
}

/* Checkbox Group Container */
.checkbox-group {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox-group .checkbox-item {
  background: #fff !important;
  margin-bottom: 0.5rem;
}

.checkbox-group .checkbox-item:last-child {
  margin-bottom: 0;
}

/* Inline Checkbox Items */
.checkbox-item-inline {
  display: inline-flex;
  align-items: center;
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-right: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.checkbox-item-inline:hover {
  background: #f1f3f4 !important;
  border-color: #e9ecef !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-item-inline:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.checkbox-item-inline.checked {
  background: #e7f3ff !important;
  border-color: #e9ecef !important;
}

.checkbox-item-inline.checked:hover {
  background: #d4edff !important;
  border-color: #e9ecef !important;
}

.checkbox-item-inline .form-check {
  margin: 0;
  pointer-events: none;
}

.checkbox-item-inline .form-check-input {
  margin-right: 0.5rem !important;
  pointer-events: none;
}

.checkbox-item-inline .form-check-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  margin: 0 !important;
  cursor: pointer;
  pointer-events: none;
}

/* Responsive Checkbox Adjustments */
@media (max-width: 768px) {
  .checkbox-item {
    padding: 0.5rem;
  }

  .checkbox-icon {
    width: 18px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
  }

  .checkbox-label {
    font-size: 0.8rem;
  }

  .checkbox-description {
    font-size: 0.75rem;
  }

  .checkbox-item-inline {
    padding: 0.375rem 0.5rem;
    margin-right: 0.5rem;
  }

  .checkbox-item-inline .form-check-label {
    font-size: 0.8rem;
  }
}

/* END UNIFIED CHECKBOX SYSTEM */

/* Responsive Button Text Hiding for Personal Information Section */
@media (max-width: 991.98px) {
  /* Hide button text on smaller screens, keep only icons */
  #personal-info-form .input-group .btn .btn-text {
    display: none !important;
  }

  /* Ensure icons remain visible */
  #personal-info-form .input-group .btn i {
    margin-right: 0 !important;
  }

  /* Adjust button padding for icon-only display - 15px left and right */
  #personal-info-form .input-group .btn {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Show button text on larger screens */
@media (min-width: 992px) {
  /* Ensure button text is visible on larger screens */
  #personal-info-form .input-group .btn .btn-text {
    display: inline !important;
  }

  /* Restore icon margin on larger screens */
  #personal-info-form .input-group .btn i {
    margin-right: 0.25rem !important;
  }

  /* Hide any tooltip visibility on larger screens */
  #personal-info-form .input-group .btn .tooltip {
    display: none !important;
  }
}

/* Custom tooltip z-index to stay behind modals */
.settings-tooltip {
  z-index: 1020 !important; /* Bootstrap modals use z-index 1055, so this stays behind */
}

/* Modern User Profile Card */
.user-profile-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  min-width: 280px;
}

.user-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-color: #0d6efd;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  border-radius: 50%;
  margin-right: 1rem;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.user-avatar i {
  font-size: 1.75rem;
  color: white;
}

.user-initials {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-profile-card:hover .user-avatar {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

.user-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.role-badge i {
  font-size: 0.75rem;
  margin-right: 0.375rem;
}

/* Role-specific styling */
.role-badge.role-superadmin {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border-color: #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.role-badge.role-admin {
  background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%);
  color: white;
  border-color: #fd7e14;
  box-shadow: 0 2px 8px rgba(253, 126, 20, 0.25);
}

.role-badge.role-manager {
  background: linear-gradient(135deg, #20c997 0%, #1aa179 100%);
  color: white;
  border-color: #20c997;
  box-shadow: 0 2px 8px rgba(32, 201, 151, 0.25);
}

.role-badge.role-user {
  background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
  color: white;
  border-color: #6f42c1;
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.25);
}

.role-badge.role-unknown {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  border-color: #6c757d;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.25);
}

/* Hover effects for role badges */
.user-profile-card:hover .role-badge.role-superadmin {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
}

.user-profile-card:hover .role-badge.role-admin {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(253, 126, 20, 0.35);
}

.user-profile-card:hover .role-badge.role-manager {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(32, 201, 151, 0.35);
}

.user-profile-card:hover .role-badge.role-user {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.35);
}

.user-profile-card:hover .role-badge.role-unknown {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.35);
}

/* Responsive adjustments for user profile card */
@media (max-width: 1199px) {
  .user-profile-card {
    min-width: 240px;
    padding: 0.875rem 1rem;
  }

  .user-avatar {
    width: 3rem;
    height: 3rem;
    margin-right: 0.875rem;
  }

  .user-avatar i {
    font-size: 1.5rem;
  }

  .user-name {
    font-size: 1rem;
  }

  .role-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }
}

@media (max-width: 991px) {
  .settings-header .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .user-profile-card {
    align-self: stretch;
    min-width: auto;
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 767px) {
  .user-profile-card {
    padding: 0.75rem;
    max-width: none;
  }

  .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.75rem;
  }

  .user-avatar i {
    font-size: 1.25rem;
  }

  .user-name {
    font-size: 0.95rem;
  }

  .role-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }

  .role-badge i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
  }
}

/* Animation for profile card appearance */
.user-profile-card {
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Focus states for accessibility */
.user-profile-card:focus-within {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Comment Preselection Dropdown Styles */
.dropdown-menu {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #f8f9fa;
  color: #495057;
  transform: translateX(2px);
}

.dropdown-item:active {
  background-color: #e9ecef;
  color: #495057;
}

.dropdown-item i {
  margin-right: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
}

.dropdown-item small {
  margin-left: auto;
  color: #6c757d;
  font-size: 0.75rem;
}

/* Comment input field enhancements */
.form-control:focus + .dropdown-menu {
  display: block !important;
}

/* Mobile responsive dropdown adjustments */
@media (max-width: 768px) {
  .dropdown-menu {
    max-height: 150px;
    font-size: 0.8rem;
  }

  .dropdown-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .dropdown-item i {
    font-size: 0.8rem;
    width: 14px;
  }

  .dropdown-item small {
    font-size: 0.7rem;
  }
}

/* Ensure dropdown appears above other elements */
.dropdown-menu {
  z-index: 1050;
}

/* Smooth scrollbar for dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* DRAG AND DROP STYLES FOR SORTABLEJS */

/* Drag handle styling */
.drag-handle {
  cursor: move;
  color: #6c757d;
  transition: all 0.2s ease;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-handle:hover {
  color: #495057;
  background-color: rgba(0, 0, 0, 0.05);
}

.drag-handle:active {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

/* SortableJS ghost element (element being dragged) */
.sortable-ghost {
  opacity: 0.5;
  background: #f8f9fa !important;
  border: 2px dashed #0d6efd !important;
  transform: rotate(2deg);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3) !important;
}

/* SortableJS chosen element (element being picked up) */
.sortable-chosen {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  z-index: 1000;
  border-color: #0d6efd !important;
}

/* SortableJS drag element (element while dragging) */
.sortable-drag {
  opacity: 0.8;
  transform: rotate(5deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25) !important;
  z-index: 1001;
  border: 2px solid #0d6efd !important;
  background: #ffffff !important;
}

/* Container styling during drag operations */
#paymentTypesContainer.sortable-container {
  min-height: 200px;
  transition: all 0.3s ease;
}

/* Payment type folder specific drag styling */
.payment-type-folder.sortable-ghost {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border: 2px dashed #0d6efd !important;
  opacity: 0.6;
}

.payment-type-folder.sortable-chosen {
  transform: scale(1.02) rotate(1deg);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.2) !important;
}

.payment-type-folder.sortable-drag {
  transform: rotate(3deg);
  box-shadow: 0 12px 32px rgba(13, 110, 253, 0.3) !important;
  opacity: 0.9;
}

/* Drag handle specific to payment types */
.payment-type-folder .drag-handle {
  margin-right: 0.5rem;
  font-size: 1rem;
  width: 20px;
  height: 20px;
}

.payment-type-folder .drag-handle:hover {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

/* Smooth transitions for drag operations */
.payment-type-folder {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Disable text selection during drag */
.sortable-container * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Re-enable text selection for input fields */
.sortable-container input,
.sortable-container textarea,
.sortable-container select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Mobile drag and drop adjustments */
@media (max-width: 768px) {
  .drag-handle {
    font-size: 1.1rem;
    padding: 0.375rem;
    width: 24px;
    height: 24px;
  }

  .sortable-ghost {
    transform: rotate(1deg);
  }

  .sortable-chosen {
    transform: scale(1.01);
  }

  .sortable-drag {
    transform: rotate(2deg);
  }

  .payment-type-folder.sortable-ghost,
  .payment-type-folder.sortable-chosen,
  .payment-type-folder.sortable-drag {
    transform: none;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .drag-handle {
    padding: 0.5rem;
    font-size: 1.2rem;
  }

  .sortable-ghost {
    opacity: 0.7;
    transform: none;
  }

  .sortable-chosen {
    transform: scale(1.05);
  }

  .sortable-drag {
    transform: none;
    opacity: 0.9;
  }
}

/* END DRAG AND DROP STYLES */

/* Print Styles */
@media print {
  .settings-nav,
  .btn,
  .modal,
  .dropdown,
  .drag-handle {
    display: none !important;
  }

  .settings-section .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }

  .user-card {
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
  }

  .user-profile-card {
    box-shadow: none;
    border: 1px solid #dee2e6;
    background: white !important;
  }

  .role-badge {
    background: white !important;
    color: black !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
  }
}
