body {
  background-color: #c8ecf5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th {
  background-color: #cbd3f4;
  color: white;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: #4361ee;
  border-color: #4361ee;
}

.btn-primary:hover {
  background-color: #3a56d4;
  border-color: #3a56d4;
}

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

.spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
}

.autocomplete {
  position: relative;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: white;
}

.autocomplete-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #d4d4d4;
  background-color: #fff;
}

.autocomplete-item:hover {
  background-color: #e9e9e9;
}

.autocomplete-item small {
  color: #666;
  font-size: 0.85em;
}

.autocomplete-active {
  background-color: #007bff !important;
  color: #ffffff;
}

.modal-header {
  background-color: #4361ee;
  color: white;
}

.question-textarea {
  min-height: 120px;
  resize: vertical;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

.status-today {
  background-color: #28a745;
}

.status-upcoming {
  background-color: #ffc107;
  color: #212529;
}

.status-completed {
  background-color: #6c757d;
}

.status-expired {
  background-color: #dc3545;
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1080;
}

/* Date validation styling */
input:invalid {
  border-color: #dc3545;
}

input:valid {
  border-color: #28a745;
}

/* Topic section improvements */
.topic-section {
  position: relative;
}

#addTopicBtn {
  position: absolute;
  right: 0;
  top: 0;
  margin-top: 0;
  z-index: 10;
}

.topic-input-container {
  position: relative;
}

/* Button spinner styling */
.btn-spinner {
  position: relative;
  color: transparent !important;
}

.btn-spinner .spinner-border {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -0.75rem;
  margin-top: -0.75rem;
}

/* Table scrolling improvements */
.table-container {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.table-container table {
  margin-bottom: 0;
}

.table-container thead th {
  position: sticky;
  top: 0;
  background-color: #4361ee;
  z-index: 10;
}

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

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-spinner 0.8s linear infinite;
}

@keyframes button-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pagination loading */
.pagination-loading .page-link {
  opacity: 0.6;
  pointer-events: none;
}

/* Search loading */
.search-loading {
  position: relative;
}

.search-loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: #6c757d;
  border-radius: 50%;
  animation: button-spinner 0.8s linear infinite;
}