/**
 * Quiz Progress & Polish - F-030 Phase 4D
 *
 * Styles for:
 * - Completion badges (pending, partial, complete, skipped)
 * - Skip part buttons
 * - ARIA live regions (screen reader only)
 * - Focus styles for accessibility
 * - Progress indicators
 */

/* ==================== COMPLETION BADGES ==================== */

.part-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

/* Badge States */

.badge-pending {
    color: #9ca3af;
    background: transparent;
    border: 2px solid #d1d5db;
}

.badge-partial {
    color: #f59e0b;
    background: #fef3c7;
    border: 2px solid #f59e0b;
}

.badge-complete {
    color: #10b981;
    background: #d1fae5;
    border: 2px solid #10b981;
}

.badge-skipped {
    color: #6b7280;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    text-decoration: line-through;
    opacity: 0.7;
}

/* Badge animations */
.part-badge {
    animation: badge-appear 0.2s ease-out;
}

@keyframes badge-appear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Badge state transitions */
.badge-pending.badge-partial,
.badge-partial.badge-complete {
    animation: badge-update 0.3s ease-out;
}

@keyframes badge-update {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ==================== SKIP PART BUTTON ==================== */

.part-controls {
    margin-top: var(--space-md);
    display: flex;
    justify-content: flex-start;
}

.btn-skip-part {
    padding: var(--space-sm) var(--space-md);
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: #6b7280;
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-skip-part:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-skip-part:active {
    transform: translateY(1px);
}

.btn-skip-part:focus {
    outline: 3px solid #2563EB;
    outline-offset: 2px;
}

/* ==================== ARIA LIVE REGIONS ==================== */

/* Screen reader only (visually hidden but accessible) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.multi-part-announcer {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== FOCUS STYLES ==================== */

/* Enhanced focus for accessibility */
.multi-part-tab:focus {
    outline: 3px solid #2563EB;
    outline-offset: 2px;
    z-index: 10;
}

.btn-skip-part:focus-visible {
    outline: 3px solid #2563EB;
    outline-offset: 2px;
}

.multi-part-accordion-header:focus {
    outline: 3px solid #2563EB;
    outline-offset: 2px;
}

/* ==================== PROGRESS BAR ENHANCEMENTS ==================== */

.multi-part-progress {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 12px;
    position: relative;
}

/* Progress bar color states */
.progress-fill.progress-low {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-fill.progress-moderate {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-fill.progress-good {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Default (no state class) */
.progress-fill:not(.progress-low):not(.progress-moderate):not(.progress-good) {
    background: linear-gradient(90deg, #6b7280, #4b5563);
}

/* Progress bar shimmer animation */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.progress-text {
    margin-top: var(--space-sm);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {
    .part-badge {
        width: 20px;
        height: 20px;
        font-size: 12px;
        margin-right: 6px;
    }

    .btn-skip-part {
        width: 100%;
        text-align: center;
    }

    .progress-bar {
        height: 20px;
    }

    .progress-text {
        font-size: var(--font-xs);
    }
}

/* ==================== HIGH CONTRAST MODE ==================== */

@media (prefers-contrast: high) {
    .badge-pending {
        border-width: 3px;
    }

    .badge-partial {
        border-width: 3px;
    }

    .badge-complete {
        border-width: 3px;
    }

    .badge-skipped {
        border-width: 3px;
    }

    .btn-skip-part {
        border-width: 2px;
    }

    .multi-part-tab:focus,
    .btn-skip-part:focus,
    .multi-part-accordion-header:focus {
        outline-width: 4px;
    }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .part-badge,
    .progress-fill,
    .btn-skip-part {
        animation: none;
        transition: none;
    }

    .progress-fill::after {
        animation: none;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */

@media (prefers-color-scheme: dark) {
    .badge-pending {
        color: #9ca3af;
        border-color: #4b5563;
    }

    .badge-partial {
        color: #fbbf24;
        background: rgba(251, 191, 36, 0.2);
        border-color: #f59e0b;
    }

    .badge-complete {
        color: #34d399;
        background: rgba(52, 211, 153, 0.2);
        border-color: #10b981;
    }

    .badge-skipped {
        color: #9ca3af;
        background: rgba(156, 163, 175, 0.2);
        border-color: #6b7280;
    }

    .btn-skip-part {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .btn-skip-part:hover {
        background: #4b5563;
        border-color: #6b7280;
        color: #f3f4f6;
    }

    .progress-bar {
        background: #374151;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .btn-skip-part {
        display: none;
    }

    .part-badge {
        border: 1px solid #000;
        color: #000;
        background: transparent;
    }

    .progress-fill {
        background: #000 !important;
    }
}
