/* Profile page styles */
.profile-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.profile-section {
  flex: 1;
  min-width: 300px;
}

.profile-avatar {
  display: flex;
  flex-direction: row;
  align-items: right;
  margin-bottom: 30px;
  padding-top: 20px;
}

.profile-avatar h3 {
  display: flex;
  flex-direction: row;
  margin-left: 30px;
  padding-bottom: 40px;
}

.avatar-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.profile-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
  flex: 1;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 0 5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.9rem;
  color: #777;
  margin-top: 5px;
}

.profile-details {
  flex: 2;
  min-width: 300px;
}

.profile-details h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Security settings */
.security-settings {
  padding: 10px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.setting-info h4 {
  margin: 0 0 5px 0;
}

.setting-info p {
  margin: 0;
  color: #777;
  font-size: 0.9rem;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Success message */
.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 10px 15px;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-message {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
}

/* Responsive adjustments for profile page */
@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
  }

  .profile-section,
  .profile-details {
    width: 100%;
  }

  .profile-stats {
    flex-direction: column;
    gap: 10px;
  }

  .stat-item {
    margin: 5px 0;
  }
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}

/* User details styling */
.user-detail {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.detail-label {
  width: 150px;
  font-weight: 600;
  color: #555;
}

.detail-value {
  flex: 1;
}

/* Dashboard container and sidebar */
:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --dark-color: #2c3e50;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --light-color: #f8f9fa;
  --transition: all 0.3s ease;
}

.dashboard-container {
   display: flex;
  min-height: 100vh;
  width: 100%;  /* Ensures full width */
  box-sizing: border-box; /* Prevents width overflow due to padding */
  overflow-x: hidden; /* Prevents horizontal scrolling */
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Prevents horizontal scrolling */
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--dark-color);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 1000;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
  min-height: 100vh;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  padding: 20px 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-menu-item:hover,
.sidebar-menu-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-menu-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: white;
  border-bottom: 1px solid #eee;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

.user-info {
  display: flex;
  align-items: right;
}

.user-balance {
  margin-right: 15px;
  font-weight: 500;
}

.user-name {
  margin-right: 10px;
  text-align: right;
}

.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* Content area */
.content-area {
  padding: 20px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.stat-card-title {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  color: var(--primary-color);
  opacity: 0.8;
}

/* Dashboard cards */
.dashboard-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.dashboard-card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Table styles */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  font-weight: 600;
  color: #555;
  background-color: #f8f9fa;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-success {
  background-color: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.status-pending {
  background-color: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.status-failed {
  background-color: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-success {
  background-color: var(--secondary-color);
  color: white;
}

.btn-success:hover {
  background-color: #27ae60;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-info {
  background-color: #3498db;
  color: white;
}

.btn-info:hover {
  background-color: #2980b9;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
  }

  .sidebar.active {
    transform: translateX(0);
  }

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

  .menu-toggle {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-card-header .btn {
    margin-top: 10px;
  }

  .data-table {
    min-width: 650px;
  }
}

/* Pagination styles */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.pagination-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-item {
  margin: 0 5px;
}

.pagination-item a {
  display: block;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
  color: var(--primary-color);
  text-decoration: none;
  transition: background-color 0.3s;
}

.pagination-item a:hover {
  background-color: #e9ecef;
}

.pagination-item a.active {
  background-color: var(--primary-color);
  color: white;
}

.pagination-item a.disabled {
  color: #adb5bd;
  pointer-events: none;
}

/* Error message styles */
.error-container {
  margin-bottom: 20px;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px 15px;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-message p {
  margin: 0;
}

.close-error {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #721c24;
}

/* Filter controls */
.filter-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.filter-controls input,
.filter-controls select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.filter-controls input {
  flex: 1;
}

/* Action buttons in modals */
.modal-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-action-buttons .btn {
  padding: 8px 15px;
}

/* Fix action buttons alignment */
.action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* User details modal */
.user-details-container {
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 20px;
}

.user-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.user-details-header h3 {
  margin: 0;
}

.user-details-section {
  margin-bottom: 20px;
}

.user-details-section h4 {
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

/* Back button */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
  color: var(--dark-color);
  font-weight: 500;
  margin-bottom: 20px;
  transition: background-color 0.3s;
}

.back-button:hover {
  background-color: #e9ecef;
}

/* Form validation */
.form-error {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 5px;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger-color);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Confirmation dialog */
.confirm-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.confirm-dialog-content {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.confirm-dialog-title {
  margin-top: 0;
  margin-bottom: 15px;
}

.confirm-dialog-message {
  margin-bottom: 20px;
}

.confirm-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Fix table layout */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fix form layout */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  font-size: 14px;
}

/* Fix button sizes */
.btn-sm {
  padding: 5px 10px;
  font-size: 0.85rem;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: #1a1a2e;
  color: white;
  padding: 20px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  transition: transform 0.3s ease-in-out;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}

.sidebar-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 20px;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a2e;
  padding: 15px;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  /* Hide sidebar on mobile */
  .sidebar {
    transform: translateX(-100%);
    position: absolute;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .stats-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .data-table {
    width: 100%;
    min-width: 600px;
  }
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--blue-gradient);
  padding: 20px;
}

.auth-card {
  background-color: #fff;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-header img {
  width: 150px;
  margin-bottom: 15px;
}

.auth-header h2 {
  font-size: 1.8rem;
  color: var(--dark-color);
  margin-bottom: 10px;
}

.auth-header p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 20px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
}

.auth-card .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.auth-card .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--dark-color);
}

.auth-card .form-group input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.auth-card .form-group input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.auth-card button.btn-primary {
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.auth-card button.btn-primary:hover {
  background-color: #0066cc;
  transform: translateY(-2px);
}

.auth-footer {
  margin-top: 20px;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary-color);
  transition: var(--transition);
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--blue-gradient);
  padding: 20px;
}

.auth-card {
  background-color: #fff;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-header img {
  width: 150px;
  margin-bottom: 15px;
}

.auth-header h2 {
  font-size: 1.8rem;
  color: var(--dark-color);
  margin-bottom: 10px;
}

.auth-header p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 20px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
}

.auth-card .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.auth-card .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--dark-color);
}

.auth-card .form-group input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.auth-card .form-group input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.auth-card button.btn-primary {
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.auth-card button.btn-primary:hover {
  background-color: #0066cc;
  transform: translateY(-2px);
}

.auth-footer {
  margin-top: 20px;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary-color);
  transition: var(--transition);
}

.auth-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .data-table {
    min-width: 0 !important; /* or remove min-width entirely */
    table-layout: auto;
  }
}
