/* MediaWiki Accessibility Checker - Modernized Styles */

/* ── Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', sans-serif;
    background-color: #f8f9fa;
    color: #202122;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.app-header {
    background: #fff;
    border-bottom: 1px solid #a2a9b1;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #202122;
}

.app-header__brand-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.app-header__title {
    font-size: 1rem;
    font-weight: 700;
    color: #202122;
    letter-spacing: -0.01em;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Main layout ── */
.app-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

/* ── Page hero ── */
.page-hero {
    margin-bottom: 28px;
}

.page-hero__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #202122;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.page-hero__desc {
    font-size: 0.9375rem;
    color: #54595d;
    margin: 0;
    line-height: 1.5;
}

/* ── Card ── */
.form-card {
    background: #fff;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    overflow: hidden;
}

/* ── Tabs ── */
.cdx-tabs {
    display: flex;
    border-bottom: 1px solid #a2a9b1;
    background: #fff;
    padding: 0 20px;
    gap: 2px;
}

.cdx-tabs__item {
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    color: #54595d;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
    white-space: nowrap;
}

.cdx-tabs__item:hover {
    color: #3366cc;
}

.cdx-tabs__item--active {
    color: #3366cc;
    border-bottom-color: #3366cc;
}

/* ── Tab content ── */
.tab-content {
    display: none;
    padding: 28px 24px;
}

.tab-content.active {
    display: block;
}

/* ── Form fields ── */
.cdx-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.cdx-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #202122;
}

.cdx-text-input {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9375rem;
    color: #202122;
    background: #fff;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 8px 10px;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.cdx-text-input:hover {
    border-color: #72777d;
}

.cdx-text-input:focus {
    border-color: #3366cc;
    box-shadow: inset 0 0 0 1px #3366cc;
}

textarea.cdx-text-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    resize: vertical;
    min-height: 240px;
    line-height: 1.6;
}

/* ── Two-column grid ── */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

.single-field {
    margin-bottom: 20px;
}

/* ── Lookup dropdown ── */
.cdx-lookup {
    position: relative;
}

.cdx-lookup__menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
}

/* ── Buttons ── */
.cdx-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    border: 1px solid #a2a9b1;
    background: #fff;
    color: #202122;
}

.cdx-button:hover {
    background: #eaf3ff;
    border-color: #3366cc;
    color: #3366cc;
}

.cdx-button--weight-primary.cdx-button--action-progressive {
    background: #3366cc;
    border-color: #3366cc;
    color: #fff;
    padding: 9px 20px;
}

.cdx-button--weight-primary.cdx-button--action-progressive:hover {
    background: #2a55a3;
    border-color: #2a55a3;
}

.cdx-button--weight-quiet {
    border-color: transparent;
    background: transparent;
}

.cdx-button--weight-quiet:hover {
    background: #eaf3ff;
    border-color: transparent;
}

/* ── Options section ── */
.options-section {
    border-top: 1px solid #eaecf0;
    padding: 20px 24px 24px;
    background: #f8f9fa;
}

.options-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #3366cc;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .guidelines-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.guideline-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.875rem;
    color: #202122;
}

.guideline-option:hover {
    border-color: #3366cc;
    background: #eaf3ff;
}

.guideline-option input[type="radio"] {
    accent-color: #3366cc;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Loading ── */
#loading-area {
    display: none;
    margin-top: 24px;
    padding: 16px 20px;
    background: #eaf3ff;
    border: 1px solid #3366cc;
    border-radius: 2px;
    color: #2a55a3;
    font-size: 0.9375rem;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #c8ccd1;
    border-top-color: #3366cc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* ── Results area ── */
#results-area {
    display: none;
    margin-top: 28px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.summary-card {
    padding: 16px 20px;
    border-radius: 2px;
    border: 1px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.summary-card .count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.summary-card.violation {
    background: #fee7e6;
    border-color: #d73333;
    color: #b32424;
}

.summary-card.violation .count {
    color: #b32424;
}

.summary-card.incomplete {
    background: #fef6e7;
    border-color: #ac6600;
    color: #7a4900;
}

.summary-card.incomplete .count {
    color: #7a4900;
}

.summary-card.pass {
    background: #d5fdf4;
    border-color: #14866d;
    color: #0d5740;
}

.summary-card.pass .count {
    color: #0d5740;
}

/* ── Result Cards ── */
.issue-card {
    background: #fff;
    border: 1px solid #eaecf0;
    border-left: 5px solid #a2a9b1;
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.issue-card.violation {
    border-left-color: #d73333;
}

.issue-card.incomplete {
    border-left-color: #ac6600;
}

.issue-card.pass {
    border-left-color: #14866d;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.issue-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #202122;
}

.issue-impact {
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.impact-critical {
    background: #000;
    color: #fff;
}

.impact-serious {
    background: #d73333;
    color: #fff;
}

.impact-moderate {
    background: #ac6600;
    color: #fff;
}

.impact-minor {
    background: #72777d;
    color: #fff;
}

.issue-description {
    font-size: 0.9375rem;
    color: #54595d;
    margin: 0 0 12px;
}

.issue-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nodes-container {
    border-top: 1px solid #eaecf0;
    padding-top: 16px;
}

.node-item {
    background: #f8f9fa;
    border: 1px solid #eaecf0;
    border-radius: 2px;
    padding: 12px;
    margin-bottom: 12px;
}

.node-item:last-child {
    margin-bottom: 0;
}

.node-selector {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #3366cc;
    display: block;
    margin-bottom: 8px;
    word-break: break-all;
}

.node-html {
    background: #fff;
    border: 1px solid #c8ccd1;
    padding: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    margin: 8px 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.failure-summary {
    font-size: 0.875rem;
    color: #202122;
    margin: 8px 0 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ── Results filter tabs ── */
.results-filter {
    margin-bottom: 16px;
    padding: 0 !important;
}

.filter-content {
    display: none;
}

.filter-content.active {
    display: block;
}

/* ── Footer ── */
.app-footer {
    background: #fff;
    border-top: 1px solid #a2a9b1;
    padding: 16px 24px;
}

.app-footer__inner {
    max-width: 900px;
    margin: 0 auto;
}

.app-footer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    font-size: 0.8125rem;
    color: #54595d;
    margin-bottom: 6px;
}

.app-footer__row:last-child {
    margin-bottom: 0;
}

.app-footer__row a {
    color: #3366cc;
    text-decoration: none;
}

.app-footer__row a:hover {
    text-decoration: underline;
}

.cdx-footer__pipe {
    color: #a2a9b1;
    margin: 0 6px;
}

.app-footer__info {
    color: #72777d;
    font-size: 0.75rem;
}

/* ── Results Actions (Export) ── */
.results-actions {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaecf0;
}

.export-label {
    font-weight: bold;
}

.export-select-wrapper {
    width: 150px;
}
