:root {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.9) 0%,
    rgba(139, 92, 246, 0.9) 100%
  );
  --secondary-gradient: linear-gradient(
    45deg,
    rgba(99, 102, 241, 0.9) 0%,
    rgba(139, 92, 246, 0.9) 100%
  );
  --card-bg: rgba(255, 255, 255, 0.85);
  --sidebar-bg: rgba(255, 255, 255, 0.95);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: rgba(229, 231, 235, 0.5);
  --card-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

[data-theme="dark"] {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.8) 0%,
    rgba(139, 92, 246, 0.8) 100%
  );
  --card-bg: rgba(17, 24, 39, 0.85);
  --sidebar-bg: rgba(17, 24, 39, 0.95);
  --text-primary: #e5e7eb;
  /* Light gray for better contrast */
  --text-secondary: #9ca3af;
  /* Medium gray for better contrast */
  --border-color: rgba(75, 85, 99, 0.5);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body {
  transition: background-color 0.3s;
  min-height: 100vh;
  background-attachment: fixed;
  font-family: 'Fira Code', monospace;
}

nav > a {
  border-radius: 16px;
  padding: 8px 20px;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid transparent;
  background: var(--card-bg);
  color: white;
  backdrop-filter: blur(4px);
}

nav > a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

select {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
}

select:hover {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
}

option {
  background-color: var(--card-bg);
  color: var(--text-primary);
  padding: 8px;
  border: none;
}

/* Cannot guarantee this will work in all browsers */
option:hover {
  background-color: rgba(99, 102, 241, 0.2);
}

button {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
  }
  
  button:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
  }
  
  button:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
  }

/* Form Styling */
.form-container {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

label {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
}

input,
textarea,
select {
  font-size: 1rem;
  padding: 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
}

textarea {
  resize: vertical;
}

/* Error Styling */
.error-message {
  color: #f87171;
  /* Red for error */
  font-size: 0.875rem;
  margin-top: 8px;
}

/* Responsiveness */
@media (max-width: 768px) {
  .form-container {
    padding: 16px;
  }

  .form-group {
    margin-bottom: 12px;
  }
}

/* Theme variations */
.theme-blue {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(99, 156, 241, 0.9) 0%,
    rgba(0, 140, 255, 0.9) 100%
  );
}

.theme-green {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.9) 0%,
    rgba(5, 150, 105, 0.9) 100%
  );
}

.theme-purple {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.9) 0%,
    rgba(124, 58, 237, 0.9) 100%
  );
}

.theme-pink {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.9) 0%,
    rgba(219, 39, 119, 0.9) 100%
  );
}

.dark body {
  background-color: #111827;
}

.gradient-bg {
  background: var(--primary-gradient);
  backdrop-filter: blur(8px);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.card {
  background: var(--card-bg);
  /* backdrop-filter: blur(16px); */
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.hover-scale:hover {
  transform: translateY(-4px);
}

.pudgy-button {
  border-radius: 16px;
  padding: 12px 24px;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid transparent;
  background: var(--primary-gradient);
  color: white;
  backdrop-filter: blur(4px);
}

.pudgy-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar {
  position: fixed;
  height: 100vh;
  width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.fixed {
  position: fixed;
}

.main-content {
  margin-left: 280px;
  transition: margin-left 0.3s;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.875rem;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.dark .status-badge.active {
  background: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.dark .status-badge.pending {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 100%;
    max-width: 320px;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

.table-container {
  overflow-x: auto;
  border-radius: 16px;
  background: var(--card-bg);
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.custom-table th {
  background: var(--card-bg);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.swal2-popup-custom {
  background-color: var(--card-bg);
  border-radius: 10px;
}

.swal2-title-custom {
  color: var(--text-primary);
  font-size: 1.5em;
  font-weight: bold;
}

.swal2-content-custom {
  color: #666;
  font-size: 1.2em;
}

.swal2-confirm-button-custom {
  background-color: #3085d6;
  color: white;
  border-radius: 5px;
  padding: 10px 20px;
}

.swal2-cancel-button-custom {
  background-color: #d33;
  color: white;
  border-radius: 5px;
  padding: 10px 20px;
}

div:where(.swal2-container).swal2-top,
div:where(.swal2-container).swal2-center,
div:where(.swal2-container).swal2-bottom {
  grid-template-columns: auto minmax(0, 1fr) auto;
  backdrop-filter: blur(8px);
}

.donation > button {
    background-color: #f87171c5;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    padding: 10px 20px;
    color: var(--text-primary);
    border: none;
    margin-bottom: 35px;
    border-radius: 5px;
    text-align: center;
}

.donation > button:hover {
    background-color: rgba(250, 128, 114, 0.925);
    transform: scale(1.1);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.alert{
    background-color: #f87171c5;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    height: 8px;
    background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 4px;
}

.pagination {
  display: flex;
  justify-content: center;
  padding: 16px 0;
  list-style: none;
}

.page-item {
  margin: 0 4px;
}

.page-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s, color 0.3s;
  text-decoration: none;
}

.page-link:hover {
  background-color: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.page-item.active .page-link {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
}