/* ==========================================================================
   RoyalAce Gaming Platform - Master Admin Stylesheet
   Architecture: Dark SaaS theme with Gold/Emerald accents
   ========================================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-sidebar: #0F1422;
  --bg-card: #141B2D;
  --bg-card-hover: #192238;
  --bg-surface: #1E293B;
  --bg-input: #101524;
  
  --border-color: rgba(255, 255, 255, 0.07);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  --border-focus: #F59E0B;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --gold-primary: #F59E0B;
  --gold-glow: rgba(245, 158, 11, 0.15);
  --gold-light: #FBBF24;
  
  --emerald-primary: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  
  --rose-primary: #F43F5E;
  --rose-glow: rgba(244, 63, 94, 0.15);
  
  --cyan-primary: #06B6D4;
  --cyan-glow: rgba(6, 182, 212, 0.15);
  
  --indigo-primary: #6366F1;
  --indigo-glow: rgba(99, 102, 241, 0.15);
  
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--gold-light);
}

/* App Wrapper Layout */
#app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-main);
}

/* Sidebar Styling */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar & Content */
#sidebar::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
#sidebar::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
#sidebar::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

/* Sidebar Brand Header */
.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sidebar-brand img, .sidebar-brand svg {
  height: 38px;
  max-width: 100%;
}
.sidebar-brand-text {
  margin-left: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 1.05rem;
  color: #FFFFFF;
  white-space: nowrap;
}
.sidebar-brand-text span {
  color: var(--gold-primary);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  padding: 1rem 0.75rem;
  flex-grow: 1;
}
.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.35rem;
  margin-top: 0.25rem;
  white-space: nowrap;
}
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 0.2rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-link i {
  font-size: 1.15rem;
  width: 24px;
  margin-right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.sidebar-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.05);
}
.sidebar-link:hover i {
  color: var(--gold-primary);
}
.sidebar-link.active {
  color: #FFFFFF;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-left: 3px solid var(--gold-primary);
  font-weight: 600;
}
.sidebar-link.active i {
  color: var(--gold-primary);
}
.sidebar-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Collapsed Sidebar */
body.sidebar-collapsed #sidebar {
  width: var(--sidebar-collapsed-width);
}
body.sidebar-collapsed #sidebar .sidebar-brand-text,
body.sidebar-collapsed #sidebar .nav-section-title,
body.sidebar-collapsed #sidebar .sidebar-link span,
body.sidebar-collapsed #sidebar .sidebar-badge,
body.sidebar-collapsed #sidebar .sidebar-footer {
  display: none;
}
body.sidebar-collapsed #sidebar .sidebar-link {
  justify-content: center;
  padding: 0.75rem 0;
}
body.sidebar-collapsed #sidebar .sidebar-link i {
  margin-right: 0;
}
body.sidebar-collapsed #main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* Main Content Wrapper */
#main-wrapper {
  flex-grow: 1;
  /* Without this a wide table stretches the wrapper past the viewport and clips the right edge. */
  min-width: 0;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
  background-color: var(--bg-main);
}

/* Top Navigation Bar */
#topbar {
  height: var(--topbar-height);
  background-color: rgba(15, 20, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border-color: var(--border-color-hover);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb-nav a {
  color: var(--text-secondary);
}
.breadcrumb-nav a:hover {
  color: var(--gold-primary);
}
.breadcrumb-nav .separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.breadcrumb-nav .current {
  color: #FFFFFF;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Global Quick Search Bar */
.search-trigger-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.825rem;
  cursor: pointer;
  min-width: 220px;
  transition: var(--transition);
}
.search-trigger-box:hover {
  border-color: var(--border-color-hover);
  color: var(--text-secondary);
}
.search-kbd {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  margin-left: auto;
}

/* Status Indicator Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--emerald-primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Icon Buttons */
.topbar-icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}
.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--rose-primary);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.1rem 0.35rem;
  line-height: 1;
}

/* Admin Profile Dropdown trigger */
.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition);
}
.admin-profile-pill:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
}
.admin-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--gold-primary);
  object-fit: cover;
}
.admin-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.admin-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFFFFF;
}
.admin-role {
  font-size: 0.68rem;
  color: var(--gold-primary);
}

/* Page Container */
#content-container {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Page Header Block */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  margin-bottom: 0;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Platform Demo Banner */
.demo-alert-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: #fef3c7;
}
.demo-alert-banner a {
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: underline;
}

/* Footer */
#admin-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--bg-sidebar);
}
#admin-footer a {
  color: var(--text-secondary);
}
#admin-footer a:hover {
  color: var(--gold-primary);
}

