/* ================================================
   ERİŞİLEBİLİRLİK CSS - SUQUIZ
   Skip links, screen reader only, focus styles
   ================================================ */

/* ========== SKIP LINK ========== */
.skip-link {
    position: absolute;
    top: -60px;
    left: 10px;
    z-index: 10000;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease;
}

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

/* ========== LOGO BUTTON ========== */
button.logo {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: auto;
    display: block;
}

button.logo:hover { opacity: 0.8; }

button.logo:focus {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    border-radius: 8px;
}

/* ========== MENU CARD BUTTON ========== */
button.menu-card {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

button.menu-card * { pointer-events: none; }

button.menu-card span.btn-primary {
    display: inline-block;
    pointer-events: none;
}

/* ========== CATEGORY CARD BUTTON ========== */
button.category-card {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: center;
    display: block;
}

button.category-card * { pointer-events: none; }

/* ========== ÖN İZLEME SORULARI ========== */
.onizleme-soru-item {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.onizleme-soru-item:focus {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.onizleme-soru-item:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

.preview-question-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-question-item:focus {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.preview-question-item:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

/* ========== SCREEN READER ONLY ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== FOCUS STYLES (DAHA BELIRGIN) ========== */
/* ✅ :not([disabled]) ile devre dışı elementlerde focus halkası gösterilmez */
*:focus:not([disabled]) {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

button:focus:not([disabled]),
a:focus:not([disabled]),
input:focus:not([disabled]),
textarea:focus:not([disabled]),
select:focus:not([disabled]) {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.sik-item:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.mini-card:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal button:focus,
.qr-modal button:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.image-positioner-modal button:focus,
.modal-close:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.modal.active,
.qr-modal.active,
.image-positioner-modal.active {
    z-index: 9999;
}

/* ========== YÜKSEK KONTRAST MODU ========== */
@media (prefers-contrast: high) {
    .sik-item { border: 2px solid #000; }
    .sik-item.selected { border-width: 3px; background: #000; color: #fff; }
    .mini-card { border: 2px solid #000; }
    .btn { border: 2px solid currentColor; }
}

/* ========== AZALTILMIŞ HAREKET MODU ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.3s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.15s !important;
    }

    .final-playing-card,
    .second-playing-card {
        transition-duration: 0.4s !important;
    }

    /* Sadece body'e doğrudan eklenen confetti canvas'larını gizle (diğer canvas'ları etkilemez) */
    body > canvas { display: none !important; }

    .fade-in,
    .fade-out { animation-duration: 0.2s !important; }
}

/* ========== KLAVYE NAVİGASYONU İYİLEŞTİRMELERİ ========== */
.menu-card:focus-visible,
.category-card:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

input[type="radio"]:focus + span {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.option-radio:focus + .option-label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ========== ARIA LIVE REGION STİLLERİ ========== */
[aria-live="polite"],
[aria-live="assertive"] {
    position: relative;
}

.timer-text[aria-live="assertive"] {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== MODAL ODAK TUZAĞI GÖSTERGESİ ========== */
.modal[aria-modal="true"],
.qr-modal[aria-modal="true"] {
    isolation: isolate;
}

/* ========== ERİŞİLEBİLİRLİK İPUCU BANNER ========== */
.accessibility-hint {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.accessibility-hint-icon { font-size: 20px; }

/* ========== TOUCH TARGET BOYUTLARI (Minimum 44x44px) ========== */
@media (hover: none) and (pointer: coarse) {
    button, a, .sik-item, .mini-card {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========== DARK MODE DESTEĞİ ========== */
@media (prefers-color-scheme: dark) {
    .skip-link { background: #fff; color: #000; }
    .skip-link:focus { outline-color: #fbbf24; }
}

/* ========== ZOOM DESTEĞİ ========== */
@media (min-width: 1920px) {
    html { font-size: 18px; }
}

@media (max-width: 768px) {
    html { font-size: 16px; }
}

/* ========== ERROR MESSAGES İYİLEŞTİRMELERİ ========== */
[role="alert"] {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ========== LOADING STATE ========== */
[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* ========== SORU GÖRSELİ ERİŞİLEBİLİRLİK ========== */
.soru-image img,
figure img {
    max-width: 100%;
    height: auto;
}

.soru-image[style*="display: none"] + .soru-body {
    margin-top: 0;
}

/* ========== PROGRESS BAR ERİŞİLEBİLİRLİK ========== */
/* ✅ ::after yüzde metni kaldırıldı — adım numarasını "3%" olarak gösteriyordu */
[role="progressbar"] { position: relative; }

/* ========== BUTON DİSABLED STATES ========== */
button:disabled,
button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

button:disabled:focus {
    outline: none;
    box-shadow: none;
}

/* ========== FORM VALIDATION STATES ========== */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: #ef4444;
    background-color: #fef2f2;
}

input[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
    outline-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ========== SUCCESS STATES ========== */
input[aria-invalid="false"].has-success,
textarea[aria-invalid="false"].has-success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* ========== RESPONSIVE TYPOGRAPHY ========== */
@media (max-width: 640px) {
    .skip-link { font-size: 16px; }
}

/* ========== KLAVYE İLE SORU TAŞIMA BUTONLARI ========== */
.question-move-controls {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.preview-question-item:hover .question-move-controls,
.preview-question-item:focus-within .question-move-controls,
.onizleme-soru-item:hover .question-move-controls,
.onizleme-soru-item:focus-within .question-move-controls {
    opacity: 1;
}

.btn-move-question {
    background: #3b82f6;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-move-question:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.1);
}

.btn-move-question:focus {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

.btn-move-question:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-move-question:disabled:hover { transform: none; }

@media (max-width: 768px) {
    .question-move-controls { opacity: 1; }
    .btn-move-question { width: 36px; height: 36px; font-size: 18px; }
}

.preview-question-item,
.onizleme-soru-item {
    padding-right: 80px;
    position: relative;
}