/* ==========================================================================
   GITEA ASEXUAL PRIDE (ACE) THEME - FULL CANVAS DARK REWRITE
   Palette: Pure Black (#0a0a0c), Dark Slate (#0f0f12 / #141418), 
            Lightened Ace Violet (#b533f5), Ace Lilac (#d8b4fe), Crisp White (#ffffff)
   ========================================================================== */

:root {
  /* Force system/browser controls into dark mode */
  color-scheme: dark;

  /* --- Lightened Ace Purple & Accents --- */
  --color-primary: #b533f5;
  --color-primary-dark-1: #9333ea;
  --color-primary-dark-2: #7e22ce;
  --color-primary-light-1: #c084fc;
  --color-primary-light-2: #d8b4fe;
  --color-primary-alpha-10: rgba(181, 51, 245, 0.1);
  --color-primary-alpha-20: rgba(181, 51, 245, 0.2);

  /* --- Global Dark Surfaces --- */
  --color-body: #0a0a0c;
  --color-box-header: #141418;
  --color-box-body: #0f0f12;
  --color-box-body-highlight: #18181c;
  --color-nav-bg: #121216;
  --color-footer-bg: #0a0a0c;
  --color-card-bg: #141418;
  
  /* --- Explicit Solid Popups & Menus --- */
  --color-menu-bg: #141418;
  --color-dropdown-bg: #141418;
  --color-popup-bg: #1a1a20;
  --color-modal-bg: #141418;

  /* --- Borders & Contrast Text --- */
  --color-border: #3f3f46;
  --color-secondary: #27272a;
  --color-text: #f4f4f5;
  --color-text-dark: #ffffff;
  --color-text-subtle: #a1a1aa;

  /* --- Code Blocks --- */
  --color-markup-code-bg: #141418;
}

/* ==========================================================================
   1. GLOBAL CANVAS & CONTENT CONTAINERS (Fixes Stark White Body)
   ========================================================================== */

html, 
body, 
#app, 
.page-content, 
.ui.container, 
.repository, 
.ui.segment, 
.ui.grid, 
.file-list, 
.file-header, 
.repository-summary,
.ui.cards > .card,
.explore {
  background-color: #0a0a0c !important;
  color: #f4f4f5 !important;
}

/* File Tree Table & Main Repo Boxes */
.repository .file-list,
.repository .file-header,
.repository .single-file,
.ui.boxed.rolling.content,
.ui.table,
#repo-files-table {
  background-color: #0f0f12 !important;
  border-color: #3f3f46 !important;
  color: #f4f4f5 !important;
}

.repository .file-list tbody tr:hover {
  background-color: #18181c !important;
}

.repository .file-list a,
.repository .file-list .commit-summary a,
.repository .file-list .author {
  color: #f4f4f5 !important;
}

.repository .file-list a:hover {
  color: #b533f5 !important;
}

/* ==========================================================================
   2. REPOSITORY SUB-NAVBAR NORMALIZATION (Fixes Floating Box Shadow)
   ========================================================================== */

#navbar {
  background-color: #121216 !important;
  border-bottom: 1px solid #3f3f46 !important;
}

.ui.tabular.menu,
.repository .ui.tabular.menu {
  background-color: #121216 !important;
  border-bottom: 1px solid #3f3f46 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.ui.tabular.menu .item,
.repository .ui.tabular.menu .item {
  color: #a1a1aa !important;
  background: transparent !important;
  border: none !important;
}

.ui.tabular.menu .active.item,
.repository .ui.tabular.menu .active.item {
  color: #ffffff !important;
  background-color: #18181c !important;
  border-bottom: 2px solid #b533f5 !important;
  font-weight: bold;
}

/* ==========================================================================
   3. DROPDOWNS, POPUPS, AND FORM CONTROLS
   ========================================================================== */

.ui.dropdown .menu,
.ui.popup,
.ui.modal,
.select-menu-list,
.gitea-select-menu .menu {
  background-color: #141418 !important;
  border: 1px solid #3f3f46 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9) !important;
  color: #ffffff !important;
}

.ui.dropdown .menu > .item:hover,
.select-menu-item:hover {
  background-color: #27272a !important;
  color: #ffffff !important;
}

.ui.input input,
textarea {
  background-color: #0f0f12 !important;
  color: #ffffff !important;
  border: 1px solid #3f3f46 !important;
}

.ui.input input:focus, 
textarea:focus {
  border-color: #b533f5 !important;
  box-shadow: 0 0 0 2px rgba(181, 51, 245, 0.35) !important;
}

.ui.primary.button {
  background-color: #b533f5 !important;
  color: #ffffff !important;
}

.ui.primary.button:hover {
  background-color: #9333ea !important;
}

/* ==========================================================================
   4. LANGUAGE STATS BAR & LEGEND (Direct DOM Overrides)
   ========================================================================== */

/* Bar Segments */
.language-stats > .bar:nth-child(1) { background-color: #b533f5 !important; }
.language-stats > .bar:nth-child(2) { background-color: #d8b4fe !important; }
.language-stats > .bar:nth-child(3) { background-color: #ffffff !important; }
.language-stats > .bar:nth-child(4) { background-color: #71717a !important; }

/* Legend Color Dots */
.language-stats-details > *:nth-child(1) .color-icon,
.language-stats-details > *:nth-child(1) i { 
  background-color: #b533f5 !important; 
}

.language-stats-details > *:nth-child(2) .color-icon,
.language-stats-details > *:nth-child(2) i { 
  background-color: #d8b4fe !important; 
}

/* Force Legend Labels ("Shell 83.8%", "Lua 16.2%") to Crisp White */
.language-stats-details,
.language-stats-details *,
.repository-language-stats,
.repository-language-stats * {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}
