/* Main Styles */
:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --accent-color: #ec4899;
  --light-bg: #f8f9fa;
  --dark-bg: #121212;
  --dark-card: #1e1e1e;
  --text-light: #f8f9fa;
  --text-dark: #212529;
  --border-radius: 0.5rem;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.3s ease;
}

/* General styles - fix scrolling issue */
body {
  transition: var(--transition);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  /* Adjust bottom padding to prevent extra scroll */
  padding-bottom: 80px; 
  margin-bottom: 0; /* Remove this margin - it was causing double spacing */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  padding-top: 0; /* Adjust content padding to account for navbar */
}

html {
  position: relative;
  min-height: 100%;
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--text-light);
}

/* Fix for text in cards */
body.dark-mode .card-title,
body.dark-mode .card-text,
body.dark-mode .lead,
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
  color: var(--text-light);
}

/* Fix for user-welcome message in dark mode */
body.dark-mode .user-welcome .text-muted,
body.dark-mode .footer .text-muted {
  color: #adb5bd !important;
}

/* Fix for footer text in dark mode */
body.dark-mode .footer p:not(.text-muted) {
  color: var(--text-light);
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  height: 100%;
  min-height: 360px; /* Restored original height */
  display: flex;
  flex-direction: column;
}

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

body.dark-mode .card {
  background-color: var(--dark-card);
  border-color: #333;
}

[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Unified card image/icon container styling */
.card-img-top, 
.card-img-container,
.card .text-center.py-4 {
  height: 200px; /* Restored original height */
  object-fit: contain;
  padding: 20px; /* Restored original padding */
  background-color: var(--light-bg);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Images need special handling */
img.card-img-top {
  display: block;
  margin: 0 auto;
}

/* Dark mode consistency for ALL card icon/image containers */
body.dark-mode .card-img-top,
body.dark-mode .card-img-container,
body.dark-mode .card .text-center.py-4,
[data-bs-theme="dark"] .card-img-top,
[data-bs-theme="dark"] .card-img-container,
[data-bs-theme="dark"] .card .text-center.py-4 {
  background-color: #2a2a2a !important;
}

/* Fix for Bootstrap icons in dark mode - DO NOT override color */
.card-img-container .bi,
.card .text-center.py-4 .bi {
  font-size: 5rem;
  /* Allow inline color styling to take precedence */
}

/* Fix conflicting rules - allow inline colors to work */
body.dark-mode .card-img-container .bi,
[data-bs-theme="dark"] .card-img-container .bi {
  /* Remove !important to allow inline styles to work */
  color: inherit; /* This allows the inline style color to take effect */
}

/* Ensure Bootstrap icons have proper contrast in dark mode */
body.dark-mode .card-img-container .bi,
body.dark-mode .card .text-center.py-4 .bi,
[data-bs-theme="dark"] .card-img-container .bi,
[data-bs-theme="dark"] .card .text-center.py-4 .bi {
  color: inherit;
}

/* Let the icon's custom color take precedence */
.card-img-container .bi {
  font-size: 5rem;
  /* Use the inline style color instead of forcing a default */
}

/* Bootstrap icon sizing within containers */
.card-img-container .bi,
.card .text-center.py-4 .bi {
  font-size: 5rem;
}

body.dark-mode .card-img-top,
body.dark-mode .card .text-center.py-4 {
  background-color: #2a2a2a;
}

[data-bs-theme="dark"] .card-img-top,
[data-bs-theme="dark"] .card .text-center.py-4 {
  background-color: #343a40;
}

body.dark-mode .card-img-top {
  background-color: #2a2a2a;
}

[data-bs-theme="dark"] .card-img-top {
  background-color: #343a40;
}

/* Card image and icon containers */
.card-img-top, 
.card-img-container {
  height: 200px; /* Restored original height */
  object-fit: contain;
  padding: 20px; /* Restored original padding */
  background-color: var(--light-bg);
  transition: var(--transition);
}

.card-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark mode adjustments */
body.dark-mode .card-img-top,
body.dark-mode .card-img-container {
  background-color: #2a2a2a;
}

[data-bs-theme="dark"] .card-img-top,
[data-bs-theme="dark"] .card-img-container {
  background-color: #343a40;
}

/* Fix for card-img-container in dark mode */
body.dark-mode .card-img-container,
[data-bs-theme="dark"] .card-img-container {
  background-color: #2a2a2a !important;
}

/* Ensure Bootstrap icons have proper contrast in dark mode */
body.dark-mode .card-img-container .bi,
[data-bs-theme="dark"] .card-img-container .bi {
  color: inherit;
}

/* Force background color for Bootstrap icon containers */
.card-img-container {
  background-color: var(--light-bg);
}

body.dark-mode .card .text-center.py-4,
[data-bs-theme="dark"] .card .text-center.py-4 {
  background-color: #2a2a2a !important;
}

/* Bootstrap icon sizing within containers */
.card-img-container .bi {
  font-size: 5rem;
}

.section-heading {
  position: relative;
  margin-bottom: 2rem;
  font-weight: 700;
  padding-bottom: 10px;
}

.section-heading:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  height: 4px;
  width: 60px;
  background: var(--accent-color);
  border-radius: 2px;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: #007bff;
  border-radius: 3px;
}

[data-bs-theme="dark"] .section-heading::after {
  background-color: #0d6efd;
}

body.dark-mode .btn-outline-secondary {
  color: #e0e0e0;
  border-color: #666;
}

/* Search styles */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  flex-grow: 1; /* Allow it to take available space */
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

.search-input {
  padding-left: 35px;
  border-radius: 20px;
  height: 48px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

body.dark-mode .search-input {
  background-color: var(--dark-card);
  color: var(--text-light);
  border-color: #333;
}

body.dark-mode .search-input::placeholder {
  color: #aaa;
}

/* Theme toggle button */
.dark-mode .dark-icon {
  display: none;
}

.dark-mode .light-icon {
  display: inline-block !important;
}

/* Smooth transitions for search filtering */
.col-md-5 {
  transition: opacity 0.4s ease, transform 0.4s ease, height 0.4s ease;
  transform-origin: center top;
  height: auto;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.search-hidden {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

/* Staggered animation effect */
.col-md-5:nth-child(1) { transition-delay: 0ms; }
.col-md-5:nth-child(2) { transition-delay: 30ms; }
.col-md-5:nth-child(3) { transition-delay: 60ms; }
.col-md-5:nth-child(4) { transition-delay: 90ms; }
.col-md-5:nth-child(5) { transition-delay: 120ms; }
.col-md-5:nth-child(6) { transition-delay: 150ms; }

/* Ensure row maintains proper layout during transitions */
.row.search-active {
  min-height: 300px;
  position: relative;
  transition: min-height 0.5s ease;
}

/* Optional: Add a "no results" message */
.no-results-message {
  display: none;
  text-align: center;
  width: 100%;
  padding: 3rem;
  color: #6c757d;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--border-radius);
  margin-top: 1rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(20px);
  opacity: 0;
}

.no-results-message.visible {
  opacity: 1;
  transform: translateY(0);
}

body.dark-mode .no-results-message {
  color: #adb5bd;
  background-color: rgba(255, 255, 255, 0.05);
}

/* Improved footer styling with better fixed positioning */
.footer {
  transition: var(--transition);
  padding: 1rem 0; /* Reduced padding */
  font-size: 0.9rem;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 50px; /* Reduced min-height */
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  z-index: 1000;
}

/* Ensure dark mode is properly applied to footer */
[data-bs-theme="dark"] .footer {
  background-color: #212529 !important;
  border-top: 1px solid #424242;
  color: #f8f9fa;
}

/* Maintain backward compatibility with body.dark-mode */
body.dark-mode .footer {
  background-color: #212529 !important;
  border-top: 1px solid #424242;
  color: #f8f9fa;
}

/* Modern card styling */
.card-body {
  padding: 1.5rem; /* Restored original padding */
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative; /* Add this to allow button positioning */
  padding-bottom: 70px; /* Restored original padding */
}

.btn {
  transition: var(--transition);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Better page header - center alignment */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  text-align: center; /* Center align the header text */
}

body.dark-mode .page-header {
  border-bottom-color: rgba(255,255,255,0.1);
}

.display-4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.lead {
  font-weight: 400;
  font-size: 1.15rem;
}

/* User welcome message */
.user-welcome {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

#user-name {
  font-weight: 600;
  color: var(--primary-color);
}

body.dark-mode #user-name {
  color: #a5b4fc;
}

/* Theme toggle button improvements */
#theme-toggle {
  transition: var(--transition);
  border-radius: 9999px;
  padding: 0.4rem 0.8rem;
}

body.dark-mode #theme-toggle {
  border-color: #555;
}

/* Button group styling */
.gap-2 > * {
  margin: 0 0.25rem;
}

/* Make sure content doesn't hide behind footer on smaller screens */
@media (max-height: 700px) {
  body {
    margin-bottom: 120px;
  }
}

/* Main content container */
.container {
  flex: 1 0 auto;
  padding-bottom: 1rem; /* Add small padding at container bottom */
}

/* Fix for short content pages */
@media (min-height: 700px) {
  .container.content-container {
    min-height: calc(100vh - 160px); /* Adjust this value based on header + footer height */
  }
}

/* Dark mode styles for modals */
[data-bs-theme="dark"] .modal-content {
  background-color: #212529;
  color: #f8f9fa;
  border-color: #495057;
}

[data-bs-theme="dark"] .modal-header {
  border-bottom-color: #343a40;
}

[data-bs-theme="dark"] .modal-footer {
  border-top-color: #343a40;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2b3035;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2b3035;
  color: #f8f9fa;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

[data-bs-theme="dark"] .form-text {
  color: #adb5bd;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6c757d;
}

[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modal transition animation */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
}

.modal.fade .modal-content {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Better form styling for both themes */
.form-label {
  font-weight: 500;
}

/* Custom styling for details summary element */
details summary {
  cursor: pointer;
  color: #0d6efd;
  padding: 5px 0;
}

[data-bs-theme="dark"] details summary {
  color: #6ea8fe;
}

details summary:hover {
  text-decoration: underline;
}

/* Icon previews in the form */
.icon-preview {
  font-size: 1.5rem;
  margin-left: 10px;
  vertical-align: middle;
}

/* Save/Delete button styling improvements */
#save-card-btn,
#save-section-btn {
  min-width: 80px;
}

/* Responsive adjustments for modal */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem;
  }
}

/* Hover-reveal buttons for sections and cards */
.section-header {
  position: relative;
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  display: flex;
  justify-content: center; /* Center the content */
  align-items: center;
}

.section-controls {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-header:hover .section-controls {
  opacity: 1;
}

/* Center cards within sections */
.row {
  justify-content: center; /* Center cards in row */
}

/* Make all section headers centered */
h2 {
  text-align: center;
  width: 100%;
}

/* Card edit button hover effects */
.card {
  position: relative;
  min-height: 360px; /* Restored original height for mobile */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.edit-card-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease;
  transform: scale(0.9);
  z-index: 2;
  /* Light mode styling (default) */
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode styling for edit button */
[data-bs-theme="dark"] .edit-card-btn {
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Handle legacy body.dark-mode class */
body.dark-mode .edit-card-btn {
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover .edit-card-btn {
  opacity: 1;
  transform: scale(1);
}

/* Add card button (at section level) */
.add-card-btn {
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.section-header:hover .add-card-btn {
  opacity: 1;
  transform: scale(1.05);
}

/* When edit buttons are in a fixed position (like card bottom) */
.card-footer .edit-card-btn {
  position: static;
  opacity: 0.7;
}

.card:hover .card-footer .edit-card-btn {
  opacity: 1;
}

/* Error modal styling */
#errorModal .modal-header {
  border-bottom: none;
}

#errorModal .modal-body {
  padding: 1.5rem;
}

#errorModal .bi-exclamation-triangle-fill {
  flex-shrink: 0;
}

/* Dark mode styling for error modal */
[data-bs-theme="dark"] #errorModal .modal-header {
  background-color: #dc3545 !important;
}

[data-bs-theme="dark"] #errorModal .modal-content {
  background-color: #212529;
  color: #f8f9fa;
}

[data-bs-theme="dark"] #errorModal .text-danger {
  color: #ff6b6b !important;
}

/* Handle legacy body.dark-mode class */
body.dark-mode #errorModal .modal-header {
  background-color: #dc3545 !important;
}

body.dark-mode #errorModal .modal-content {
  background-color: #212529;
  color: #f8f9fa;
}

body.dark-mode #errorModal .text-danger {
  color: #ff6b6b !important;
}

/* Delete Confirmation Modal styling */
#deleteConfirmModal .modal-header {
  border-bottom: none;
}

#deleteConfirmModal .modal-body {
  padding: 1.5rem;
}

#deleteConfirmModal .bi-exclamation-triangle-fill {
  flex-shrink: 0;
}

#confirm-delete-btn {
  transition: background-color 0.2s;
}

#confirm-delete-btn:hover {
  background-color: #b02a37;
}

/* Dark mode styling for delete confirmation modal */
[data-bs-theme="dark"] #deleteConfirmModal .modal-header {
  background-color: #dc3545 !important;
}

[data-bs-theme="dark"] #deleteConfirmModal .modal-content {
  background-color: #212529;
  color: #f8f9fa;
}

[data-bs-theme="dark"] #deleteConfirmModal .text-danger {
  color: #ff6b6b !important;
}

[data-bs-theme="dark"] #deleteConfirmModal .alert-warning {
  background-color: #332701;
  color: #ffda6a;
  border-color: #664d03;
}

/* Handle legacy body.dark-mode class */
body.dark-mode #deleteConfirmModal .modal-header {
  background-color: #dc3545 !important;
}

body.dark-mode #deleteConfirmModal .modal-content {
  background-color: #212529;
  color: #f8f9fa;
}

body.dark-mode #deleteConfirmModal .text-danger {
  color: #ff6b6b !important;
}

body.dark-mode #deleteConfirmModal .alert-warning {
  background-color: #332701;
  color: #ffda6a;
  border-color: #664d03;
}

/* Clickable card styling */
.clickable-card {
  cursor: pointer;
  position: relative;
}

.clickable-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Ensure buttons and links inside the card remain clickable */
.clickable-card .card-actions,
.clickable-card .card-btn {
  position: relative;
  z-index: 2;
}

/* Add subtle highlight effect when clicking the card */
.clickable-card:active {
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateY(-2px);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

body.dark-mode .clickable-card:active {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Optional - Add subtle indication that the card is clickable */
.clickable-card::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(0, 0, 0, 0.2);
  border-right: 2px solid rgba(0, 0, 0, 0.2);
  transform: rotate(45deg);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.clickable-card:hover::after {
  opacity: 0.8;
}

body.dark-mode .clickable-card::after {
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  border-right: 2px solid rgba(255, 255, 255, 0.2);
}

/* Navbar Styles */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: var(--transition);
}

body.dark-mode .navbar,
[data-bs-theme="dark"] .navbar {
  background-color: var(--dark-card) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.dark-mode .navbar-brand,
body.dark-mode .nav-link,
[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .nav-link {
  color: var(--text-light);
}

body.dark-mode .navbar-toggler,
[data-bs-theme="dark"] .navbar-toggler {
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .navbar-toggler-icon,
[data-bs-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

.nav-link.active {
  font-weight: 600;
  color: var(--primary-color) !important;
  border-bottom: 2px solid var(--primary-color);
}

body.dark-mode .nav-link.active,
[data-bs-theme="dark"] .nav-link.active {
  color: var(--primary-color) !important;
}

.navbar-brand img {
  transition: var(--transition);
}

body.dark-mode .navbar-brand img,
[data-bs-theme="dark"] .navbar-brand img {
  filter: brightness(1.8);
}

.dropdown-menu {
  transition: var(--transition);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

body.dark-mode .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--dark-card);
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .dropdown-item,
[data-bs-theme="dark"] .dropdown-item {
  color: var(--text-light);
}

body.dark-mode .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: rgba(255,255,255,0.05);
}

/* User avatar styling */
.avatar-circle {
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

body.dark-mode .avatar-circle {
  background-color: var(--primary-hover);
}

/* Improved navbar styling */
.navbar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar-brand {
  font-size: 1.25rem;
}

.nav-link {
  position: relative;
  padding-bottom: 0.5rem !important;
  margin-bottom: -1px;
  font-weight: 500;
}

.nav-link.active {
  font-weight: 600;
  color: var(--primary-color) !important;
  border-bottom: 3px solid var(--primary-color);
}

/* Improved card styling */
.card {
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

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

.card-title {
  font-weight: 600;
  font-size: inherit; /* Reset to default */
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: inherit; /* Reset to default */
  margin-bottom: inherit; /* Reset to default */
  line-height: inherit; /* Reset to default */
}

/* Improved button styling */
.btn {
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0.5rem 1.25rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(25, 135, 84, 0.2);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Enhanced page header styling */
.page-header {
  position: relative;
  padding-bottom: 2rem;
  margin-bottom: 3rem;
}

.page-header::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: 2px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Improved search input styling */
.search-input {
  height: 50px;
  border-radius: 25px;
  padding-left: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.1);
}

.search-input:focus {
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.15);
  border-color: var(--primary-color);
}

.search-icon {
  left: 20px;
  font-size: 1.1rem;
  color: #aaa;
}

body.dark-mode .search-input {
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .search-input:focus {
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.25);
}

/* Mini search for tables and cards */
.search-mini-container {
  position: relative;
  max-width: 250px;
}

.search-mini-input {
  height: 38px;
  padding-left: 35px;
  border-radius: 19px;
  font-size: 0.9rem;
}

.search-mini-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 0.9rem;
}

/* Table styling improvements */
.table {
  font-size: 0.95rem;
}

.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table tbody td {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

body.dark-mode .table-hover tbody tr:hover {
  background-color: rgba(255,255,255,0.05);
}

/* Badge and status indicators */
.badge {
  font-weight: 500;
  padding: 0.4em 0.7em;
  border-radius: 0.25rem;
}

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

.badge.badge-user {
  background-color: #6c757d;
  color: white;
}

.badge.badge-active {
  background-color: #198754;
  color: white;
}

.badge.badge-inactive {
  background-color: #dc3545;
  color: white;
}

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

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Improve section styling */
.section-heading {
  color: var(--primary-color);
  position: relative;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.2rem;
  font-weight: 700;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: 2px;
}

/* Responsive adjustments for search and button layout */
@media (max-width: 768px) {
  .d-flex.justify-content-center.align-items-center.gap-3 {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .search-container {
    width: 100%;
    max-width: none;
    margin-bottom: 0.5rem;
  }
}

/* Fix navbar item vertical alignment */
.navbar-nav .nav-item {
  display: flex;
  align-items: center;
}

/* Theme toggle button alignment with user dropdown */
.navbar .theme-toggle-container {
  display: flex;
  align-items: center;
  height: 100%;
}

#theme-toggle {
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  transition: var(--transition);
  height: 38px; /* Match the height with dropdown trigger */
  display: flex;
  align-items: center;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  height: 38px; /* Standardize the height */
}

.navbar-nav .nav-item.dropdown {
  display: flex;
  align-items: center;
}

/* Ensure avatar and text align properly */
.avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
  /* Reduce padding on mobile */
  body {
    padding-bottom: 60px;
  }
  
  /* Make cards fill width on mobile */
  .col-md-5, .col-md-4, .col-lg-4 {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Adjust navbar spacing */
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-brand img {
    width: 30px;
    height: 30px;
  }
  
  /* Improve search container on mobile */
  .search-container {
    max-width: 100%;
    width: 100%;
  }
  
  /* More compact search bar on mobile */
  .search-input {
    height: 42px;
    font-size: 0.95rem;
    padding-left: 40px;
  }
  
  .search-icon {
    left: 15px;
  }
  
  /* Adjust section headings and page headers */
  .page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .lead {
    font-size: 1rem;
  }
  
  .section-heading {
    font-size: 1.5rem;
  }
  
  /* Improve modal display on mobile */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  /* Section controls positioning */
  .section-header {
    flex-direction: column;
  }
  
  .section-controls {
    position: static;
    transform: none;
    opacity: 1;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
  }
  
  /* Adjust cards for better mobile display */
  .card {
    margin-bottom: 1rem;
    min-height: 360px; /* Restored original height for mobile */
  }
  
  .card-img-top, 
  .card-img-container,
  .card .text-center.py-4 {
    height: 160px; /* Original mobile height */
  }
  
  /* Show edit buttons on mobile without hover */
  .edit-card-btn {
    opacity: 0.7;
    transform: scale(1);
  }
  
  /* Always show footer on mobile */
  .footer {
    position: fixed;
    padding: 0.5rem 0;
    font-size: 0.8rem;
  }
}

/* Extra small devices - improve touch targets */
@media (max-width: 575.98px) {
  /* Increase button sizes for better touch targets */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  
  /* Better spacing for form elements on mobile */
  .form-label {
    margin-bottom: 0.25rem;
  }
  
  .form-control {
    font-size: 16px; /* Prevent auto zoom on iOS */
    height: 42px;
  }
  
  /* Make section and card headers more compact */
  .card-header, .section-header {
    padding: 0.75rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Navbar improvements for smallest screens */
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Theme toggle button more compact */
  #theme-toggle {
    padding: 0.3rem 0.6rem;
    height: 34px;
  }
  
  #theme-toggle .mode-text {
    display: none; /* Hide text, show only icon on very small screens */
  }
  
  /* Improve dropdown readability */
  .dropdown-menu {
    min-width: 200px;
  }
  
  .dropdown-item {
    padding: 0.5rem 1rem;
  }
  
  /* Stack buttons in modals */
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin-left: 0 !important;
  }
  
  /* Adjust search placeholder for smaller screens */
  .search-input::placeholder {
    font-size: 0.9rem;
  }
  
  /* Fix spacing in page header with search */
  .d-flex.flex-column.align-items-center.mt-4 {
    margin-top: 1rem !important;
  }
  
  .mb-3.w-100 {
    margin-bottom: 0.5rem !important;
  }
}

/* Tablet-specific adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Adjust card layout for tablets */
  .col-md-5, .col-md-4, .col-lg-4 {
    width: 50%;
  }
  
  /* Improve card spacing */
  .card {
    margin-bottom: 1.25rem;
  }
  
  /* Adjust section padding */
  .section-header {
    padding: 0 1rem;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  /* Compact navbar in landscape */
  .navbar {
    padding: 0.35rem 0;
  }
  
  /* Adjust card height in landscape */
  .card-img-top, 
  .card-img-container,
  .card .text-center.py-4 {
    height: 120px;
  }
  
  /* More compact body padding */
  body {
    padding-bottom: 40px;
  }
  
  /* Shorter footer */
  .footer {
    min-height: 40px;
    padding: 0.35rem 0;
  }
  
  /* Reduce spacing in modals */
  .modal-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

/* Mobile navbar improvements */
@media (max-width: 991.98px) {
  /* Better spacing for collapsed navbar */
  .navbar-collapse {
    padding: 1rem 0;
  }
  
  /* Separate nav items */
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
  }
  
  /* Better styling for active items */
  .nav-link.active {
    border-left: 3px solid var(--primary-color);
    border-bottom: none;
    padding-left: 0.5rem;
  }
  
  /* User dropdown and theme toggle */
  .navbar-nav .ms-auto {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
  }
  
  body.dark-mode .navbar-nav .ms-auto,
  [data-bs-theme="dark"] .navbar-nav .ms-auto {
    border-top-color: rgba(255,255,255,0.1);
  }
  
  /* Stack theme toggle and user dropdown on mobile */
  .navbar-nav .theme-toggle-container,
  .navbar-nav .dropdown {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .theme-toggle-container #theme-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* Fix navbar item vertical alignment */
.navbar-nav .nav-item {
  display: flex;
  align-items: center;
}

/* Theme toggle button alignment with user dropdown */
.navbar .theme-toggle-container {
  display: flex;
  align-items: center;
  height: 100%;
}

#theme-toggle {
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  transition: var(--transition);
  height: 38px; /* Match the height with dropdown trigger */
  display: flex;
  align-items: center;
}

/* Responsive dynamic card grid layout */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 -0.75rem;
}

/* Replace the fixed column width with a more flexible approach */
.col-md-5, .col-lg-4, .col-md-4 {
  width: 100%;
  max-width: 100%;
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Responsive grid - cards per row based on screen size */
@media (min-width: 576px) {
  .col-md-5, .col-lg-4, .col-md-4 {
    width: calc(100% - 1.5rem);
    max-width: 450px;
  }
}

@media (min-width: 768px) {
  .col-md-5, .col-lg-4, .col-md-4 {
    width: calc(50% - 1.5rem);
  }
}

@media (min-width: 992px) {
  .col-md-5, .col-lg-4, .col-md-4 {
    width: calc(33.333% - 1.5rem);
  }
}

@media (min-width: 1200px) {
  .col-md-5, .col-lg-4, .col-md-4 {
    width: calc(25% - 1.5rem);
  }
}

@media (min-width: 1400px) {
  .col-md-5, .col-lg-4, .col-md-4 {
    width: calc(20% - 1.5rem);
  }
}

/* Card-wrapper styling for consistent behavior */
.card-wrapper {
  width: 100%;
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.4s ease, transform 0.4s ease, height 0.4s ease;
  transform-origin: center top;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Apply the same responsive rules to card-wrapper */
@media (min-width: 576px) {
  .card-wrapper {
    width: calc(100% - 1.5rem);
    max-width: 450px;
  }
}

@media (min-width: 768px) {
  .card-wrapper {
    width: calc(50% - 1.5rem);
  }
}

@media (min-width: 992px) {
  .card-wrapper {
    width: calc(33.333% - 1.5rem);
  }
}

@media (min-width: 1200px) {
  .card-wrapper {
    width: calc(25% - 1.5rem);
  }
}

@media (min-width: 1400px) {
  .card-wrapper {
    width: calc(20% - 1.5rem);
  }
}

/* Animation delays for card-wrapper */
.card-wrapper:nth-child(1) { transition-delay: 0ms; }
.card-wrapper:nth-child(2) { transition-delay: 30ms; }
.card-wrapper:nth-child(3) { transition-delay: 60ms; }
.card-wrapper:nth-child(4) { transition-delay: 90ms; }
.card-wrapper:nth-child(5) { transition-delay: 120ms; }
.card-wrapper:nth-child(6) { transition-delay: 150ms; }

/* Apply search hiding to card-wrapper */
.card-wrapper.search-hidden {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

/* Maintain the search transition behavior */
.search-hidden {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

/* Improved Card Actions - similar to section controls */
.card-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  /* Remove top: 50% and right: 20px that were causing misalignment */
}

.card:hover .card-actions {
  opacity: 1;
}

/* Style for edit and delete buttons on cards */
.card-actions .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
}

/* Redesigned Card Actions - positioned at the card bottom */
.card-actions {
  position: absolute;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease;
  transform: scale(0.9);
  z-index: 10;
}

.card:hover .card-actions {
  opacity: 1;
  transform: scale(1);
}

/* Move the "open" button to allow space for action buttons */
.card-body .btn-primary {
  padding-right: 80px; /* Make space for the action buttons */
}

/* Style for edit and delete buttons on cards */
.card-actions .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-card-btn {
  color: #0d6efd !important;
}

.delete-card-btn {
  color: #dc3545 !important;
}

/* Transition when hovering buttons */
.card-actions .btn:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Dark mode styling for card action buttons */
[data-bs-theme="dark"] .card-actions .btn,
body.dark-mode .card-actions .btn {
  background-color: rgba(33, 37, 41, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .edit-card-btn,
body.dark-mode .edit-card-btn {
  color: #6ea8fe !important;
}

[data-bs-theme="dark"] .delete-card-btn,
body.dark-mode .delete-card-btn {
  color: #ff6b6b !important;
}

/* Clean up the duplicate styling for edit-card-btn since we now have card-actions */
.edit-card-btn {
  position: relative;
  top: auto;
  right: auto;
  opacity: 1;
  transform: none;
  z-index: auto;
  background-color: transparent;
  box-shadow: none;
  border: none;
}

/* Responsive dynamic card grid layout - fix compressed cards */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 -0.75rem;
}

/* Fix for compressed cards - ensure proper sizing and spacing */
.col-md-5, .col-lg-4, .col-md-4, .card-wrapper {
  width: 340px;  /* Set a fixed width that works well */
  max-width: 100%;
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Add minimum height to cards to prevent squishing */
.card {
  min-height: 360px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Ensure card body takes available space */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative; /* Add this to allow button positioning */
  padding-bottom: 70px; /* Add space for the action buttons at bottom */
}

/* Push the button to the bottom of the card */
.card-body .btn {
  margin-top: auto;
}

/* Responsive adjustments - simplified to work better */
@media (max-width: 767.98px) {
  .col-md-5, .col-lg-4, .col-md-4, .card-wrapper {
    width: 100%;
  }
  
  .card {
    min-height: 360px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .col-md-5, .col-lg-4, .col-md-4, .card-wrapper {
    width: 320px;
  }
}

@media (min-width: 992px) {
  .cards-container {
    gap: 2rem;
  }
}

/* List view styling */
.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  min-height: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transform: none !important;
}

.list-view .card:hover {
  transform: none !important;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.list-view .card-img-top, 
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 50px;
  height: 50px;
  min-width: 50px;
  padding: 8px;
  margin-right: 1rem;
}

.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 1.75rem;
}

/* Adjust card body layout for list view */
.list-view .card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  text-align: left;
  flex: 1;
  padding-bottom: 0; /* Remove padding causing misalignment */
}

/* Card content container for title/description */
.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 90px);
}

/* Title styling */
.list-view .card-title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Description styling */
.list-view .card-text {
  margin-bottom: 0;
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6c757d;
}

/* Hide the original button in list view */
.list-view .btn-primary {
  display: none;
}

/* Burger menu styling */
.list-view .list-menu-toggle {
  display: flex;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: background-color 0.2s;
}

.list-view .list-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .list-view .list-menu-toggle:hover,
body.dark-mode .list-view .list-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Reset card actions for list view */
.list-view .card-actions {
  position: static;
  opacity: 1;
  transform: none;
  margin-left: auto;
  display: flex;
}

/* Dropdown menu styling */
.list-dropdown-menu {
  min-width: 180px;
}

.list-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
}

.list-dropdown-menu .dropdown-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Mobile responsive adjustments for list view */
@media (max-width: 767.98px) {
  .list-view .card-text {
    max-width: 200px;
    -webkit-line-clamp: 1;
  }
  
  .list-view .card-content {
    max-width: calc(100% - 90px);
  }
  
  .list-view .card-img-top, 
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 0.75rem;
  }
}

/* View toggle button styles */
.view-toggle-container {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.view-toggle-container .btn-group {
  margin-left: auto;
}

.view-toggle-btn {
  padding: 0.4rem 0.75rem;
  transition: all 0.2s;
}

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

/* Dropdown menu for list view */
.list-dropdown-menu {
  min-width: 180px;
}

.list-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
}

.list-dropdown-menu .dropdown-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Mobile responsive adjustments for list view */
@media (max-width: 767.98px) {
  .list-view .card-text {
    display: none;
  }
  
  .list-view .card-content {
    max-width: calc(100% - 100px);
  }
  
  .list-view .card-img-top, 
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 0.75rem;
  }
}

/* Improved List view styling - better layout and usability */
.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  min-height: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transform: none !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
}

.list-view .card:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 0, 0, 0.01);
}

/* Icon container styling */
.list-view .card-img-top, 
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 6px;
  margin-right: 1rem;
  border-radius: 8px;
  background-color: var(--light-bg);
}

.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 1.5rem;
}

/* Card body layout in list view */
.list-view .card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  text-align: left;
  flex: 1;
}

/* Card content container for title/description */
.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 80px);
  padding-right: 1rem;
}

/* Title styling */
.list-view .card-title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

/* Description styling */
.list-view .card-text {
  margin-bottom: 0;
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.7;
}

/* Hide the original button in list view */
.list-view .btn-primary {
  display: none;
}

/* Improved burger menu styling */
.list-view .list-menu-toggle {
  display: flex;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  border: 1px solid transparent;
  margin-left: auto;
}

.list-view .list-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .list-view .list-menu-toggle:hover,
body.dark-mode .list-view .list-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Dark mode fixes for list view */
[data-bs-theme="dark"] .list-view .card:hover,
body.dark-mode .list-view .card:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .list-view .card-title,
body.dark-mode .list-view .card-title {
  color: var(--text-light);
}

[data-bs-theme="dark"] .list-view .card-text,
body.dark-mode .list-view .card-text {
  opacity: 0.8;
}

/* Reset card actions for list view */
.list-view .card-actions {
  position: static;
  opacity: 1;
  transform: none;
  margin-left: auto;
  display: flex;
}

/* Dropdown menu styling */
.list-dropdown-menu {
  min-width: 180px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.list-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  transition: background-color 0.15s ease;
}

.list-dropdown-menu .dropdown-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Dark mode dropdown styling */
[data-bs-theme="dark"] .list-dropdown-menu,
body.dark-mode .list-dropdown-menu {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive: make items smaller on mobile */
@media (max-width: 767.98px) {
  .list-view .card {
    padding: 0.5rem;
  }
  
  .list-view .card-text {
    display: none;
  }
  
  .list-view .card-content {
    max-width: calc(100% - 50px);
  }
  
  .list-view .card-img-top, 
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: 0.75rem;
  }
  
  .list-view .card-title {
    font-size: 0.95rem;
    margin-bottom: 0;
  }
}

/* Enhanced List View - Refined Design */
.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  min-height: auto;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  transform: none !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
}

.list-view .card:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 0, 0, 0.015);
}

/* Icon styling - more compact but visually distinct */
.list-view .card-img-top, 
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 45px;
  height: 45px;
  min-width: 45px;
  padding: 0;
  margin-right: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* Resize Bootstrap icons for list view */
.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 1.5rem;
}

/* Properly size image icons */
.list-view img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

/* Card body layout */
.list-view .card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  text-align: left;
  flex: 1;
}

/* Main content area */
.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 1rem;
}

/* Title styling */
.list-view .card-title {
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

/* Description styling */
.list-view .card-text {
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6c757d;
  max-width: 100%;
}

/* Hide original button in list view */
.list-view .btn-primary {
  display: none;
}

/* Actions area */
.list-view .card-actions-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

/* Primary action button */
.list-view .list-primary-action {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Menu toggle button */
.list-view .list-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 4px;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.list-view .list-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.list-view .list-menu-toggle i {
  font-size: 1rem;
  color: #6c757d;
}

/* Dropdown menu styling */
.list-dropdown-menu {
  min-width: 180px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 0.4rem 0;
  margin-top: 0.4rem;
}

.list-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.list-dropdown-menu .dropdown-item i {
  margin-right: 0.75rem;
  font-size: 0.9rem;
  width: 16px;
  text-align: center;
}

.list-dropdown-menu .dropdown-divider {
  margin: 0.25rem 0;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .list-view .card:hover,
body.dark-mode .list-view .card:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .list-view .card-title,
body.dark-mode .list-view .card-title {
  color: var(--text-light);
}

[data-bs-theme="dark"] .list-view .list-menu-toggle,
body.dark-mode .list-view .list-menu-toggle {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .list-view .list-menu-toggle i,
body.dark-mode .list-view .list-menu-toggle i {
  color: #adb5bd;
}

[data-bs-theme="dark"] .list-view .list-menu-toggle:hover,
body.dark-mode .list-view .list-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .list-view .card {
    padding: 0.7rem;
  }
  
  .list-view .card-img-top,
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 38px;
    height: 38px;
    min-width: 38px;
    margin-right: 0.7rem;
  }
  
  .list-view .card-title {
    font-size: 0.9rem;
  }
  
  .list-view .card-text {
    display: none;
  }
  
  .list-view .list-primary-action span {
    display: none;
  }
  
  .list-view .list-primary-action {
    padding: 0.3rem;
    width: 30px;
    height: 30px;
    justify-content: center;
  }
  
  .list-view .list-primary-action i {
    margin-right: 0;
  }
}

/* Adjust list-view horizontal spacing for larger screens */
@media (min-width: 992px) {
  .list-view .card {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .list-view .card-content {
    max-width: calc(100% - 200px);
  }
  
  .list-view .card-text {
    -webkit-line-clamp: 2;
  }
}

/* Refined List View - Better Layout without Compression */
.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 70px;
  height: auto;
  padding: 12px 16px;
  margin-bottom: 10px;
  transform: none !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.list-view .card:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 0, 0, 0.015);
}

/* More spacious icon container */
.list-view .card-img-top, 
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 50px;
  height: 50px;
  min-width: 50px;
  padding: 0;
  margin-right: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Appropriately sized Bootstrap icons */
.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 2rem; /* Larger icon for better visibility */
}

/* Image handling in list view */
.list-view img.card-img-top {
  object-fit: contain;
  padding: 6px;
  width: 100%;
  height: 100%;
}

/* Card body with better spacing */
.list-view .card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  flex: 1;
  min-width: 0; /* Fix for overflow in flexbox */
}

/* Content area with proper text overflow handling */
.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-right: 16px;
  min-width: 0; /* Important for text truncation */
}

/* Title styling */
.list-view .card-title {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Description styling */
.list-view .card-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #6c757d;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions container */
.list-view .card-actions-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Primary action button - more visible */
.list-view .list-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}

.list-view .list-primary-action i {
  font-size: 0.9rem;
  margin-right: 6px;
}

/* Menu toggle styling */
.list-view .list-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  padding: 0;
}

.list-view .list-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
}

.list-view .list-menu-toggle i {
  font-size: 1.1rem;
  color: #6c757d;
}

/* Consistent list layout - prevent section compression */
.list-view-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
}

.list-view .row {
  margin-left: 0;
  margin-right: 0;
}

.list-view .col-md-5, 
.list-view .col-lg-4, 
.list-view .col-md-4, 
.list-view .card-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0 0.25rem;
  margin-bottom: 10px;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .list-view .card,
body.dark-mode .list-view .card {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .list-view .card:hover,
body.dark-mode .list-view .card:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .list-view .card-title,
body.dark-mode .list-view .card-title {
  color: var(--text-light);
}

/* Responsive adjustments - maintain clean layout on small screens */
@media (max-width: 767.98px) {
  .list-view .card {
    padding: 10px 12px;
  }
  
  .list-view .card-img-top,
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin-right: 12px;
  }
  
  .list-view .card-img-container .bi,
  .list-view .card .text-center.py-4 .bi {
    font-size: 1.6rem;
  }
  
  .list-view .card-content {
    margin-right: 12px;
  }
  
  .list-view .list-primary-action {
    padding: 5px 8px;
  }
  
  .list-view .list-primary-action span {
    display: none;
  }
  
  .list-view .list-primary-action i {
    margin-right: 0;
  }
}

/* Refined List View - Improved Icon/Image Handling */
.list-view .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 70px;
  height: auto;
  padding: 12px 16px;
  margin-bottom: 10px;
  transform: none !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Icon/Image container with fixed dimensions */
.list-view .card-img-top, 
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  padding: 0;
  margin-right: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

/* Properly size Bootstrap icons */
.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 1.5rem !important; /* Reduced size with !important to override */
  transform: none !important;
  transition: none !important;
}

/* Fixed image sizing for list view */
.list-view img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  /* Remove any animation/transition that might interfere */
  transform: none !important;
  transition: none !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* Ensure icon/image doesn't rotate or transform on hover */
.list-view .card:hover .card-img-top,
.list-view .card:hover .card-img-container,
.list-view .card:hover .card .text-center.py-4,
.list-view .card:hover img.card-img-top,
.list-view .card:hover .bi {
  transform: none !important;
}

/* Dark mode background for icon container */
[data-bs-theme="dark"] .list-view .card-img-top,
[data-bs-theme="dark"] .list-view .card-img-container,
[data-bs-theme="dark"] .list-view .card .text-center.py-4,
body.dark-mode .list-view .card-img-top,
body.dark-mode .list-view .card-img-container,
body.dark-mode .list-view .card .text-center.py-4 {
  background-color: #2a2a2a !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .list-view .card-img-top, 
  .list-view .card-img-container,
  .list-view .card .text-center.py-4 {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    margin-right: 12px;
  }
  
  .list-view .card-img-container .bi,
  .list-view .card .text-center.py-4 .bi {
    font-size: 1.3rem !important; /* Even smaller on mobile */
  }
}

/* Fixed List View Cards - Proper Image Handling */
.list-view .card-img-container {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  padding: 0;
  margin-right: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

/* Image handling in list view */
.list-view .card-img-container img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  /* Remove any animation/transition that might interfere */
  transform: none !important;
  transition: none !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* Properly size Bootstrap icons in list view */
.list-view .card-img-container .bi {
  font-size: 1.5rem !important;
  transform: none !important;
  transition: none !important;
}

/* Ensure consistent image handling in grid view */
.card-img-container {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-bg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card-img-container img.card-img-top {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 20px;
  display: block;
  margin: 0 auto;
}

/* Ensure icon/image doesn't rotate or transform on hover */
.list-view .card:hover .card-img-container img.card-img-top,
.list-view .card:hover .card-img-container .bi {
  transform: none !important;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .card-img-container,
body.dark-mode .card-img-container {
  background-color: #2a2a2a !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .list-view .card-img-container {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    margin-right: 12px;
  }
  
  .list-view .card-img-container .bi {
    font-size: 1.3rem !important;
  }
}

/* Fix for images in list view */
.list-view .card-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Properly handle images in list view */
.list-view .card-img-container img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center; /* Change from left to center */
  padding: 6px;
  position: static; /* Reset any absolute positioning that might cause misalignment */
  margin: 0;
  transform: none !important;
  transition: none !important;
  max-height: 100%;
  max-width: 100%;
}

/* Ensure consistent sizing for both icons and images */
.list-view .card-img-container,
.list-view .card .text-center.py-4 {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  padding: 0;
  margin-right: 16px;
  border-radius: 8px;
  background-color: var(--light-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Override any conflicting rules that might affect image display */
.list-view img.card-img-top {
  display: block !important;
  transition: none !important;
  transform: none !important;
}

/* Fix for image containers in mobile view */
@media (max-width: 767.98px) {
  .list-view .card-img-container img.card-img-top {
    padding: 4px;
  }
}

/* Side-by-side sections layout - only in grid view */
.sections-row {
  display: block;
}

.section-container {
  width: 100%;
  margin-bottom: 2rem;
}

/* Adjustments to ensure cards layout properly in side-by-side sections */
.section-container .cards-container {
  display: block;
  margin: 0 -0.75rem;
}

/* Create a responsive grid within each section container */
.section-container .cards-container {
  display: block;
  margin: 0 -0.75rem;
}

/* Adjust card wrapper style to work better in grid layout */
.section-container .card-wrapper {
  padding: 0;
  margin-bottom: 1rem;
}

/* Empty section message should take full width */
.section-container .cards-container .col-12 {
  grid-column: 1 / -1;
}

/* Fix alignment for images in list view */
.list-view .card-img-container {
  display: flex;
  align-items: center;
  justify-content: center; /* Center all elements in the container */
  overflow: hidden;
  /* Fix dimensions to match icons */
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  margin-right: 16px;
  border-radius: 8px;
  padding: 0;
}

/* Ensure Bootstrap icons in list view are properly centered */
.list-view .card-img-container .bi,
.list-view .card .text-center.py-4 .bi {
  font-size: 1.75rem !important;
  display: block;
  margin: 0 auto;
  transform: none !important;
  transition: none !important;
}

/* Properly handle images in list view */
.list-view .card-img-container img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center; /* Center the image */
  padding: 6px;
  position: static;
  margin: 0;
  transform: none !important;
  transition: none !important;
  max-height: 100%;
  max-width: 100%;
}

/* Remove any previous overrides that were forcing left alignment */
.list-view .card-img-container {
  /* Remove justify-content: flex-start; */
}

.list-view .card-img-container img.card-img-top {
  /* Remove object-position: left; */
}

/* Adjust Bootstrap icons in list view to match image behavior */
.list-view .card .text-center.py-4 {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive adjustments for mobile */
@media (max-width: 767.98px) {
  .list-view .card-img-container {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    margin-right: 12px;
  }
  
  .list-view .card-img-container .bi,
  .list-view .card .text-center.py-4 .bi {
    font-size: 1.5rem !important; /* Smaller on mobile */
  }
  
  .list-view .card-img-container img.card-img-top {
    padding: 4px;
  }
}
