/* Amditis Design System - Core Styles (WCAG 2.1 AA compliant) */

/* Selection colors */
::selection {
    background: #a3e635;
    color: #111827;
}

::-moz-selection {
    background: #a3e635;
    color: #111827;
}

/* Base prose typography */
p, li {
    line-height: 1.65;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: #a3e635;
    color: #111827;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #67e8f9;
    outline-offset: 2px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible styles for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 2px;
}

/* Accordion styles */
.accordion-item {
    border: 1px solid #334155;
    background: #1e293b;
    margin-bottom: 4px;
    border-radius: 4px;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: #334155;
}

.accordion-header::after {
    content: '+';
    font-family: 'JetBrains Mono', monospace;
    color: #a3e635;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.accordion-item.active .accordion-header::after {
    content: '\2212';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
}

.accordion-body {
    padding: 16px;
    border-top: 1px solid #334155;
}

/* Code block word wrap */
pre code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Code syntax colors - all pass WCAG AA on #1e293b */
.syntax-keyword {
    color: #f87171;
}

.syntax-string {
    color: #a3e635;
}

.syntax-func {
    color: #67e8f9;
}

.syntax-comment {
    color: #94a3b8;
    font-style: italic;
}

/* Cyber checkbox styling */
.cyber-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.cyber-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #475569;
    background: #1e293b;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.cyber-checkbox input[type="checkbox"]:hover {
    border-color: #a3e635;
}

.cyber-checkbox input[type="checkbox"]:checked {
    border-color: #a3e635;
    background: rgba(163, 230, 53, 0.15);
}

.cyber-checkbox input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a3e635;
    font-size: 14px;
    font-weight: bold;
}

.cyber-checkbox input[type="checkbox"]:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 2px;
}

/* Copy-to-clipboard button for code blocks */
.copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #94a3b8;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    z-index: 1;
    line-height: 1.6;
}

/* Show on hover of the code block wrapper */
div:hover > .copy-btn,
pre:hover > .copy-btn,
.copy-btn:focus-visible {
    opacity: 1;
}

.copy-btn:hover {
    color: #a3e635;
    border-color: #a3e635;
    background: #334155;
}

.copy-btn:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 2px;
}

.copy-btn.copied {
    color: #a3e635;
    border-color: #a3e635;
}
