/* ================================================
   MAXSUS IMKONIYATLAR — a11y.css
   Django proyekti uchun moslashtirilgan
   ================================================ */

/* ── Accessibility tugmasi (navbar da) ── */
.a11y-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    vertical-align: middle;
}
.a11y-toggle-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: scale(1.1);
}

/* ── Offcanvas panel ── */
.a11y-oc-header {
    background: #1a6fc4;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.a11y-oc-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
}
.a11y-oc-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}
.a11y-oc-close:hover { background: rgba(255,255,255,0.35); }

.a11y-oc-body { padding: 0; }

/* ── Bo'limlar ── */
.a11y-section {
    padding: 14px 16px;
    border-bottom: 1px solid #e8ecf0;
    background: #fff;
    margin-bottom: 4px;
}
.a11y-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    line-height: 1.4;
}
.a11y-font-pct {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

/* ── Tema kartalar ── */
.a11y-theme-cards { display: flex; gap: 8px; }
.a11y-theme-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    border: 2px solid #e0e6f0;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    transition: all 0.18s;
}
.a11y-theme-card:hover,
.a11y-theme-card.active {
    border-color: #1a6fc4;
    background: #e8f0fe;
    color: #1a6fc4;
}

/* ── Tema preview ── */
.a11y-theme-preview {
    width: 56px; height: 40px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #dde2ec;
}
.theme-preview-light      { background: #fff; }
.theme-preview-light .tp-bar { background: #e0e6f0; height: 10px; }
.theme-preview-light .tp-lines { padding: 5px; }
.theme-preview-light .tp-line { background: #c5ced8; height: 3px; border-radius: 2px; margin-bottom: 3px; }
.theme-preview-light .tp-line.short { width: 65%; }

.theme-preview-dark       { background: #1a1a2e; }
.theme-preview-dark .tp-bar { background: #0d3b66; height: 10px; }
.theme-preview-dark .tp-lines { padding: 5px; }
.theme-preview-dark .tp-line { background: #3a4a60; height: 3px; border-radius: 2px; margin-bottom: 3px; }
.theme-preview-dark .tp-line.short { width: 65%; }

.theme-preview-contrast   { background: #000; }
.theme-preview-contrast .tp-bar { background: #FFD700; height: 10px; }
.theme-preview-contrast .tp-lines { padding: 5px; }
.theme-preview-contrast .tp-line { background: #fff; height: 3px; border-radius: 2px; margin-bottom: 3px; }
.theme-preview-contrast .tp-line.short { width: 65%; }

/* ── Slider ── */
.a11y-font-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.a11y-font-a.small { font-size: 12px; color: #666; }
.a11y-font-a.big   { font-size: 20px; font-weight: 700; color: #333; }

.a11y-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        #1a6fc4 0%, #1a6fc4 var(--pct, 25%),
        #d0dae8 var(--pct, 25%), #d0dae8 100%);
    outline: none;
    cursor: pointer;
}
.a11y-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #1a6fc4;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(26,111,196,0.3);
    cursor: pointer;
}
.a11y-range::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #1a6fc4;
    border: 2px solid #fff;
    cursor: pointer;
}

/* ── Tugma guruhlari ── */
.a11y-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.a11y-opt-btn {
    flex: 1;
    min-width: 55px;
    padding: 8px 5px;
    border: 1.5px solid #d0dae8;
    border-radius: 7px;
    background: #f4f7fb;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.a11y-opt-btn:hover { border-color: #1a6fc4; background: #e8f0fe; color: #1a6fc4; }
.a11y-opt-btn.active { border-color: #1a6fc4; background: #1a6fc4; color: #fff; }

.a11y-full-btn {
    width: 100%;
    padding: 9px;
    border: 1.5px solid #d0dae8;
    border-radius: 7px;
    background: #f4f7fb;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all 0.15s;
}
.a11y-full-btn:hover { border-color: #1a6fc4; background: #e8f0fe; color: #1a6fc4; }

/* ── Switch toggle ── */
.a11y-row-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0 !important;
}
.a11y-toggle-switch {
    position: relative;
    width: 40px; height: 22px;
    flex-shrink: 0;
}
.a11y-toggle-switch input { opacity: 0; width: 0; height: 0; }
.a11y-switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 22px;
    cursor: pointer;
    transition: 0.3s;
}
.a11y-switch-slider:before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.a11y-toggle-switch input:checked + .a11y-switch-slider { background: #1a6fc4; }
.a11y-toggle-switch input:checked + .a11y-switch-slider:before { transform: translateX(18px); }

/* ── Shortcut hint ── */
.a11y-shortcut-hint {
    margin-top: 8px;
    padding: 7px 10px;
    background: #f0f4fb;
    border-radius: 6px;
    font-size: 11px;
    color: #555;
    line-height: 1.5;
}
.a11y-shortcut-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #fff;
    border: 1px solid #bcc8dc;
    border-radius: 3px;
    font-size: 10px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin: 0 1px;
}

/* ── Reset ── */
.a11y-reset-row {
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #e8ecf0;
}
.a11y-reset-btn {
    width: 100%;
    padding: 10px;
    border: 1.5px solid #e0dbd0;
    border-radius: 8px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}
.a11y-reset-btn:hover { border-color: #dc3545; color: #dc3545; background: #fff5f5; }

/* ── Ovozli o'qish indicator ── */
.tb-voice-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border-radius: 40px;
    padding: 10px 18px;
    font-size: 13px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(96,165,250,0.2);
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}
.tb-voice-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: tbPulse 1.1s ease-in-out infinite;
}
@keyframes tbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.4); }
}
.tb-voice-stop-btn {
    padding: 4px 12px;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 20px;
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.tb-voice-stop-btn:hover { background: rgba(239,68,68,0.25); color: #fff; }

/* ================================================
   TUN REJIMI — body.a11y-dark
   ================================================ */
body.a11y-dark { background: #0f1724 !important; color: #e2e8f0 !important; }
body.a11y-dark .bg-color  { background: #0d2a4a !important; }
body.a11y-dark .use-inf   { background: #071630 !important; }
body.a11y-dark .footer    { background: #071630 !important; }
body.a11y-dark .card      { background: #1e2d42 !important; color: #e2e8f0 !important; }
body.a11y-dark .card h5,
body.a11y-dark .card p    { color: #c8d8ec !important; }
body.a11y-dark .news-h3   { color: #90c4f8 !important; }
body.a11y-dark .korsatgich { background: #071630 !important; }
body.a11y-dark #a11yOffcanvas { background: #1a2332 !important; }
body.a11y-dark .a11y-section  { background: #1e2d42 !important; border-color: #2a3d55 !important; }
body.a11y-dark .a11y-section-title { color: #e2e8f0 !important; }
body.a11y-dark .a11y-opt-btn   { background: #253449 !important; border-color: #2a3d55 !important; color: #aec6e8 !important; }
body.a11y-dark .a11y-opt-btn.active { background: #1a6fc4 !important; color: #fff !important; }
body.a11y-dark .a11y-full-btn  { background: #253449 !important; border-color: #2a3d55 !important; color: #aec6e8 !important; }
body.a11y-dark .a11y-reset-row { background: #1e2d42 !important; border-color: #2a3d55 !important; }
body.a11y-dark .a11y-reset-btn { color: #7a90a8 !important; border-color: #2a3d55 !important; }

/* ================================================
   YUQORI KONTRAST — body.a11y-contrast
   ================================================ */
body.a11y-contrast { background: #000 !important; color: #fff !important; }
body.a11y-contrast a { color: #FFD700 !important; text-decoration: underline !important; }
body.a11y-contrast .bg-color  { background: #111 !important; }
body.a11y-contrast .use-inf   { background: #000 !important; border-bottom: 2px solid #FFD700 !important; }
body.a11y-contrast .footer    { background: #111 !important; border-top: 2px solid #FFD700 !important; }
body.a11y-contrast .card      { background: #111 !important; border: 1px solid #FFD700 !important; }
body.a11y-contrast .card h5,
body.a11y-contrast .card p    { color: #fff !important; }
body.a11y-contrast .news-h3   { color: #FFD700 !important; }
body.a11y-contrast p          { font-size: 1.15rem !important; line-height: 1.8 !important; }
body.a11y-contrast .navbar_nav_a { color: #FFD700 !important; }
body.a11y-contrast #a11yOffcanvas  { background: #111 !important; }
body.a11y-contrast .a11y-oc-header { background: #1a1a00 !important; border-bottom: 2px solid #FFD700 !important; }
body.a11y-contrast .a11y-section   { background: #1a1a1a !important; border-color: #333 !important; }
body.a11y-contrast .a11y-section-title { color: #FFD700 !important; }
body.a11y-contrast .a11y-opt-btn   { background: #1a1a1a !important; border-color: #555 !important; color: #FFD700 !important; }
body.a11y-contrast .a11y-opt-btn.active { background: rgba(255,215,0,0.2) !important; border-color: #FFD700 !important; }

/* ── Responsive ── */
@media (max-width: 576px) {
    #a11yOffcanvas { width: 100% !important; max-width: 100vw !important; }
    .tb-voice-bar { font-size: 11px; padding: 8px 12px; gap: 7px; bottom: 60px; }
}