/*    HYPIXOR — Pages CSS
   Dashboard, Calculator, Resources, etc. */

/* ——— Dashboard ——— */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.sb-clock {
  text-align: center;
  padding: var(--space-4) 0;
}

.sb-time {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  margin-bottom: var(--space-2);
}

.sb-date {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.sb-year {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Mayor Card */
.mayor-name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mayor-name img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: contain;
  image-rendering: pixelated;
}

.perk-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.perk-item:last-child {
  margin-bottom: 0;
}

.perk-name-wrap {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.perk-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.8;
  display: inline-block;
}

.perk-desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Election */
.election-candidate {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.election-candidate:last-child {
  border-bottom: none;
}

.candidate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.candidate-name {
  font-weight: var(--weight-semi);
}

.candidate-votes {
  text-align: right;
}

.vote-pct {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-2);
}

.vote-bar {
  height: 4px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.candidate-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.perk-tag {
  font-size: var(--text-xs);
  padding: 2px 8px;
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
  border-radius: var(--radius-full);
  font-weight: var(--weight-medium);
}

/* Recurring Events */
.recurring-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.recurring-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--brand-primary-subtle);
  transform: translateY(-4px);
}

.recurring-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
  flex-wrap: wrap;
}

.recurring-name {
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.recurring-timer {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--brand-primary);
}

/* Special Mayors */
.special-mayors-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}

.special-mayor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.special-mayor-name {
  font-weight: var(--weight-medium);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.special-mayor-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Notification bar */
.notif-bar {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.notif-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.notif-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.notif-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.notif-status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.notif-status.enabled {
  color: var(--color-success);
}

/* Splash */
.splash-text {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
  text-align: right;
  margin-bottom: var(--space-2);
}

/* ——— Calculator ——— */
.calc-section {
  max-width: 640px;
}

.calc-result {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--brand-primary-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.calc-result-value {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--brand-primary);
}

/* ——— Loot Table Pages ——— */
.loot-section {
  margin-bottom: var(--space-8);
}

.mob-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mob-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  flex-shrink: 0;
}

.mob-name {
  font-weight: var(--weight-semi);
}

.mob-level {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ——— Resources ——— */
.resources-category {
  margin-bottom: var(--space-10);
}

.resources-category-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.resources-category-title svg {
  width: 22px;
  height: 22px;
  color: var(--brand-primary);
}

/* ——— Player Lookup ——— */
.player-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.player-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  image-rendering: pixelated;
  border: 2px solid var(--color-border);
}

.player-info h2 {
  margin-bottom: var(--space-1);
}

.player-uuid {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-all;
}

/* ——— Empty States ——— */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ——— Error Page ——— */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-8);
}

.error-code {
  font-size: 8rem;
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-message {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

/* ——— Contact Form ——— */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  transition: all var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary-light);
  box-shadow: var(--shadow-brand);
}

.form-input::placeholder {
  color: var(--color-text-faint);
}

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

.form-submit {
  align-self: flex-start;
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-brand);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226, 51, 107, 0.3);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

#contact-response {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.contact-success {
  color: var(--color-success);
}

.contact-error {
  color: var(--color-error);
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .event-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .event-name {
    flex-basis: calc(100% - 40px);
    min-width: 0;
  }

  .player-card {
    flex-direction: column;
    text-align: center;
  }

  .calc-section {
    max-width: 100%;
  }

  .sb-time {
    font-size: var(--text-3xl);
  }

  .recurring-timer {
    font-size: var(--text-lg);
  }

  .error-code {
    font-size: 5rem;
  }
}

/* ——— Credits Page Grid ——— */
.credits-section {
  margin-bottom: var(--space-12);
}

.credits-section-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.credits-section-title svg {
  color: var(--brand-primary);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.credit-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.credit-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--brand-primary-subtle);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.credit-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.credit-card:hover .credit-icon {
  color: var(--brand-primary);
  background: var(--brand-primary-subtle);
}

.credit-info {
  display: flex;
  flex-direction: column;
}

.credit-name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

.credit-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}