/* ==========================================================================
   RBX Server Manager - UI Components & Controls
   ========================================================================== */

/* Card Panel (Glassmorphism Bento Box) */
.card-panel {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-highlight);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #ffffff;
  border-color: var(--accent-rose);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 0.45rem;
  border-radius: var(--radius-md);
}

/* Input Controls */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.2rem 0.5rem;
  transition: border-color var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-control {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 0.35rem;
  outline: none;
}

.input-control::placeholder {
  color: var(--text-dim);
}

/* Preset Chips */
.presets-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  height: 32px;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 220px;
}

.preset-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-chip:hover {
  border-color: var(--border-highlight);
  color: var(--text-main);
  background: var(--bg-hover);
}

.preset-chip.active {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--text-main);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  box-sizing: border-box;
}

.badge-emerald,
.badge-primary {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid var(--border-highlight);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.badge-secondary {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Bookmark Card Specific Truncations */
.bookmark-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.bookmark-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-main);
  min-width: 0;
}

.bookmark-game-badge {
  max-width: 110px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.bookmark-badge-text {
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.7rem;
  display: inline-block;
  vertical-align: middle;
}

/* Sidebar Saved Game Profiles Rows & Scrollable List */
#sidebar-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-highlight) transparent;
}

#sidebar-games-list::-webkit-scrollbar {
  width: 5px;
}

#sidebar-games-list::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: 4px;
}

#sidebar-games-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-game-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.sidebar-game-btn {
  flex: 1;
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.sidebar-game-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-highlight);
}

.sidebar-game-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-game-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.sidebar-game-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-main);
  min-width: 0;
  flex: 1;
  text-align: left;
}

.sidebar-game-id {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.sidebar-game-delete-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-sizing: border-box;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

/* Server Cards Grid & Cards */
.server-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.server-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.server-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.25rem;
  margin-top: auto;
}

.server-code-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.server-code-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.server-short-code {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
}

.server-full-uuid {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pagination-info b {
  color: var(--text-main);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pagination-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-page-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--text-main);
  background: var(--bg-hover);
}

.pagination-page-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.pagination-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
  from { transform: translateY(1rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Left-Side Dedicated Sync Toast (Subtle bottom-left pill badge) */
#sync-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  pointer-events: none;
}

.sync-pill-toast {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  box-shadow: var(--shadow-md);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: sync-pill-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sync-pill-in {
  from { transform: translateY(0.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
