body {
  height: 100vh;
  overflow: hidden;
}
html, body {
  height: 100%;
  overflow: hidden;
}

#appContent {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

#sidebar {
  width: 250px;

  width: 250px; /* Fixed width for the sidebar */
  min-width: 250px; /* Prevent shrinking */
  max-width: 250px; /* Prevent expanding */
  transition: width 0.3s;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100vh; /* Ensure the sidebar takes full height */
  background-color: #f8f9fa; /* Light background for the sidebar */
  border-right: 1px solid #dee2e6; /* Border to separate from main content */
}

#sidebar.collapsed {
  width: 60px; /* Fixed width when collapsed */
  min-width: 60px;
  max-width: 60px;
}

/* Hiển thị hoặc ẩn span và section-title khi thu gọn */
#sidebar .nav-link span,
.section-title {
  display: inline;
}
#sidebar .nav-link span {
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden; /* Hide overflowing text */
  text-overflow: ellipsis; /* Add ellipsis for long text */
  display: inline-block;
  max-width: 180px; /* Adjust based on your design */
}

#sidebar.collapsed .nav-link span,
#sidebar.collapsed .section-title {
  display: none !important;
}

#sidebar .section-title {
  display: inline;
}


/* Nav link style */
#sidebar .nav-link {
  border-radius: 0.5rem;
  margin-bottom: 5px;
  color: #333;
  transition: background-color 0.2s;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#sidebar .nav-link:hover {
  background-color: #e9ecef;
}

#sidebar .nav-link.active {
  background-color: #dee2e6;
  font-weight: 500;
}

/* Toggle button container đặt sát viền sidebar */
#toggleContainer {
  position: absolute;
  top: 10px;
  right: -15px;
  z-index: 1000;
}

/* Toggle button đẹp hơn */
#toggleBtn {
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

/* Main title */
#appTitle {
  padding: 10px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

/* Prompt style */
#promptList .list-group-item {
  transition: background-color 0.2s ease;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 8px;
}

#promptList .list-group-item:hover {
  background-color: #f8f9fa;
}

@media (max-width: 767.98px) {
  html, body {
    height: auto;
    overflow: auto;
  }
  body {
    min-height: 100vh;
    overflow-x: hidden;
  }
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar.collapsed {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
  }
  #sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 1049;
    opacity: 1;
    transition: opacity 0.3s;
  }
  #sidebar-backdrop.hide {
    opacity: 0;
    pointer-events: none;
  }
  #toggleContainer {
    position: fixed;
    top: 10px;
    left: 10px;
    right: auto;
    z-index: 1100;
  }
  .d-flex.h-100 {
    flex-direction: column;
    height: auto;
  }
  #appTitle {
    padding-left: 60px;
  }
}

/* Focus styles for accessibility */
#sidebar .nav-link:focus, #toggleBtn:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
  background: #e7f1ff;
}

#toggleBtn[aria-expanded="true"] {
  background: #e7f1ff;
  border-color: #0d6efd;
}

/* Sidebar backdrop (hidden by default) */
#sidebar-backdrop {
  display: none;
}

/* JSON Syntax Highlighting */
.json-key {
  color: #0066cc;
  font-weight: bold;
}

.json-string {
  color: #1a7f37;
}

.json-number {
  color: #0969da;
}

.json-boolean {
  color: #8250df;
  font-weight: bold;
}

.json-null {
  color: #656d76;
  font-style: italic;
}

#jsonOutput {
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Prompt Library Styles */
.prompt-card {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.prompt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
  border-left-color: var(--bs-primary);
}

.prompt-card .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.prompt-card .card-title {
  font-size: 0.95rem;
  line-height: 1.3;
}

.prompt-preview {
  border-left: 3px solid #e9ecef;
  padding-left: 12px;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 8px 12px;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--bs-primary), #4285f4) !important;
}

.bg-gradient-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Enhanced badges */
.badge {
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* Copy toast styling */
#copyToast .toast-body {
  border-radius: 8px;
}

/* Category filter and search styling */
#searchPrompt:focus, #categoryFilter:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Dropdown menu enhancements */
.dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.dropdown-item {
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(2px);
}

/* Modal enhancements */
.modal-content {
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.modal-header {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.modal-footer {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Form enhancements */
.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button hover effects */
.btn {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Empty state styling */
#emptyState {
  padding: 3rem 1rem;
}

#emptyState i {
  opacity: 0.3;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .prompt-card .card-body {
    padding: 1rem 0.75rem;
  }
  
  .prompt-card .card-header {
    padding: 0.75rem;
  }
  
  .prompt-preview {
    padding: 6px 10px;
  }
}