/* Darkerside Event Styles */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 1rem;
  background: #f9f9f9;
  color: #1a1a1a;
  line-height: 1.5;
}

main {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1 { 
  font-size: 1.75rem; 
  margin: 0 0 0.5rem; 
  color: #2c2c2c;
}

h2 { 
  font-size: 1.25rem; 
  margin-top: 1.5rem;
  color: #2c2c2c;
}

h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
  color: #2c2c2c;
}

/* ── Form ── */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.field label { 
  font-weight: 600; 
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.field input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.field input[type="text"]:focus {
  outline: none;
  border-color: #0060df;
  box-shadow: 0 0 0 2px rgba(0, 96, 223, 0.1);
}

.field small { 
  color: #666; 
  font-size: 0.85rem; 
  margin-top: 0.25rem; 
}

.required { color: #c00; }

/* ── Acknowledgment Section ── */
.acknowledgment-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.acknowledgment-section p {
  margin: 0 0 0.5rem 0;
}

.acknowledgment-section ul {
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}

.acknowledgment-section li {
  margin-bottom: 0.5rem;
}

.acknowledgment-section .field {
  margin-top: 1rem;
  margin-bottom: 0;
}

.acknowledgment-section label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 600;
}

.acknowledgment-section input[type="checkbox"] {
  margin-right: 0.5rem;
  margin-top: 0.2rem;
  cursor: pointer;
  width: 1rem;
  height: 1rem;
}

/* ── Buttons ── */
button, .button {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #0060df;
  color: #fff;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
}

button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

button:hover:not(:disabled), .button:hover {
  background: #003eaa;
}

button.secondary, .button.secondary {
  background: #666;
}

button.secondary:hover:not(:disabled), .button.secondary:hover {
  background: #444;
}

button.primary {
  background: #0060df;
}

button.small {
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ── Messages ── */
.error, .success {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.error { 
  background: #ffe4e4; 
  border: 1px solid #ffaaaa; 
  color: #900; 
}

.success { 
  background: #e4ffe4; 
  border: 1px solid #aaffaa; 
  color: #060; 
}

.hidden {
  display: none;
}

/* ── Profile Card ── */
.profile-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.profile-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.profile-card dl { 
  display: grid; 
  grid-template-columns: max-content 1fr; 
  gap: 0.5rem 1.5rem; 
  margin: 0; 
}

.profile-card dt { 
  font-weight: 600; 
  color: #555; 
}

.profile-card dd {
  margin: 0;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #ddd;
}

th { 
  background: #f0f0f0; 
  font-weight: 600;
  font-size: 0.9rem;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

th[data-sort]:hover {
  background: #e5e5e5;
}

tr:nth-child(even) td { 
  background: #fafafa; 
}

td.loading, td.empty {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 2rem;
}

/* ── Admin ── */
.admin {
  max-width: 1200px;
}

.count-display {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #555;
}

.admin-controls {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e0e0e0;
}

tr.flagged td {
  background: #fff0f0 !important;
}

.detail-row td {
  background: #f5f5f5 !important;
  padding: 0 !important;
}

.detail-cell {
  padding: 1rem !important;
}

.detail-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.detail-content dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  margin: 0;
  max-width: 600px;
}

.detail-content dt {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.detail-content dd {
  margin: 0;
  font-size: 0.9rem;
}

.flag-reason-edit {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.flag-reason-edit label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.flag-reason-edit input {
  width: 100%;
  max-width: 400px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.flag-reason-edit button {
  margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }
  
  .admin-controls {
    flex-direction: column;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  th, td {
    padding: 0.4rem 0.5rem;
  }
}
