/* =========================================================================
   ReEdge — GitHub Dark Colorblind (Beta) theme for Forgejo v15
   Reference: github.com/settings/appearance -> Dark colorblind (Beta)
   Key colorblind change: success/open = orange (#d18616) not green
   ========================================================================= */

:root {
  /* ---- Typography ------------------------------------------------------ */
  --fonts-proportional: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --fonts-monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* ---- GitHub Dark Colorblind canvas ----------------------------------- */
  --color-body:               #0d1117;
  --color-card:               #0d1117;
  --color-menu:               #161b22;
  --color-box-body:           #0d1117;
  --color-box-header:         #161b22;
  --color-box-body-highlight: #161b22;
  --color-code-bg:            #0d1117;
  --color-code-sidebar-bg:    #161b22;
  --color-footer-bg:          #0d1117;
  --color-button:             #21262d;
  --color-hover:              rgba(177,186,196,0.12);
  --color-active:             rgba(177,186,196,0.18);
  --color-hover-highlight:    rgba(177,186,196,0.08);
  --color-markup-table-row:   rgba(22,27,34,0.6);
  --color-markup-code-block:  #161b22;
  --color-markup-code-inline: rgba(110,118,129,0.4);

  /* ---- Text ------------------------------------------------------------ */
  --color-text:          #e6edf3;
  --color-text-dark:     #e6edf3;
  --color-text-light:    #8b949e;
  --color-text-light-1:  #8b949e;
  --color-text-light-2:  #6e7781;
  --color-text-light-3:  #484f58;

  /* ---- Borders --------------------------------------------------------- */
  --color-secondary:         #30363d;
  --color-secondary-dark-1:  #3d444d;
  --color-secondary-dark-2:  #444c56;
  --color-secondary-light-1: #21262d;
  --color-secondary-light-2: #1c2128;
  --color-secondary-alpha-30: rgba(48,54,61,0.3);
  --color-secondary-alpha-40: rgba(48,54,61,0.4);
  --color-secondary-alpha-50: rgba(48,54,61,0.5);
  --color-secondary-alpha-60: rgba(48,54,61,0.6);
  --color-secondary-alpha-70: rgba(48,54,61,0.7);
  --color-secondary-alpha-80: rgba(48,54,61,0.8);
  --color-secondary-alpha-90: rgba(48,54,61,0.9);
  --color-secondary-button:  #21262d;
  --color-secondary-hover:   #30363d;
  --color-light-border:      #30363d;
  --color-light-mid:         #21262d;
  --color-shadow:            rgba(1,4,9,0.5);

  /* ---- Accent (blue — same in colorblind mode) ------------------------- */
  --color-primary:         #1f6feb;
  --color-primary-contrast:#ffffff;
  --color-primary-dark-1:  #1a62d6;
  --color-primary-dark-2:  #155bc1;
  --color-primary-dark-3:  #1053ac;
  --color-primary-dark-4:  #0b4c97;
  --color-primary-dark-5:  #064482;
  --color-primary-dark-6:  #013d6d;
  --color-primary-dark-7:  #003558;
  --color-primary-light-1: #388bfd;
  --color-primary-light-2: #58a6ff;
  --color-primary-light-3: #79c0ff;
  --color-primary-light-4: #a5d6ff;
  --color-primary-light-5: #cae8ff;
  --color-primary-light-6: #ddf4ff;
  --color-primary-light-7: #eaf5ff;
  --color-primary-alpha-30: rgba(31,111,235,0.3);
  --color-primary-alpha-40: rgba(31,111,235,0.4);
  --color-primary-alpha-50: rgba(31,111,235,0.5);
  --color-primary-alpha-60: rgba(31,111,235,0.6);
  --color-primary-alpha-70: rgba(31,111,235,0.7);
  --color-primary-alpha-80: rgba(31,111,235,0.8);
  --color-primary-alpha-90: rgba(31,111,235,0.9);
  --color-accent:           #388bfd;
  --color-small-accent:     rgba(31,111,235,0.15);

  /* ---- Status colours: COLORBLIND substitutions ----------------------- */
  /* green -> ORANGE (#d18616) for success / open issues / additions */
  --color-green:    #d18616;
  --color-red:      #f85149;
  --color-orange:   #e3b341;
  --color-yellow:   #bb8009;
  --color-olive:    #4b2900;
  --color-teal:     #2ea043;  /* kept: not part of the red/green ambiguity */
  --color-blue:     #79c0ff;
  --color-violet:   #bc8cff;
  --color-purple:   #bc8cff;
  --color-pink:     #f778ba;
  --color-brown:    #8b949e;
  --color-grey:     #6e7781;
  --color-black:    #0d1117;

  /* success (open PR/issue, diff additions) = orange */
  --color-success-bg:     rgba(209,134,22,0.15);
  --color-success-border: rgba(209,134,22,0.4);
  --color-success-text:   #d18616;

  /* danger / closed = red */
  --color-error-bg:     rgba(248,81,73,0.15);
  --color-error-border: rgba(248,81,73,0.4);
  --color-error-text:   #f85149;

  /* warning = amber */
  --color-warning-bg:     rgba(187,128,9,0.15);
  --color-warning-border: rgba(187,128,9,0.4);
  --color-warning-text:   #e3b341;

  /* info = blue */
  --color-info-bg:     rgba(56,139,253,0.15);
  --color-info-border: rgba(56,139,253,0.4);
  --color-info-text:   #79c0ff;

  /* inputs */
  --color-input-text:             #e6edf3;
  --color-input-background:       #0d1117;
  --color-input-border:           #30363d;
  --color-input-border-hover:     #484f58;

  /* nav */
  --color-nav-bg:       #161b22;
  --color-nav-hover-bg: rgba(177,186,196,0.12);
  --color-nav-text:     #e6edf3;

  /* corners */
  --border-radius:        8px;
  --border-radius-medium: 8px;
  --border-radius-full:   99999px;
}

/* ---- Force dark canvas on html/body ------------------------------------ */
html, body {
  background: #0d1117 !important;
  color: #e6edf3 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

a { color: #79c0ff !important; }
a:hover { color: #a5d6ff !important; text-decoration: underline; }

/* =========================================================================
   GLOBAL HEADER — GitHub dark header
   ========================================================================= */
#navbar, nav#navbar, .page-header {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  box-shadow: none !important;
}

#navbar .item,
#navbar a.item,
#navbar .brand .text {
  color: #e6edf3 !important;
}
#navbar a.item:hover,
#navbar .item:hover {
  color: #ffffff !important;
  background: rgba(177,186,196,0.12) !important;
}
#navbar .active.item {
  color: #ffffff !important;
  background: rgba(177,186,196,0.16) !important;
}

/* search */
#navbar .ui.input input,
#navbar input {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
  border-radius: 6px;
}
#navbar .ui.input input::placeholder { color: #6e7781 !important; }
#navbar .ui.input input:focus {
  background: #0d1117 !important;
  border-color: #1f6feb !important;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.3) !important;
}

/* dropdown menus */
#navbar .ui.dropdown .menu,
.ui.dropdown .menu {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  box-shadow: 0 8px 24px rgba(1,4,9,0.5) !important;
}
#navbar .ui.dropdown .menu > .item,
.ui.dropdown .menu > .item {
  color: #e6edf3 !important;
}
#navbar .ui.dropdown .menu > .item:hover,
.ui.dropdown .menu > .item:hover {
  background: rgba(177,186,196,0.12) !important;
}

/* =========================================================================
   CARDS / SEGMENTS
   ========================================================================= */
.ui.segment,
.ui.card,
.ui.cards > .card {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px;
  box-shadow: none !important;
}
.ui.top.attached.header,
.ui.attached.header {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
.ui.attached.segment {
  border-color: #30363d !important;
}
.ui.raised.segment {
  box-shadow: 0 0 0 1px #30363d, 0 8px 24px rgba(1,4,9,0.5) !important;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.ui.button {
  background: #21262d !important;
  border: 1px solid rgba(240,246,252,0.1) !important;
  color: #c9d1d9 !important;
  border-radius: 6px;
  box-shadow: none !important;
  font-weight: 500;
}
.ui.button:hover {
  background: #30363d !important;
  border-color: rgba(240,246,252,0.1) !important;
  color: #e6edf3 !important;
}

/* primary = blue (GitHub dark colorblind keeps blue) */
.ui.primary.button,
.ui.primary.buttons .button,
.ui.blue.button {
  background: #1f6feb !important;
  border: 1px solid rgba(240,246,252,0.1) !important;
  color: #ffffff !important;
}
.ui.primary.button:hover,
.ui.blue.button:hover { background: #388bfd !important; }

/* positive/green -> ORANGE (colorblind safe) */
.ui.green.button,
.ui.positive.button {
  background: #d18616 !important;
  border: 1px solid rgba(240,246,252,0.1) !important;
  color: #ffffff !important;
}
.ui.green.button:hover,
.ui.positive.button:hover { background: #e3b341 !important; }

/* danger */
.ui.red.button,
.ui.negative.button {
  background: #da3633 !important;
  border: 1px solid rgba(240,246,252,0.1) !important;
  color: #ffffff !important;
}
.ui.red.button:hover,
.ui.negative.button:hover { background: #f85149 !important; }

/* =========================================================================
   FORMS / INPUTS
   ========================================================================= */
.ui.input input,
.ui.form input,
.ui.form textarea,
.ui.form select,
.ui.selection.dropdown,
input, textarea, select {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
  border-radius: 6px;
}
.ui.input input:focus,
.ui.form input:focus,
.ui.form textarea:focus,
input:focus, textarea:focus {
  border-color: #1f6feb !important;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.3) !important;
  outline: none !important;
}
::placeholder { color: #6e7781 !important; }

/* =========================================================================
   TABLES
   ========================================================================= */
.ui.table {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
}
.ui.table thead th {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
.ui.table td {
  border-color: #21262d !important;
  color: #e6edf3 !important;
}
.ui.table tbody tr:hover td {
  background: rgba(177,186,196,0.06) !important;
}
.ui.table tfoot th {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* =========================================================================
   LABELS / BADGES
   ========================================================================= */
.ui.label {
  border-radius: 99999px;
  font-weight: 500;
  background: #21262d !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
}
.ui.blue.label   { background: rgba(31,111,235,0.15) !important; color: #79c0ff !important; border-color: rgba(31,111,235,0.4) !important; }
.ui.green.label  { background: rgba(209,134,22,0.15)  !important; color: #d18616  !important; border-color: rgba(209,134,22,0.4)  !important; }
.ui.red.label    { background: rgba(248,81,73,0.15)   !important; color: #f85149  !important; border-color: rgba(248,81,73,0.4)   !important; }
.ui.purple.label { background: rgba(188,140,255,0.15) !important; color: #bc8cff  !important; border-color: rgba(188,140,255,0.4) !important; }
.ui.orange.label { background: rgba(209,134,22,0.15)  !important; color: #e3b341  !important; border-color: rgba(209,134,22,0.4)  !important; }

/* =========================================================================
   TABS — GitHub underline style
   ========================================================================= */
.ui.tabular.menu {
  border-bottom: 1px solid #30363d !important;
  background: transparent !important;
}
.ui.tabular.menu .item {
  color: #8b949e !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin-bottom: -1px !important;
  font-weight: 500;
}
.ui.tabular.menu .active.item {
  color: #e6edf3 !important;
  border-bottom: 2px solid #f78166 !important;
  background: transparent !important;
  font-weight: 600;
}
.ui.tabular.menu .item:hover {
  color: #e6edf3 !important;
  background: rgba(177,186,196,0.08) !important;
}
.ui.tab.segment {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================================
   DIFF VIEW — orange/blue instead of green/red
   ========================================================================= */
.diff-file-box {
  border: 1px solid #30363d !important;
  border-radius: 8px;
  overflow: hidden;
}
.diff-file-box .diff-file-header {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  color: #e6edf3 !important;
}
/* additions = ORANGE bg (colorblind: not green) */
.code-diff td.add-code   { background: rgba(209,134,22,0.15) !important; }
.code-diff td.add-line-num { background: rgba(209,134,22,0.25) !important; color: #8b949e !important; }
/* deletions = red (kept, distinct from orange) */
.code-diff td.del-code   { background: rgba(248,81,73,0.15) !important; }
.code-diff td.del-line-num { background: rgba(248,81,73,0.25) !important; color: #8b949e !important; }

/* =========================================================================
   CODE VIEW
   ========================================================================= */
.code-view {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px;
}
.code-view .lines-num {
  color: #484f58 !important;
  background: #0d1117 !important;
  border-right: 1px solid #21262d !important;
}
.code-view tr:hover .lines-num { color: #8b949e !important; }

/* =========================================================================
   MARKDOWN
   ========================================================================= */
.markup, .markdown-body, .render-content {
  color: #e6edf3 !important;
}
.markup h1, .markup h2, .markdown-body h1, .markdown-body h2 {
  border-bottom: 1px solid #21262d !important;
  color: #e6edf3 !important;
}
.markup h3, .markup h4, .markup h5, .markup h6,
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: #e6edf3 !important;
}
.markup code, .markdown-body code {
  background: rgba(110,118,129,0.4) !important;
  color: #e6edf3 !important;
  border-radius: 3px;
}
.markup pre, .markdown-body pre {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px;
  color: #e6edf3 !important;
}
.markup pre code, .markdown-body pre code {
  background: transparent !important;
}
.markup blockquote, .markdown-body blockquote {
  border-left: 4px solid #30363d !important;
  color: #8b949e !important;
}
.markup table th, .markdown-body table th {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
}
.markup table td, .markdown-body table td {
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
}
.markup table tr:nth-child(2n), .markdown-body table tr:nth-child(2n) {
  background: rgba(22,27,34,0.5) !important;
}

/* =========================================================================
   FLASH / ALERT MESSAGES
   ========================================================================= */
.ui.message {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
  box-shadow: none !important;
  border-radius: 8px;
}
.ui.positive.message, .ui.success.message {
  background: rgba(209,134,22,0.15) !important;
  border-color: rgba(209,134,22,0.4) !important;
  color: #d18616 !important;
}
.ui.negative.message, .ui.error.message {
  background: rgba(248,81,73,0.15) !important;
  border-color: rgba(248,81,73,0.4) !important;
  color: #f85149 !important;
}
.ui.warning.message {
  background: rgba(187,128,9,0.15) !important;
  border-color: rgba(187,128,9,0.4) !important;
  color: #e3b341 !important;
}
.ui.info.message {
  background: rgba(56,139,253,0.15) !important;
  border-color: rgba(56,139,253,0.4) !important;
  color: #79c0ff !important;
}

/* =========================================================================
   PAGINATION
   ========================================================================= */
.ui.pagination.menu .item {
  background: #21262d !important;
  border: 1px solid #30363d !important;
  color: #79c0ff !important;
  border-radius: 6px !important;
  margin: 0 2px !important;
}
.ui.pagination.menu .item:hover {
  background: #30363d !important;
}
.ui.pagination.menu .active.item {
  background: #1f6feb !important;
  border-color: #1f6feb !important;
  color: #ffffff !important;
  font-weight: 700;
}

/* =========================================================================
   COMMENTS
   ========================================================================= */
.comment {
  border: 1px solid #30363d !important;
  border-radius: 8px;
  background: #0d1117 !important;
}
.comment .header {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  color: #8b949e !important;
  border-radius: 8px 8px 0 0 !important;
}

/* =========================================================================
   ISSUE / PR open status icon = orange (colorblind-safe)
   ========================================================================= */
.issue.open .status-icon svg,
.open .status-icon,
.open .labels-list .open { color: #d18616 !important; }
.issue.closed .status-icon,
.closed .status-icon      { color: #bc8cff !important; }

/* =========================================================================
   POPUP / TOOLTIP
   ========================================================================= */
.ui.popup {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  box-shadow: 0 8px 24px rgba(1,4,9,0.5) !important;
  color: #e6edf3 !important;
  border-radius: 8px;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.page-footer, footer {
  border-top: 1px solid #21262d !important;
  background: #0d1117 !important;
  color: #6e7781 !important;
}
.page-footer a, footer a { color: #6e7781 !important; }
.page-footer a:hover, footer a:hover { color: #79c0ff !important; }

/* =========================================================================
   MISC — strip leftover white/light surfaces
   ========================================================================= */
.ui.divider { border-color: #21262d !important; }
.page-content, .full.height { background: #0d1117 !important; }
.dashboard, .page-content.dashboard { background: #0d1117 !important; }
.flex-item { border-color: #21262d !important; }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }
