/**
 * AGENTS.md Linter
 * CSS prefix: .aml-
 * Dark theme, CSS custom properties with fallbacks
 */

/* --- Container --- */

.aml-viz {
    max-width: 640px;
    margin: var(--spacing-lg, 2rem) auto;
    padding: var(--spacing-md, 1.5rem) var(--spacing-lg, 2rem);
    background: var(--color-bg-elevated, #111111);
    border-radius: var(--radius-md, 16px);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.aml-heading {
    font-size: var(--font-size-base, 1rem);
    font-weight: 600;
    color: var(--color-text-primary, #ffffff);
    margin: 0 0 var(--spacing-xs, 0.5rem);
}

.aml-hint {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0 0 var(--spacing-sm, 1rem);
    line-height: 1.5;
}

.aml-label {
    display: block;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    color: var(--color-text-primary, #ffffff);
    margin-bottom: var(--spacing-xs, 0.5rem);
}

/* --- Textarea --- */

.aml-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font-mono, 'SF Mono', Monaco, 'Cascadia Code', monospace);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.6;
    resize: vertical;
    color: var(--color-text-primary, #ffffff);
    background: var(--color-bg-surface, #1a1a1a);
    box-sizing: border-box;
    transition: border-color var(--transition-fast, 150ms ease);
}

.aml-textarea:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    border-color: var(--color-border-hover, rgba(255, 255, 255, 0.2));
}

.aml-textarea::placeholder {
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
}

/* --- Presets --- */

.aml-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--spacing-xs, 0.5rem);
    margin-bottom: var(--spacing-sm, 1rem);
}

.aml-preset {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    background: transparent;
    font-size: var(--font-size-xs, 0.75rem);
    font-family: inherit;
    cursor: pointer;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    transition: all var(--transition-fast, 150ms ease);
}

.aml-preset:hover {
    border-color: var(--color-border-hover, rgba(255, 255, 255, 0.2));
    color: var(--color-text-primary, #ffffff);
}

.aml-preset:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* --- Buttons --- */

.aml-btn-row {
    display: flex;
    gap: 0.5rem;
}

.aml-lint-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-primary, #ffffff);
    font-size: var(--font-size-sm, 0.875rem);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast, 150ms ease);
}

.aml-lint-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-text-primary, #ffffff);
}

.aml-lint-btn:focus-visible,
.aml-clear-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.aml-clear-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    font-size: var(--font-size-sm, 0.875rem);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast, 150ms ease);
}

.aml-clear-btn:hover {
    border-color: var(--color-border-hover, rgba(255, 255, 255, 0.2));
    color: var(--color-text-primary, #ffffff);
}

/* --- Results --- */

.aml-results:not(:empty) {
    margin-top: var(--spacing-md, 1.5rem);
    padding-top: var(--spacing-md, 1.5rem);
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.aml-empty {
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    font-size: var(--font-size-sm, 0.875rem);
}

/* --- Score --- */

.aml-score-section {
    margin-bottom: var(--spacing-md, 1.5rem);
}

.aml-score-heading {
    font-size: var(--font-size-base, 1rem);
    font-weight: 600;
    color: var(--color-text-primary, #ffffff);
    margin: 0 0 var(--spacing-xs, 0.5rem);
}

.aml-score-heading:focus:not(:focus-visible) {
    outline: none;
}

.aml-score-value {
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    font-weight: 700;
}

.aml-score-green { color: rgba(255, 255, 255, 0.9); }
.aml-score-yellow { color: rgba(255, 255, 255, 0.7); }
.aml-score-red { color: rgba(255, 255, 255, 0.55); }

.aml-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs, 0.5rem);
}

.aml-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 400ms ease;
}

.aml-bar-fill.aml-score-green { background: rgba(255, 255, 255, 0.5); }
.aml-bar-fill.aml-score-yellow { background: rgba(255, 255, 255, 0.35); }
.aml-bar-fill.aml-score-red { background: rgba(255, 255, 255, 0.2); }

.aml-score-label {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0;
    line-height: 1.5;
}

/* --- Check Results --- */

.aml-section {
    margin-bottom: var(--spacing-md, 1.5rem);
}

.aml-section-title {
    font-size: var(--font-size-xs, 0.75rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0 0 var(--spacing-xs, 0.5rem);
    font-weight: 600;
}

.aml-check {
    padding: var(--spacing-xs, 0.5rem) var(--spacing-sm, 1rem);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-xs, 0.5rem);
}

.aml-check-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.aml-icon {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 700;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.aml-icon-pass { color: rgba(255, 255, 255, 0.7); }
.aml-icon-fail { color: rgba(255, 255, 255, 0.55); }
.aml-icon-neutral { color: rgba(255, 255, 255, 0.3); }

.aml-check-name {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--color-text-primary, #ffffff);
}

.aml-penalty {
    font-size: var(--font-size-xs, 0.75rem);
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    color: rgba(255, 255, 255, 0.55);
    margin-left: auto;
}

.aml-bonus {
    font-size: var(--font-size-xs, 0.75rem);
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    color: rgba(255, 255, 255, 0.7);
    margin-left: auto;
}

.aml-check-desc {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0;
    line-height: 1.4;
}

.aml-details {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
}

.aml-detail {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    line-height: 1.5;
    padding-left: 1.5rem;
    position: relative;
}

.aml-detail::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.3);
}

/* --- Noscript --- */

.aml-noscript {
    padding: var(--spacing-sm, 1rem);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-sm, 8px);
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    font-size: var(--font-size-sm, 0.875rem);
    text-align: center;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .aml-viz {
        padding: var(--spacing-sm, 1rem) var(--spacing-md, 1.5rem);
    }
}

@media (max-width: 480px) {
    .aml-viz {
        padding: var(--spacing-sm, 1rem);
        border-radius: var(--radius-sm, 8px);
    }

    .aml-presets {
        flex-direction: column;
    }

    .aml-textarea {
        font-size: 1rem;
    }
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
    .aml-textarea,
    .aml-preset,
    .aml-lint-btn,
    .aml-clear-btn,
    .aml-bar-fill {
        transition: none;
    }
}
