/* Panel & legacy page overrides for the Time Patrol redesign */

.site-main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-height) - var(--topbar-height));
}

/* News cards with real images */
.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-image.has-image {
  padding: 0;
  font-size: 0;
}

.news-card-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.tag-update { background: rgba(0, 168, 255, 0.15); color: var(--blue); }
.tag-event { background: rgba(255, 107, 0, 0.15); color: var(--orange-light); }
.tag-content { background: rgba(255, 0, 170, 0.12); color: #ff66cc; }
.tag-news { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.tag-maintenance { background: rgba(255, 193, 7, 0.15); color: #ffc107; }

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-card-link {
  color: var(--orange-light);
  font-weight: 600;
  font-size: 0.85rem;
}

.news-card-link:hover {
  color: var(--orange);
}

/* Auth gate */
.auth-gate {
  max-width: 520px;
  margin: 80px auto;
  padding: 48px 40px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.auth-gate h2 {
  font-family: var(--font-display);
  margin-bottom: 12px;
}

.auth-gate p {
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* Server status */
.server-pulse.server-offline::before {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.status-offline {
  color: var(--red) !important;
}

.status-offline::before {
  content: '● ';
}

/* Bootstrap modals — dark theme */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-lg) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
}

.modal-header .close {
  color: var(--text-primary);
  text-shadow: none;
  opacity: 0.8;
}

.modal-changepassword .form-control,
.modal-changeemail .form-control {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
}

.modal-changepassword .form-control:focus,
.modal-changeemail .form-control:focus {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.15) !important;
}

.modal .btn-primary {
  background: linear-gradient(135deg, var(--orange-light), var(--orange)) !important;
  border: none !important;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

/* Auth modals (Login / Register) — match preview card */
.auth-modal .modal-dialog {
  max-width: 420px;
  width: calc(100% - 2rem);
  margin: 1.5rem auto;
}

.auth-modal.modal-register .modal-dialog {
  max-width: 460px;
}

.auth-modal-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 107, 0, 0.14), transparent 55%),
    #12161d !important;
  border: 1px solid rgba(255, 107, 0, 0.28) !important;
  border-radius: 18px !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 107, 0, 0.12) !important;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--orange-light);
  font-size: 1.6rem;
  line-height: 1;
  opacity: 0.9;
  cursor: pointer;
  text-shadow: none;
}

.auth-modal-close:hover {
  color: #fff;
  opacity: 1;
}

.auth-modal-body {
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
}

.auth-modal-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

.auth-modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 1.5rem;
  max-width: 220px;
}

.auth-modal-divider-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.85), transparent);
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.45);
}

.auth-dragon-ball {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.65));
}

.auth-field {
  position: relative;
  margin-bottom: 0.9rem;
  text-align: left;
}

.auth-field > i {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--orange-light);
  font-size: 0.95rem;
  pointer-events: none;
}

.auth-field .form-control {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px 14px 44px !important;
  background: rgba(0, 0, 0, 0.55) !important;
  border: 1.5px solid rgba(255, 107, 0, 0.55) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  font-size: 0.98rem;
  box-shadow: none !important;
}

.auth-field .form-control::placeholder {
  color: var(--text-muted);
}

.auth-field .form-control:focus {
  border-color: var(--orange-light) !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.18) !important;
  background: rgba(0, 0, 0, 0.65) !important;
}

.auth-modal .error-alert {
  text-align: left;
  margin-bottom: 0.85rem;
}

.auth-submit {
  margin-top: 0.35rem !important;
  margin-bottom: 0 !important;
  min-height: 52px;
  padding: 14px 24px !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  box-shadow: 0 10px 28px rgba(255, 107, 0, 0.35) !important;
}

.auth-submit:hover,
.auth-submit:focus {
  filter: brightness(1.06);
}

.auth-modal .modal-switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 1.15rem 0 0.65rem;
  padding: 0;
  border: none;
}

.auth-modal .modal-switch-line {
  flex: 1;
  max-width: 72px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-modal .modal-switch-or {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-modal .modal-switch-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0 auto;
  color: var(--orange-light) !important;
  font-size: 0.95rem;
  font-weight: 600;
  font-style: normal;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-modal .modal-switch-link:hover,
.auth-modal .modal-switch-link:focus {
  color: #fff !important;
  text-decoration: underline;
  outline: none;
}

.modal .jumbotron {
  background: rgba(255, 107, 0, 0.08) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Shop page */
.shop-page-wrap {
  padding: 40px 0 100px;
}

.shop-sidebar .nav-link {
  color: var(--text-secondary) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 6px;
  transition: all var(--transition);
}

.shop-sidebar .nav-link:hover,
.shop-sidebar .nav-link.bg-primary {
  background: rgba(255, 107, 0, 0.15) !important;
  color: var(--orange-light) !important;
}

.shop-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.shop-item-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* User panel */
.panel-page {
  padding: 40px 24px 100px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: var(--text-primary);
}

.panel-card .nav-link {
  color: var(--text-secondary) !important;
  cursor: pointer;
}

.panel-card .nav-link.active-nav,
.panel-card .nav-link:hover {
  color: var(--orange-light) !important;
}

.panel-card .table {
  color: var(--text-primary);
}

.panel-card .table-bordered {
  border-color: var(--border);
}

.panel-card .table-bordered th,
.panel-card .table-bordered td {
  border-color: var(--border);
}

.panel-card .well,
.panel-card .jumbotron {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
}

/* Download tabs */
.download-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.download-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.download-tab {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.download-tab:hover,
.download-tab.active-nav {
  border-color: var(--orange);
  color: var(--orange-light);
  background: rgba(255, 107, 0, 0.1);
}

.download-section {
  color: var(--text-secondary);
}

.download-section hr {
  border-color: var(--border);
}

.download-section p {
  margin: 12px 0;
}

.download-section a {
  color: var(--orange-light);
}

.hide-page {
  display: none !important;
}

.active-page {
  display: block !important;
}

/* Events page */
.event-card-new {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  height: 100%;
}

.event-card-new:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.event-card-new .event-header {
  background: linear-gradient(135deg, var(--orange), #cc3300);
  padding: 20px 24px;
  text-align: center;
}

.event-card-new .event-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.event-card-new .event-body {
  padding: 24px;
}

.event-card-new .event-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.event-card-new .event-time {
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  margin-bottom: 16px;
  color: var(--orange-light);
  font-weight: 600;
}

.event-card-new .event-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.events-meta-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.events-meta-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}

.events-meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.events-meta-item strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.events-live-count {
  color: var(--green);
}

.events-empty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}

.events-empty h3 {
  font-family: var(--font-display);
  margin-bottom: 12px;
}

.events-empty p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.events-empty-path code {
  color: var(--orange-light);
  word-break: break-all;
}

.event-card-live {
  border-color: rgba(0, 230, 118, 0.45);
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.12);
}

.event-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.event-type-badge,
.event-live-badge,
.event-today-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-type-badge {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.event-live-badge {
  background: rgba(0, 230, 118, 0.18);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.event-today-badge {
  background: rgba(255, 204, 0, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.event-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.event-day-chip {
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.event-day-chip.is-on {
  color: var(--orange-light);
  background: rgba(255, 107, 0, 0.12);
  border-color: rgba(255, 107, 0, 0.25);
}

.event-day-chip.is-today {
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.35);
}

.event-schedule-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.event-schedule-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.event-schedule-list li:last-child {
  border-bottom: none;
}

.event-schedule-list li span:first-child {
  color: var(--text-muted);
}

.event-schedule-list li span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

  .events-grid {
    grid-template-columns: 1fr;
  }
}

/* Skill calculator page */
.skill-calculator-section {
  padding-top: 8px;
  padding-bottom: 80px;
}

.skill-calculator-section .container {
  overflow-x: auto;
}

.skill-calculator-section .skill-calculator-root {
  margin: 0 auto;
}
