/* ==========================================================================
   HF PLAYS — DISCORD BOT MANAGEMENT PLATFORM
   Design: Industrial Swiss Minimalist — Dark Orange & Red Edition
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Color Palette — Exact Requirements */
  --bg-primary: #101213;
  --bg-secondary: #191C1D;
  --bg-card: #1D2021;
  --bg-elevated: #222627;
  
  --text-primary: #F5F5F5;
  --text-secondary: #A0A4A5;
  --text-muted: #687078;
  
  --border-color: #303536;
  --border-light: #42494B;
  
  --accent-orange: #F28C38;
  --accent-orange-hover: #FA9A4B;
  --accent-red: #E52427;
  --accent-red-hover: #F03538;

  --accent-blurple: #5865F2;
  --accent-green: #23A55A;
  
  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Dimensions & Spacing */
  --sidebar-width: 250px;
  --header-height: 64px;
  --mobile-nav-height: 68px;
  --radius-subtle: 3px;
  --radius-dropdown: 6px;
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

#features {
  scroll-margin-top: 68px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Utility Classes & Badges
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.public-header,
.top-header,
.mobile-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
}

.public-header {
  flex: 0 0 auto;
  background: var(--bg-secondary);
}

.public-footer a,
.footer-description {
  transition: color 0.18s ease;
}

.footer-description {
  max-width: 320px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.public-footer a:hover,
.public-footer a:focus-visible,
.footer-description:hover {
  color: var(--accent-orange);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.badge.badge-orange {
  border-color: rgba(242, 140, 56, 0.5);
  color: var(--accent-orange);
  background: rgba(242, 140, 56, 0.08);
}

.badge.badge-red {
  border-color: rgba(229, 36, 39, 0.5);
  color: var(--accent-red);
  background: rgba(229, 36, 39, 0.08);
}

.badge.badge-live {
  border-color: rgba(35, 165, 90, 0.4);
  color: #3CD070;
  background: rgba(35, 165, 90, 0.08);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #3CD070;
  box-shadow: 0 0 8px #3CD070;
}

/* ==========================================================================
   Buttons — Swiss Neo-Brutalist System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 1.25rem;
  min-height: 44px; /* Accessible touch target */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #000;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
  color: #000;
  box-shadow: 0 2px 12px rgba(242, 140, 56, 0.25);
}

.btn-danger {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #FFF;
  font-weight: 700;
}

.btn-danger:hover {
  background: var(--accent-red-hover);
  border-color: var(--accent-red-hover);
  box-shadow: 0 2px 12px rgba(229, 36, 39, 0.25);
}

.btn-outline-orange {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: transparent;
}

.btn-outline-orange:hover {
  background: rgba(242, 140, 56, 0.1);
  border-color: var(--accent-orange);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  min-height: 36px;
  font-size: 0.75rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.btn-sm {
  width: 36px;
  height: 36px;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-subtle);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-orange);
  background: #141718;
  outline: none;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  border-color: var(--border-light);
  border-radius: var(--radius-dropdown);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A0A4A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  padding-right: 2.2rem;
}

.form-select:focus {
  border-color: var(--accent-orange);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 0 1px var(--accent-orange);
}

.form-select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.form-select option:disabled {
  color: var(--text-muted);
}

.searchable-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.searchable-select {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}

.searchable-select.is-open {
  z-index: 80;
}

.searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-dropdown);
  background-color: var(--bg-card);
  background-image: none !important;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.searchable-select-trigger:hover {
  border-color: var(--border-light);
}

.searchable-select-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.searchable-select.is-open .searchable-select-trigger {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 1px var(--accent-orange);
}

.searchable-select-trigger:focus-visible {
  border-color: var(--accent-orange);
  background: var(--bg-secondary);
}

.searchable-select-trigger.is-invalid {
  border-color: var(--accent-red);
}

.searchable-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-arrow {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 160ms ease;
}

.searchable-select.is-open .searchable-select-arrow {
  transform: rotate(180deg);
}

.searchable-select-menu {
  position: fixed;
  z-index: 3000;
  display: none;
  max-height: 320px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-dropdown);
  background: var(--bg-secondary);
  box-shadow: 0 12px 28px rgb(0 0 0 / 35%);
}

.searchable-select-menu.is-open {
  display: flex;
}

.searchable-select-search {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: 0 0 auto;
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  outline: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  font: 500 0.82rem var(--font-body);
}

.searchable-select-search:focus {
  border-bottom-color: var(--accent-orange);
}

.searchable-select-options {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.searchable-select-option {
  display: block;
  width: 100%;
  margin: 0.15rem 0.25rem;
  width: calc(100% - 0.5rem);
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: 500 0.82rem var(--font-body);
  text-align: left;
}

.searchable-select-option:hover,
.searchable-select-option:focus-visible {
  outline: 0;
  background: var(--bg-elevated);
  color: var(--accent-orange);
}

.searchable-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent-orange) 14%, var(--bg-secondary));
  color: var(--accent-orange);
  font-weight: 700;
}

.searchable-select-option[aria-selected="true"]:hover,
.searchable-select-option[aria-selected="true"]:focus-visible {
  background: color-mix(in srgb, var(--accent-orange) 22%, var(--bg-secondary));
  color: var(--accent-orange-hover);
}

.searchable-select-option[hidden] {
  display: none;
}

.searchable-select-option:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.searchable-select-multiple-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.searchable-select-option-label {
  min-width: 0;
}

.searchable-select-option[data-channel-type="announcement"] .searchable-select-channel-annotation {
  color: var(--accent-orange) !important;
  font-weight: 600;
}

.searchable-select-option[data-channel-type="announcement"]:hover .searchable-select-channel-annotation,
.searchable-select-option[data-channel-type="announcement"]:focus-visible .searchable-select-channel-annotation {
  color: #fff !important;
}

.searchable-select-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-muted);
}

.searchable-select-multiple-option:hover .searchable-select-checkbox,
.searchable-select-multiple-option:focus-visible .searchable-select-checkbox {
  color: var(--accent-orange);
}

.searchable-select-multiple-option[aria-selected="true"] .searchable-select-checkbox {
  color: var(--accent-orange);
}

.searchable-select-checkbox i {
  font-size: 1rem;
}

.searchable-select-empty {
  padding: 0.7rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.searchable-select-empty[hidden] {
  display: none;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: var(--bg-primary);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.form-checkbox input[type="checkbox"]:checked::before {
  content: "✔";
  color: #000;
  font-size: 11px;
  font-weight: 900;
}

/* ==========================================================================
   Card Component
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-subtle);
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   Modal Dialogs & Toast Notifications
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-subtle);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-orange);
  border-radius: var(--radius-subtle);
  padding: 0.9rem 1.25rem;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastSlideIn 0.25s ease-out;
}

.toast.toast-error {
  border-left-color: var(--accent-red);
}

.toast.toast-success {
  border-left-color: #3CD070;
}

.toast-channel-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  object-fit: cover;
}

.toast-channel-content {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.toast-channel-content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-channel-content > span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
