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

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

thead {
  background-color: #f3f4f6;
}

th {
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
}

tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

tbody tr:hover {
  background-color: #f3f4f6;
}

/* Dark mode table row styles */
[data-theme="dark"] tbody tr:nth-child(odd) {
  background-color: #111827;
}

[data-theme="dark"] tbody tr:nth-child(even) {
  background-color: #1f2937;
}

[data-theme="dark"] tbody tr:hover {
  background-color: #374151;
}

/* Responsive: Convert to cards on mobile */
@media (max-width: 768px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  tr {
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
  }
  
  td {
    padding: 0.75rem 1rem;
    border: none;
    position: relative;
    padding-left: 50%;
  }
  
  td:before {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    color: #6b7280;
  }
  
  td:nth-child(1):before { content: "Image"; }
  td:nth-child(2):before { content: "Item Details"; }
  td:nth-child(3):before { content: "Price"; }
  td:nth-child(4):before { content: "Actions"; }
}

/* Dark mode styles */
[data-theme="dark"] body {
  background-color: #111827;
}

[data-theme="dark"] nav {
  background-color: #312e81 !important;
}

[data-theme="dark"] thead {
  background-color: #374151;
}

[data-theme="dark"] th {
  color: #f9fafb;
}

[data-theme="dark"] td a {
  color: #f9fafb;
}

[data-theme="dark"] tbody tr {
  border-bottom: 1px solid #4b5563;
}

[data-theme="dark"] td {
  color: #f9fafb;
}

[data-theme="dark"] td:before {
  color: #d1d5db;
}

[data-theme="dark"] h1 {
  color: #f9fafb;
}

/* Dark mode card styles (mobile) */
@media (max-width: 768px) {
  [data-theme="dark"] tr {
    background-color: #1f2937;
    border-color: #4b5563;
  }
}

/* User filter dropdown */
table .user-filter-select {
  font-size: 12px;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #111827;
  cursor: pointer;
}

[data-theme="dark"] .user-filter-select {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

/* Profile card styles */
.profile-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-card:last-child {
  margin-bottom: 0;
}

.profile-card-header {
  padding: 16px 20px;
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.profile-card-header.account {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.profile-card-header.invites {
  background: linear-gradient(135deg, #059669, #10b981);
}

.profile-card-header.security {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.profile-card-body {
  padding: 16px;
}

.profile-username {
  font-size: 20px;
  font-weight: bold;
}

.profile-count {
  font-size: 13px;
  opacity: 0.9;
}

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 4px;
  margin-bottom: 8px;
}

.invite-code-row:last-child {
  margin-bottom: 0;
}

.invite-code-row code {
  background: #e5e7eb;
  padding: 4px 8px;
  border-radius: 4px;
  flex: 1;
}

.empty-state {
  text-align: center;
  color: #6b7280;
  padding: 12px 0;
}

/* Dark mode profile card styles */
[data-theme="dark"] .profile-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .invite-code-row {
  background: #111827;
}

[data-theme="dark"] .invite-code-row code {
  background: #374151;
  color: #f9fafb;
}

/* Dark mode footer styles */
[data-theme="dark"] footer {
  background-color: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] footer div {
  color: #9ca3af;
}
