@import url("./theme-gitea-dark.css");

/*
 * Procyon Systems corporate Gitea theme
 *
 * Brand colours:
 *   Magenta: #bf2292
 *   Orange:  #de6834
 *
 * The standard Gitea dark theme is imported first so that new variables
 * introduced by future Gitea releases continue to receive sensible defaults.
 */

gitea-theme-meta-info {
    --theme-display-name: "Procyon";
    --theme-color-scheme: "dark";
}

:root {
    --is-dark-theme: true;

    /* Procyon corporate identity */
    --procyon-magenta: #c52c87;
    --procyon-magenta-middle: #d14762;
    --procyon-orange: #db5d45;
    --procyon-gradient: linear-gradient(
        135deg,
        var(--procyon-magenta) 0%,
        var(--procyon-magenta-middle) 52%,
        var(--procyon-orange) 100%
    );

    /* Primary brand scale */
    --color-primary: #c52c87;
    --color-primary-contrast: #f3f4f6;

    --color-primary-dark-1: #ce4396;
    --color-primary-dark-2: #d65aa5;
    --color-primary-dark-3: #dd71b4;
    --color-primary-dark-4: #e588c3;
    --color-primary-dark-5: #ec9fd1;
    --color-primary-dark-6: #f3b7df;
    --color-primary-dark-7: #f9d8ed;

    --color-primary-light-1: #b2287a;
    --color-primary-light-2: #9f236d;
    --color-primary-light-3: #8c1f60;
    --color-primary-light-4: #791b53;
    --color-primary-light-5: #661746;
    --color-primary-light-6: #4f1236;
    --color-primary-light-7: #310b22;

    --color-primary-alpha-10: #c52c871a;
    --color-primary-alpha-20: #c52c8733;
    --color-primary-alpha-30: #c52c874d;
    --color-primary-alpha-40: #c52c8766;
    --color-primary-alpha-50: #c52c8780;
    --color-primary-alpha-60: #c52c8799;
    --color-primary-alpha-70: #c52c87b3;
    --color-primary-alpha-80: #c52c87cc;
    --color-primary-alpha-90: #c52c87e6;

    --color-primary-hover: #d14762;
    --color-primary-active: #db5d45;

    /* Dark surfaces */
    --color-body: #0b0d11;
    --color-box-header: #11151c;
    --color-box-body: #0e1218;
    --color-box-body-highlight: #161c25;

    --color-nav-bg: #0b0d11;
    --color-nav-hover-bg: #171c25;
    --color-secondary-nav-bg: #11151c;

    --color-menu: #11151c;
    --color-card: #11151c;
    --color-button: #171c25;
    --color-code-bg: #080a0e;

    --color-input-background: #0d1117;
    --color-input-toggle-background: #1c232d;
    --color-input-border: #313846;
    --color-input-text: #d7dbe2;

    --color-secondary-bg: #151a22;
    --color-expand-button: #1c232d;
    --color-project-column-bg: #0e1218;

    /* Softer typography: avoid large areas of pure white */
    --color-text-dark: #e8eaee;
    --color-text: #cfd4dc;
    --color-text-light: #b8c0ca;
    --color-text-light-1: #a5aeba;
    --color-text-light-2: #8993a0;
    --color-text-light-3: #6f7885;
    --color-placeholder-text: #737d8a;

    --color-nav-text: #cfd4dc;
    --color-header-wrapper: #cfd4dc;

    /* Actions console */
    --color-console-fg: #cfd4dc;
    --color-console-fg-subtle: #8993a0;
    --color-console-bg: #080a0e;
    --color-console-border: #242b36;
    --color-console-hover-bg: #111722;
    --color-console-active-bg: #192231;
    --color-console-menu-bg: #0e1218;
    --color-console-menu-border: #2b3340;

    /*
     * Pipeline state colours
     *
     * Running: amber
     * Successful: green
     * Failed: red
     * Informational: blue
     */
    --color-green: #43b581;
    --color-green-light: #67c99e;
    --color-green-dark-1: #389a6d;
    --color-green-dark-2: #2f805b;

    --color-yellow: #e2a43b;
    --color-yellow-light: #edbe65;
    --color-yellow-dark-1: #c68c2e;
    --color-yellow-dark-2: #a97425;

    --color-red: #ed5f67;
    --color-red-light: #f27b82;
    --color-red-dark-1: #cf4d55;
    --color-red-dark-2: #ae3e46;

    --color-blue: #4c91d8;
    --color-blue-light: #73ace3;
    --color-blue-dark-1: #3e79b5;
    --color-blue-dark-2: #326394;

    /* Semantic message colours */
    --color-success-border: #2b7554;
    --color-success-bg: #13271f;
    --color-success-text: #5bd19b;

    --color-warning-border: #806122;
    --color-warning-bg: #2d2414;
    --color-warning-text: #f0bb55;

    --color-error-border: #7a333c;
    --color-error-bg: #30191d;
    --color-error-text: #ff7b84;

    --color-info-border: #315f8b;
    --color-info-bg: #152435;
    --color-info-text: #72afe8;

    --color-highlight-fg: #edbe65;
    --color-highlight-bg: #332616;

    --color-shadow: #00000080;
    --color-shadow-opaque: #000000;

    accent-color: var(--procyon-magenta);
    color-scheme: dark;

    /* ================================================================
     * Pull-request and commit diff highlighting
     * Gitea 1.27
     * ================================================================ */

    /* Added lines */
    --color-diff-added-fg: #87ab63;
    --color-diff-added-linenum-bg: #274227;
    --color-diff-added-row-bg: #203224;
    --color-diff-added-row-border: #314a37;
    --color-diff-added-word-bg: #3c653c;

    /* Removed lines */
    --color-diff-removed-fg: #cc4848;
    --color-diff-removed-linenum-bg: #482121;
    --color-diff-removed-row-bg: #301e1e;
    --color-diff-removed-row-border: #634343;
    --color-diff-removed-word-bg: #6f3333;

    /* Moved and inactive lines */
    --color-diff-moved-row-bg: #555426;
    --color-diff-moved-row-border: #9da754;
    --color-diff-inactive: #25272a;

    /* Diff syntax highlighting */
    --color-syntax-diff-fg: #d8dce3;
    --color-syntax-deleted-bg: #5f3737;
    --color-syntax-inserted-bg: #3a523a;
}

/* Prevent white page surfaces */
html,
body,
body > .full.height,
.full.height {
    background-color: var(--color-body) !important;
    color: var(--color-text);
}

/* Procyon accent strip */
body::before {
    position: fixed;
    z-index: 10000;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    content: "";
    pointer-events: none;
    background: var(--procyon-gradient);
}

/* Navigation */
#navbar {
    border-bottom-color: #242b36;
    background: var(--color-nav-bg);
    box-shadow: 0 5px 18px #0000004d;
}

/* Links */
a {
    color: #d65aa5;
}

a:hover,
a:focus {
    color: #e47b62;
}

/* Primary buttons */
.ui.primary.button,
.ui.primary.buttons .button {
    color: #f5f5f5 !important;
    border-color: transparent !important;
    background-color: var(--procyon-magenta) !important;
    background-image: var(--procyon-gradient) !important;
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover {
    filter: brightness(1.08);
}

/* Focus indicators */
input:focus,
textarea:focus,
.ui.input > input:focus,
.ui.form input:focus,
.ui.form textarea:focus,
.ui.selection.dropdown:focus,
.ui.selection.active.dropdown {
    border-color: var(--procyon-magenta) !important;
    box-shadow: 0 0 0 2px #c52c874d !important;
}

/* Ensure Gitea utility status classes never inherit white */
.tw-text-green {
    color: var(--color-green) !important;
}

.tw-text-yellow {
    color: var(--color-yellow) !important;
}

.tw-text-red {
    color: var(--color-red) !important;
}

.tw-text-blue {
    color: var(--color-blue) !important;
}

.tw-text-text-light {
    color: var(--color-text-light-2) !important;
}

/* ================================================================
 * Gitea Actions: individual pipeline steps
 * ================================================================ */

.job-step-section .job-step-summary {
    border-left: 3px solid #343d4a !important;
    background-color: var(--color-console-bg) !important;
}

/* Cancelled, skipped or waiting */
.job-step-section .job-step-summary:has(.tw-text-text-light) {
    border-left-color: #687280 !important;
    background-color: #12161d !important;
}

/* Successful */
.job-step-section .job-step-summary:has(.tw-text-green) {
    border-left-color: var(--color-green) !important;
    background-color: var(--color-success-bg) !important;
}

/* Running, blocked or cancelling */
.job-step-section .job-step-summary:has(.tw-text-yellow) {
    border-left-color: var(--color-yellow) !important;
    background-color: var(--color-warning-bg) !important;
}

/* Failed */
.job-step-section .job-step-summary:has(.tw-text-red) {
    border-left-color: var(--color-red) !important;
    background-color: var(--color-error-bg) !important;
}

.job-step-section .job-step-summary:hover {
    filter: brightness(1.12);
}

/* Selected/open step */
.job-step-section .job-step-summary.selected {
    box-shadow: inset 0 0 0 1px #ffffff14 !important;
}

/* Pipeline logs */
.job-step-container,
.job-step-container .job-log-list,
.job-step-container .job-log-line {
    background-color: var(--color-console-bg);
}

.job-step-container .job-log-line:hover {
    background-color: var(--color-console-hover-bg) !important;
}

/* ================================================================
 * Gitea Actions: workflow graph nodes
 * ================================================================ */

.job-node-group .job-rect {
    fill: var(--color-box-body) !important;
    stroke: #394352 !important;
    stroke-width: 1.5px !important;
}

/* Neutral state first */
.job-node-group:has(.tw-text-text-light) .job-rect {
    fill: #767b84 !important;
    stroke: #687280 !important;
}

/* Successful workflow/job */
.job-node-group:has(.tw-text-green) .job-rect {
    fill: var(--color-success-bg) !important;
    stroke: var(--color-green) !important;
}

/* Running workflow/job */
.job-node-group:has(.tw-text-yellow) .job-rect {
    fill: var(--color-warning-bg) !important;
    stroke: var(--color-yellow) !important;
}

/* Failure is last so it wins for grouped/matrix jobs */
.job-node-group:has(.tw-text-red) .job-rect {
    fill: var(--color-error-bg) !important;
    stroke: var(--color-red) !important;
}

/* Corresponding graph list rows */
.graph-list-row:has(.tw-text-green) {
    border-left: 3px solid var(--color-green);
    background-color: var(--color-success-bg);
}

.graph-list-row:has(.tw-text-yellow) {
    border-left: 3px solid var(--color-yellow);
    background-color: var(--color-warning-bg);
}

.graph-list-row:has(.tw-text-red) {
    border-left: 3px solid var(--color-red);
    background-color: var(--color-error-bg);
}

/* ================================================================
 * Runner task state labels
 * ================================================================ */

.runner-container .task-status-success {
    color: #d7f8e8 !important;
    background-color: #236846 !important;
}

.runner-container .task-status-running {
    color: #fff0cf !important;
    background-color: #765219 !important;
}

.runner-container .task-status-failure {
    color: #ffe1e3 !important;
    background-color: #87323b !important;
}

.runner-container .task-status-cancelled,
.runner-container .task-status-blocked {
    color: #d6dae0 !important;
    background-color: #414955 !important;
}

/* Selection */
::selection {
    color: #f3f4f6;
    background: #c52c8780;
}

/* Scrollbars */
* {
    scrollbar-color: #3c4654 var(--color-body);
}

::-webkit-scrollbar-track {
    background: var(--color-body);
}

::-webkit-scrollbar-thumb {
    border: 3px solid var(--color-body);
    border-radius: 999px;
    background: #3c4654;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--procyon-magenta);
}

.workflow-graph .node-edge {
    stroke: #687586 !important;
    stroke-width: 1.75px !important;
    opacity: 1 !important;
}

.workflow-graph .highlighted-edge {
    stroke: var(--color-primary) !important;
    stroke-width: 2.5px !important;
    opacity: 1 !important;
}

.workflow-graph .node-port {
    fill: #687586 !important;
    stroke: var(--color-box-body) !important;
    opacity: 1 !important;
}

.workflow-graph .highlighted-port {
    fill: var(--color-primary) !important;
    stroke: var(--color-primary) !important;
}

/* ================================================================
 * Markdown rendering — Gitea 1.27
 * ================================================================ */

:root {
    /*
     * Markdown surfaces
     */
    --color-markup-table-row: #151b24;
    --color-markup-code-block: #080b10;
    --color-markup-code-inline: #242c38;

    /*
     * Chroma syntax highlighting
     */
    --color-syntax-keyword: #e47b62;
    --color-syntax-bool: #65c5cf;
    --color-syntax-control: #e0a84b;
    --color-syntax-name: #d8c05a;
    --color-syntax-type: #dc82b4;
    --color-syntax-number: #6daedb;
    --color-syntax-operator: #e47b62;
    --color-syntax-regexp: #b59ae3;
    --color-syntax-string: #93bd6c;
    --color-syntax-comment: #7e8da3;
    --color-syntax-invalid: #ff727c;
    --color-syntax-link: #d65aa5;
    --color-syntax-tag: #e47b62;
    --color-syntax-attribute: #c79aff;
    --color-syntax-property: #63b3f5;
    --color-syntax-variable: #e0a84b;
    --color-syntax-string-special: #e0a84b;
    --color-syntax-escape: #d8c05a;
    --color-syntax-entity: #c79aff;
    --color-syntax-preproc: #58c487;
    --color-syntax-preproc-file: #6daedb;
    --color-syntax-decorator: #58c487;
    --color-syntax-namespace: #cfd5de;
    --color-syntax-name-pseudo: #c79aff;
    --color-syntax-comment-special: #b59ae3;
    --color-syntax-text: #cfd5de;
    --color-syntax-text-alt: #b4bdc9;
    --color-syntax-punctuation: #c4cbd5;
    --color-syntax-whitespace: #667284;

    --color-syntax-diff-fg: #e9edf2;
    --color-syntax-deleted-bg: #5a2a34;
    --color-syntax-inserted-bg: #234d38;

    --color-syntax-emph: #d6a34a;
    --color-syntax-strong: #e0a84b;
    --color-syntax-heading: #e0a84b;
    --color-syntax-subheading: #93bd6c;
    --color-syntax-output: #7e8da3;
    --color-syntax-prompt: #e0a84b;
    --color-syntax-traceback: #ff727c;

    --color-syntax-matching-bracket-bg: #1f746d80;
    --color-syntax-nonmatching-bracket-bg: #9c364080;
}

/*
 * Markdown headings
 */
.markup h1,
.markup h2 {
    border-bottom-color: #343e4d !important;
}

.markup h1,
.markup h2,
.markup h3,
.markup h4,
.markup h5 {
    color: #dce1e8;
}

.markup h6 {
    color: #9da7b4;
}

/*
 * Markdown tables
 */
.markup table {
    border-collapse: collapse;
    color: var(--color-text);
}

.markup table th,
.markup table td {
    border: 1px solid #3b4657 !important;
}

.markup table th {
    color: #e1e5eb;
    background-color: #1a212c !important;
}

.markup table td {
    background-color: #0e131a;
}

.markup table tr:nth-child(2n) td {
    background-color: var(--color-markup-table-row) !important;
}

.markup table tbody tr:hover td {
    background-color: #1a2230 !important;
}

/*
 * Inline code
 */
.markup code,
.markup tt {
    color: #d9dee7;
    background-color: var(--color-markup-code-inline);
    border: 1px solid #343f4e;
}

/*
 * Do not apply inline-code borders inside fenced blocks.
 */
.markup pre code,
.markup pre tt {
    color: inherit;
    background-color: transparent;
    border: 0;
}

/*
 * Fenced code blocks
 */
.markup pre,
.markup .highlight pre {
    color: var(--color-syntax-text);
    background-color: var(--color-markup-code-block) !important;
    border: 1px solid #2d3745;
    box-shadow: inset 0 1px 0 #ffffff08;
}

/*
 * Default colour for code without a language and for untokenised text.
 * Individual Chroma token classes will override this.
 */
.markup .chroma {
    color: var(--color-syntax-text);
    background-color: transparent;
}

/*
 * Blockquotes
 */
.markup blockquote {
    color: #aeb7c3;
    background-color: #c52c870a;
    border-left-color: #c52c87;
    padding-top: 8px;
    padding-bottom: 8px;
}

/*
 * Horizontal rules
 */
.markup hr {
    background-color: #343e4d;
}
