/* ========================================
   AntDesign Override CSS for the Documentation Site
   This file MUST load after ant-design-blazor.css

   AntD's base stylesheet is light. Every rule here reads tokens (app.css), so both themes come from the token layer —
   there is no dark-only literal. Each section follows the matching section of App/wwwroot/css/overrides.css (I-043).
   Only what the pages render lives here: Button (feedback submit, language picker), Spin (page loading), the
   Dropdown / Menu of the language picker, Alert (the not-translated banner), Icon. The sidebar Menu block, Select,
   Message, Input, TextArea, Empty, Tag, Modal, Tooltip, Card, Table, Breadcrumb and Pagination rules were removed:
   the sidebar is plain <a> links and no page renders those components.
   ======================================== */

/* ========================================
   Icon default (the body text defaults are in app.css, which loads after AntD's sheet on this site)
   ======================================== */

.anticon {
    color: currentColor;
}

/* ========================================
   Spin/Loading Overrides
   The App's .spin (prototype F): a 22px ring in --color-primary with an open right side (34px / 3px large, 16px / 2px
   small), drawn on .ant-spin-dot; AntD's four dots are hidden.
   ======================================== */

.ant-spin-text {
    color: var(--color-fg-70) !important;
}

.ant-spin-dot {
    font-size: 22px;
    box-sizing: border-box;
    border: 2.5px solid var(--color-primary);
    border-right-color: transparent;
    border-radius: 50%;
}

.ant-spin-dot-spin {
    animation: evSpinRing 0.8s linear infinite;
}

.ant-spin-dot-item {
    display: none !important;
}

.ant-spin-sm .ant-spin-dot {
    font-size: 16px;
    border-width: 2px;
}

.ant-spin-lg .ant-spin-dot {
    font-size: 34px;
    border-width: 3px;
}

@keyframes evSpinRing {
    to { transform: rotate(360deg); }
}

/* Reduced motion: the ring keeps turning (it is the only loading signal) but at a calm pace */
@media (prefers-reduced-motion: reduce) {
    .ant-spin-dot-spin {
        animation-duration: 2.4s;
    }
}

/* ========================================
   Buttons (the App's section, prototype F .btn)
   Sizes: default 36px / small 28px, radius 8 / 6. Primary: the brand fill and --color-on-primary 600, no glow at rest;
   hover lifts and glows; keyboard focus appends the 2px brand ring. Text: no surface, --text-primary ink.
   ======================================== */

.ant-btn:where(:not(.ant-btn-circle, .ant-btn-round)) {
    border-radius: var(--radius-sm) !important;
}

.ant-btn {
    height: 36px;
    padding: 0 16px;
    font-weight: var(--font-weight-medium);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease !important;
}

.ant-btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: var(--font-size-xs2);
}

.ant-btn-sm:where(:not(.ant-btn-circle, .ant-btn-round)) {
    border-radius: 6px !important;
}

/* Loading: AntD's spinner icon before the label, nothing else — AntD's white ::before wash is off (F .is-loading) */
.ant-btn.ant-btn-loading::before {
    display: none;
}

.ant-btn-primary,
button.ant-btn-primary,
.ant-btn.ant-btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--color-on-primary) !important;
    font-weight: var(--font-weight-semibold);
}

.ant-btn-primary:hover:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn-primary:focus-visible:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-primary:hover:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-primary:focus-visible:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%) !important;
    border: none !important;
    box-shadow: 0 6px 18px var(--color-primary-glow) !important;
    color: var(--color-on-primary) !important;
    transform: translateY(-1px);
}

.ant-btn.ant-btn-primary:active:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%) !important;
    box-shadow: 0 2px 8px var(--color-primary-glow) !important;
    transform: translateY(0);
}

.ant-btn.ant-btn-primary:focus-visible:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    box-shadow: 0 6px 18px var(--color-primary-glow), 0 0 0 2px var(--color-primary-glow) !important;
}

/* Disabled primary: the whole button at .55, no lift or glow */
.ant-btn-primary[disabled],
.ant-btn-primary:disabled,
.ant-btn-primary.ant-btn-disabled {
    background: var(--gradient-primary) !important;
    box-shadow: none !important;
    color: var(--color-on-primary) !important;
    cursor: not-allowed !important;
    opacity: 0.55;
    transform: none !important;
}

.ant-btn-primary .anticon {
    color: var(--color-on-primary) !important;
}

/* Text */
.ant-btn-text {
    background: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
}

.ant-btn.ant-btn-text:hover:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-text:focus-visible:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    border-color: var(--color-primary-light) !important;
    color: var(--color-primary-text) !important;
}

/* Keyboard focus draws the one brand focus ring (2px --color-primary outline: the --color-primary-glow shadow measured
   1.98 : 1, under the 3:1 a focus ring needs, I-043 TASK_07) on every non-primary type */
.ant-btn:focus-visible:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled):not(.ant-btn-primary)) {
    outline: 2px solid var(--color-primary) !important;
    outline-offset: 2px;
}

/* The language picker is a Text button drawn as the App's default button: glass surface, --control-border (the 3:1
   boundary token; --glass-border-light measured 1.85 / 1.55, I-043 TASK_07).
   (0,3,0) over the Text rest rule above, so the surface and border survive the Text reset. */
.ant-btn.ant-btn-text.language-picker-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--glass-bg) !important;
    border: 1px solid var(--control-border) !important;
    color: var(--text-primary) !important;
}

@media (max-width: 480px) {
    .ant-btn.ant-btn-text.language-picker-button {
        padding: 0 10px;
    }
}

/* ========================================
   Dropdown Menu Overrides
   The App's .ant-dropdown-menu (prototype F .ddp): panel --glass-border-light, radius 12, padding 4; items 34px, 14px
   --text-primary, radius 6; hover a neutral wash, the selected language the primary tint. The picker's menu is
   ul.ant-dropdown-menu.language-menu; its current language carries .language-menu-item-selected.
   ======================================== */

.ant-dropdown-menu {
    background: var(--color-bg-elevated) !important;
    border: 1px solid var(--glass-border-light) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-panel) !important;
    padding: 4px !important;
}

.language-menu {
    min-width: 160px !important;
}

.ant-dropdown-menu-item {
    min-height: 34px;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast), color var(--transition-fast) !important;
}

.ant-dropdown-menu-item:hover,
.ant-dropdown-menu-item-active {
    background: var(--color-fg-06) !important;
    color: var(--text-primary) !important;
}

.ant-dropdown-menu-item.language-menu-item-selected,
.ant-dropdown-menu-item.language-menu-item-selected:hover {
    background: var(--color-primary-bg) !important;
    color: var(--text-primary) !important;
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   Alert Overrides — prototype F .alert (the App's section)
   One recipe, one hue per type: border at 45 % and tint at 10 % of the status ink (warning 50 / 11), radius 12,
   padding 14 16, 20px icon in the hue, title bold in --text-primary. Info is neutral (--color-info). The
   not-translated banner (docs.css) overrides its hue with the primary tint, by specificity.
   ======================================== */

.ant-alert {
    --alert-hue: var(--color-info);
    --alert-border: 45%;
    --alert-tint: 10%;
    background: color-mix(in srgb, var(--alert-hue) var(--alert-tint), transparent) !important;
    border: 1px solid color-mix(in srgb, var(--alert-hue) var(--alert-border), transparent) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
}

.ant-alert-success {
    --alert-hue: var(--color-success-hover);
}

.ant-alert-warning {
    --alert-hue: var(--color-warning-light);
    --alert-border: 50%;
    --alert-tint: 11%;
}

.ant-alert-error {
    --alert-hue: var(--color-error-light);
}

.ant-alert-icon {
    margin-right: 12px;
    font-size: 20px !important;
    color: var(--alert-hue) !important;
}

.ant-alert-message {
    color: var(--text-primary) !important;
    font-weight: var(--font-weight-bold);
}

.ant-alert-description {
    color: var(--text-secondary) !important;
    font-size: var(--font-size-sm);
}
