:root {
  --primary-purple: #9A7BD8;
  --secondary-color: #FF8C41;
  --accent: #FF5A89;
  --dark-purple: #6848a8;
  --light-purple: #c8b0f8;
  --lighter-purple: #ede4ff;
  --hover-purple: #c8b0f8;
  --active-purple: #f8e6ff;
  --text-dark: #4a154b;
  --darker-purple: #8B5CF6;
  --darker2-purple: #4A1578;
  --sidebar-width: 250px;
  --collapsed-sidebar-width: 60px;
}

body {
  background-color: #F8F9FA;
  min-height: 100vh;
  position: relative;
}

/* Burger Menu */
.burger-menu {
  display: block;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  background: none;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--primary-purple) !important;
  padding: 1rem;
  color: var(--text-dark);
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--collapsed-sidebar-width);
}

.brand {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-dark);
  text-decoration: none;
  margin-bottom: 2rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

.sidebar-nav a {
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav a:hover {
  background-color: var(--hover-purple);
  color: var(--text-dark);
}

.sidebar-nav a i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-nav a span {
  opacity: 0;
  width: 0;
}

.sidebar.collapsed .brand {
  text-align: center;
  font-size: 20px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a, .pagination .current {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 5px;
  border: 1px solid var(--light-purple);
  border-radius: 4px;
  color: #000;
  background-color: #fff;
  text-decoration: none;
  transition: background-color 0.2s;
}

.pagination a:hover {
  border: 1px solid var(--dark-purple);
  background-color: #e9d5ff;
  color: var(--text-dark);
}

.pagination .current {
  background-color: #d8b4fe;
  color: #fff;
}

/* Pagination Settings Form */
.pagination-settings {
  margin: 15px auto;
  text-align: center;
}

.pagination-settings form {
  display: inline-flex;
  align-items: center;
}

.pagination-settings select {
  width: auto;
  display: inline-block;
  padding: 4px 8px;
  margin: 0 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.pagination-settings label {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: all 0.3s ease;
}

.main-content.expanded {
  margin-left: var(--collapsed-sidebar-width);
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.content-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.content-header .action-btn {
    margin-left: auto;
}

/* Form Styles */
.general-form .form-group {
  margin-bottom: 1rem;
}

.general-form label {
  font-weight: 500;
}

.general-form .form-group {
  margin-bottom: 1.5rem;
}

.general-form label {
  font-weight: 500;
  color: var(--text-dark);
}

.general-form .form-control {
  border-color: var(--border-color);
}

.general-form .form-control:focus {
  border-color: var(--dark-purple);
  box-shadow: 0 0 0 0.2rem rgba(var(--dark-purple-rgb), 0.25);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #e9d5ff;
  color: #000;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.action-btn:hover {
  background-color: #d8b4fe;
  color: #000;
  text-decoration: none;
}

.action-btn i {
  font-size: 1rem;
}

.alert-info {
  background-color: var(--light-purple);
  border-color: var(--dark-purple);
  color: var(--text-dark);
}

/* User Owner Card */
.user-owner-card {
  cursor: pointer;
  border: 2px solid var(--dark-purple);
  border-radius: 15px;
  background-color: var(--lighter-purple);
}

/* Card Title */
.card-header {
  background-color: var(--primary-purple);
  color: var(--text-dark);
  padding: 1rem;
}

.card-header-special {
  border-radius: 10px !important;
  margin: 5px;
  text-align: center;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 500;
}

.card-general-header {
  display: flex;
  justify-content: space-between; /* Ensures space between both elements */
  align-items: center; /* Aligns text vertically */
  white-space: nowrap; /* Prevents text wrapping */
  overflow: hidden; /* Prevents overflowing content */
}
.card-general-header-left {
  flex: 1; /* Allows it to take available space */
  min-width: 0; /* Prevents overflow issues */
  text-overflow: ellipsis; /* Adds "..." if text overflows */
  overflow: hidden;
  white-space: nowrap;
}
.card-general-header-right {
  white-space: nowrap; /* Prevents wrapping */
  margin-left: 10px; /* Adds space between elements */
  margin: 0 !important;
}

/* Listing Table */
.general-card {
  border: none;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.general-card .card-header {
  background-color: var(--primary-purple);
  color: var(--text-dark);
  padding: 1rem;
}

.listing-table {
  margin-bottom: 0 !important;
  max-width: 100%;
  width: 100%;
  table-layout: fixed;
  overflow-x: auto;
}

.listing-table thead th {
  background-color: var(--primary-purple);
  color: var(--text-dark);
  border-bottom: none;
  padding: 1rem;
}
.listing-table thead th:first-child {
  border-radius: 0.25rem 0 0 0;
}
.listing-table thead th:last-child {
  border-radius: 0 0.25rem 0 0;
}

.listing-table td {
  padding: 1rem;
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
}

.listing-table td.action-column {
  text-align: right;
}

.listing-table a {
  color: var(--light-purple);
  text-decoration: none;
}

.listing-table a:hover {
  text-decoration: underline;
}

/* Override for specific contexts where different colors are needed */
.listing-table a {
  color: var(--light-purple);
}

.listing-table a:hover {
  color: var(--dark-purple);
  text-decoration: underline;
}

.listing-table .id-column {
  min-width: 20px; /* Set a reasonable minimum width */
  width: auto; /* Allows the column to expand when needed */
  white-space: nowrap; /* Prevents text from wrapping */
}

.listing-table .column-nowrap {
  white-space: nowrap;
}

/* General Table Style Override */
.table{
  margin-bottom: 0 !important;
}

/* Input table style */
.input-table {
  width: 100%;
}

.input-table td {
  padding: 0.75rem;
  vertical-align: top;
}

.label-cell {
  text-align: right;
  white-space: nowrap;
}

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

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }
  
  .card-body {
    padding: 0px;
  }
  .card-body .row {
    padding: 1rem;
    margin-right: 0px;
  }

  /* Add padding to account for fixed header */
  .container-fluid {
    padding-top: 56px !important;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  .burger-menu {
    order: 3;
    position: static !important;
    margin-left: 0.5rem !important;
  }

  .sidebar.show {
    transform: translateX(0);
    width: var(--sidebar-width) !important;
  }

  .sidebar.show .sidebar-nav a span {
    opacity: 1;
    width: auto;
  }

  .main-content {
    padding: 0px;
    margin-left: 0;
    /* padding: 4rem 1rem 1rem 1rem; */
  }

  .main-content.expanded {
    margin-left: 0;
  }

  .content-header h2 {
    font-size: 1.25rem;
  }

  .content-header .action-btn {
    padding: 0.5rem 1rem;
  }

  .content-header {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem !important;
    position: fixed;
    top: 0;
    left: 0;
    background: white;
    z-index: 1000;
    gap: 1rem;
    text-align: center;
  }

  .btn-group .action-btn {
    /* width: 100%; */
  }

  .table-responsive td{
    font-size: 1rem;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .burger-menu {
      order: 3;
      position: static !important;
      margin-left: 0.5rem !important;
  }

  .sidebar.show {
    transform: translateX(0);
    width: var(--sidebar-width) !important;
  }

  .sidebar.show .sidebar-nav a span {
    opacity: 1;
    width: auto;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .main-content.expanded {
    margin-left: 0;
  }

  .content-header h2 {
    font-size: 1rem;
  }

  .content-header .action-btn {
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
  }

  .content-header {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem !important;
    position: fixed;
    top: 0;
    left: 0;
    background: white;
    z-index: 1000;
    gap: 1rem;
    text-align: center;
  }
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.show {
  display: block;
}

.btn{
  white-space: nowrap;
}
.btn-group {
  gap: 0.5rem;
}

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

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

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.sidebar .brand {
  display: none;
}

.sidebar {
  padding-top: 60px;
}

.sidebar-nav a {
  padding: 1rem 0.35rem;
}

.sidebar .user-info {
  margin-left: 8px;
}

.sidebar .user-info span{
  margin-left: 12px;
}

.collapsed .user-info span{
  display: none;
}

@media (max-height: 430px) {
  .sidebar-nav a {
    padding: 0.4rem 0.35rem;
  }
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e7e7e7;
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-links a {
  color: var(--darker-purple);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--darker2-purple);
}