/**
 * Category Exercise Widget Styles
 * Mobile-first responsive design for speech therapy categorization exercises
 */

/* ====================== ROOT CONTAINER ====================== */
.category-exercise-root {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ====================== LOADING & ERROR STATES ====================== */
.category-exercise-root.loading,
.category-exercise-root.error {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-state {
    text-align: center;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state {
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.error-state h3 {
    margin-top: 0;
    color: #991b1b;
}

.retry-button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background: #b91c1c;
}

/* ====================== EXERCISE CONTENT ====================== */
.exercise-content {
    position: relative;
}

.exercise-header {
    text-align: center;
    margin-bottom: 24px;
}

.exercise-header h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
}

.progress-indicator {
    color: #6b7280;
    font-size: 14px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* Progress bar for matching exercise */
.progress-bar {
    position: relative;
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* ====================== SORTING EXERCISE ====================== */
.sorting-exercise {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.words-container {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: center;
}

.word-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 100px;
    max-width: 120px;
    position: relative;
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.word-item:active {
    cursor: grabbing;
    transform: rotate(2deg);
}

.word-item.draggable {
    user-select: none;
}

.word-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
}

.word-title {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: #374151;
    line-height: 1.2;
}

.audio-button {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.audio-button:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.1);
}

.audio-button.large {
    width: auto;
    height: auto;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    margin: 16px 0;
}

.all-sorted-message {
    text-align: center;
    color: #059669;
    font-weight: 500;
    padding: 20px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
    width: 100%;
}

.check-answers-button {
    background: #059669;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 12px;
    transition: background-color 0.2s;
}

.check-answers-button:hover {
    background: #047857;
}

/* ====================== CATEGORIES ====================== */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.category-bin {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    background: #f8fafc;
    transition: all 0.2s ease;
    min-height: 140px;
}

.category-bin:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.category-bin h4 {
    margin: 0 0 12px 0;
    text-align: center;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.drop-zone {
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: center;
}

.empty-drop-zone {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-style: italic;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #ffffff;
}

.dropped-word {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e0f2fe;
    border-radius: 16px;
    font-size: 14px;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.remove-button {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    font-weight: bold;
}

.remove-button:hover {
    background: #dc2626;
}

/* ====================== MOBILE TOUCH SUPPORT ====================== */

/* Selected word state for mobile tap mode */
.word-item.selected {
    background-color: #dbeafe !important;
    border-color: #3b82f6 !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

/* Dragging state for mobile touch drag */
.word-item.dragging {
    opacity: 0.8;
    transform: rotate(5deg);
    z-index: 1000;
    transition: none;
}

/* Category bin highlighting when in tap mode */
.category-bin.tap-target {
    background-color: #f0f9ff;
    border: 2px dashed #0284c7;
    animation: pulse 1s infinite;
}

/* Selection indicator for mobile */
.selected-indicator {
    animation: pop 0.3s ease-out;
}

/* Tap instruction styling */
.tap-instruction {
    animation: bounce 0.5s ease-in-out;
    font-weight: 500;
    color: #0284c7;
}

/* ====================== MATCHING EXERCISE ====================== */
.matching-exercise {
    text-align: center;
}

.word-display {
    padding: 40px 20px;
    margin-bottom: 30px;
    background: #f8fafc;
    border-radius: 12px;
}

.word-display .word-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 16px;
    display: block;
    background: #f3f4f6;
}

.word-display .word-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 16px 0;
}

.question-prompt {
    font-size: 1.25rem;
    color: #6b7280;
    margin: 20px 0 0 0;
}

.category-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.category-option {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-option:hover:not(:disabled) {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====================== FEEDBACK OVERLAY ====================== */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.feedback-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 20px;
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.feedback-overlay.correct .feedback-icon {
    color: #22c55e;
}

.feedback-overlay.incorrect .feedback-icon {
    color: #ef4444;
}

.feedback-message {
    font-size: 1.25rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

/* ====================== COMPLETION SCREEN ====================== */
.completion-screen {
    text-align: center;
    padding: 40px 20px;
}

.completion-content {
    max-width: 500px;
    margin: 0 auto;
}

.completion-content h2 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 30px;
}

.score-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.score-details {
    color: #6b7280;
    font-size: 1.1rem;
}

.completion-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.try-again-button,
.new-exercise-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 140px;
}

.try-again-button:hover,
.new-exercise-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.new-exercise-button {
    background: #059669;
}

.new-exercise-button:hover {
    background: #047857;
}

/* ====================== ANSWER REVIEW SCREEN ====================== */
.answer-review-screen {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.review-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.review-header h2 {
    color: #1f2937;
    font-size: 2rem;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.review-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
}

.review-categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.review-category-bin {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    min-height: 140px;
}

.review-category-title {
    margin: 0 0 16px 0;
    text-align: center;
    color: #374151;
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #d1d5db;
}

.review-category-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.review-empty-category {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    color: #9ca3af;
    font-style: italic;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #ffffff;
}

.review-word-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.review-word-item.correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.review-word-item.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: incorrectPulse 2s ease-in-out;
}

.review-word-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    flex-shrink: 0;
}

.review-word-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.review-feedback-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.review-word-item.correct .review-feedback-icon {
    color: #22c55e;
}

.review-word-item.incorrect .review-feedback-icon {
    color: #ef4444;
}

.correction-hint {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.correction-hint:before {
    content: '';
    position: absolute;
    top: -4px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #ef4444;
}

.review-summary {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #d1d5db;
}

.review-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.review-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-correct {
    color: #22c55e;
    border: 1px solid #a7f3d0;
}

.stat-incorrect {
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.stat-percentage {
    color: #3b82f6;
    border: 1px solid #93c5fd;
    font-weight: 700;
}

.review-actions {
    text-align: center;
}

.continue-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    min-width: 200px;
}

.continue-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.continue-button:active {
    transform: translateY(0);
}

/* ====================== ANIMATIONS ====================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes incorrectPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
    }
}

/* Animation for review screen entrance */
.category-exercise-root.review {
    animation: slideInFromRight 0.4s ease-out;
}

/* Enhanced incorrect word highlighting */
.review-word-item.incorrect {
    animation: incorrectPulse 2s ease-in-out;
}

/* ====================== RESPONSIVE DESIGN ====================== */
@media (max-width: 768px) {
    .category-exercise-root {
        padding: 16px;
        margin: 0;
        border-radius: 0;
    }

    .exercise-header h3 {
        font-size: 18px;
        text-align: center;
        margin-bottom: 15px;
        color: #374151;
    }

    .categories-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }

    .category-options {
        grid-template-columns: 1fr;
    }

    .word-item {
        min-height: 60px;
        padding: 15px;
        font-size: 16px;
        touch-action: none;
        border: 2px solid #e5e7eb;
        min-width: 80px;
        max-width: 100px;
    }

    .word-item img {
        width: 50px;
        height: 50px;
    }

    .word-title {
        font-size: 12px;
    }

    .category-bin {
        min-height: 120px;
        padding: 15px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
    }

    .drop-zone {
        min-height: 80px;
        padding: 10px;
        border-radius: 6px;
        border: 1px dashed #d1d5db;
    }

    .remove-button {
        min-width: 40px;
        min-height: 40px;
        font-size: 18px;
    }

    .audio-button {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }

    .words-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px;
        background: #f9fafb;
        border-radius: 8px;
    }

    .check-answers-button {
        min-height: 48px;
        padding: 12px 24px;
        font-size: 16px;
    }

    .all-sorted-message {
        padding: 20px;
        background: #f0fdf4;
        border: 2px dashed #22c55e;
        color: #166534;
    }

    .word-display .word-title {
        font-size: 1.5rem;
    }

    .word-display .word-image {
        width: 120px;
        height: 120px;
    }

    .completion-content h2 {
        font-size: 2rem;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-number {
        font-size: 1.5rem;
    }

    .completion-actions {
        flex-direction: column;
        align-items: center;
    }

    .try-again-button,
    .new-exercise-button {
        width: 100%;
        max-width: 250px;
    }

    .feedback-content {
        margin: 10px;
        padding: 30px 20px;
    }

    .feedback-icon {
        font-size: 3rem;
    }

    .feedback-message {
        font-size: 1.1rem;
    }

    /* Review screen mobile styles */
    .review-categories-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .review-header h2 {
        font-size: 1.75rem;
    }

    .review-subtitle {
        font-size: 1rem;
    }

    .review-stats {
        gap: 12px;
    }

    .review-stats span {
        font-size: 1rem;
        padding: 6px 12px;
    }

    .continue-button {
        width: 100%;
        max-width: 300px;
        font-size: 1rem;
        padding: 14px 24px;
    }

    .correction-hint {
        font-size: 11px;
        padding: 4px 6px;
    }

    .review-word-item {
        padding: 10px;
    }

    .review-word-image {
        width: 32px;
        height: 32px;
    }

    .review-feedback-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .words-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .word-item {
        min-height: 70px;
        font-size: 18px;
        padding: 8px;
        min-width: 70px;
        max-width: 85px;
    }

    .word-item img {
        width: 40px;
        height: 40px;
    }

    .audio-button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .category-bin {
        min-height: 140px;
        padding: 20px;
    }

    .dropped-word {
        padding: 6px 10px;
        font-size: 13px;
    }

    .answer-review-screen {
        padding: 16px;
    }

    .review-header {
        margin-bottom: 20px;
    }

    .review-category-bin {
        padding: 12px;
    }

    .review-word-item {
        gap: 8px;
        padding: 8px;
    }

    .review-word-title {
        font-size: 13px;
    }

    .review-stats {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .review-stats span {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .words-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .categories-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .word-item {
        min-height: 50px;
        padding: 12px;
    }
    
    .category-bin {
        min-height: 100px;
        padding: 12px;
    }
}

/* ====================== ACCESSIBILITY & PREFERENCES ====================== */

/* Focus styles for keyboard navigation */
.word-item:focus,
.category-option:focus,
.audio-button:focus,
.check-answers-button:focus,
.try-again-button:focus,
.new-exercise-button:focus,
.remove-button:focus,
.continue-button:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-exercise-root {
        border: 2px solid #000;
    }

    .word-item {
        border: 2px solid #000;
    }

    .category-bin {
        border: 2px solid #000;
    }

    .feedback-content {
        border: 2px solid #000;
    }

    .word-item.selected {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #fff !important;
    }
    
    .category-bin.tap-target {
        background-color: #fff;
        border-color: #000;
        color: #000;
    }
    
    .tap-instruction {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #fff !important;
    }

    .review-word-item.incorrect {
        border-color: #000;
        background: #ffeeee;
    }

    .review-word-item.correct {
        border-color: #000;
        background: #eeffee;
    }

    .correction-hint {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .word-item.selected,
    .word-item.dragging,
    .category-bin.tap-target,
    .tap-instruction,
    .selected-indicator,
    .remove-button,
    .audio-button,
    .check-answers-button,
    .category-exercise-root.review,
    .review-word-item.incorrect,
    .continue-button:hover {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .feedback-overlay,
    .audio-button,
    .completion-actions,
    .check-answers-button {
        display: none !important;
    }

    .category-exercise-root {
        box-shadow: none;
        background: white;
    }
}

/* Navigation Bar Styles - Add this to your category-exercise.css */

.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.nav-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    justify-content: center;
}

.nav-button:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.nav-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-button {
    background: #6b7280;
}

.back-button:hover:not(:disabled) {
    background: #4b5563;
}

.next-button {
    background: #059669;
}

.next-button:hover:not(:disabled) {
    background: #047857;
}

.nav-center {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
    text-align: center;
    flex: 1;
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .navigation-bar {
        padding: 12px 16px;
        margin-bottom: 16px;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .nav-center {
        font-size: 14px;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .navigation-bar {
        padding: 10px 12px;
    }
    
    .nav-button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .nav-center {
        font-size: 13px;
        margin: 0 8px;
    }
}

/* Ensure navigation doesn't interfere with other elements */
.category-exercise-root.loading .navigation-bar,
.category-exercise-root.error .navigation-bar,
.category-exercise-root.review .navigation-bar {
    position: relative; /* Not sticky on special screens */
}

/* Focus styles for accessibility */
.nav-button:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced Category Exercise Widget Styles */

/* ===== NAVIGATION BAR ENHANCEMENTS ===== */
.navigation-bar.enhanced {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 12px 12px 0 0;
    position: relative;
    z-index: 100;
}

.nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-stats {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.nav-button {
    padding: 10px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-button:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.nav-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== DIFFICULTY SELECTOR ===== */
.difficulty-toggle-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.difficulty-toggle-button:hover:not(:disabled) {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.difficulty-selector-panel {
    position: absolute;
    top: 100%;
    right: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 280px;
    z-index: 1000;
    animation: slideInDown 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.difficulty-selector-panel h4 {
    margin: 0 0 16px 0;
    color: #334155;
    font-size: 1.1rem;
    font-weight: 700;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.difficulty-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.difficulty-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.difficulty-option.active {
    border-color: #3b82f6;
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.difficulty-label {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.difficulty-description {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.close-selector-button {
    width: 100%;
    padding: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-selector-button:hover {
    background: #e2e8f0;
}

/* ===== ENHANCED LOADING STATE ===== */
.loading-state.enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 0 0 12px 12px;
}

.loading-state.enhanced h3 {
    margin: 20px 0 8px 0;
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 700;
}

.loading-state.enhanced p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 20px;
    max-width: 400px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-dots {
    font-size: 1.5rem;
    letter-spacing: 8px;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== ENHANCED ERROR STATE ===== */
.error-state.enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 0 0 12px 12px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: shake 0.5s ease-in-out;
}

.error-state.enhanced h3 {
    color: #dc2626;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-message {
    color: #7f1d1d;
    font-size: 1rem;
    margin-bottom: 24px;
    max-width: 500px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.retry-button {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.retry-button.primary {
    background: #dc2626;
    color: white;
}

.retry-button.primary:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.retry-button.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.retry-button.secondary:hover {
    background: #e5e7eb;
}

.retry-button.tertiary {
    background: transparent;
    color: #6b7280;
    border: 1px dashed #d1d5db;
}

.retry-button.tertiary:hover {
    background: #f9fafb;
    border-style: solid;
}

/* ===== ENHANCED EXERCISE CONTENT ===== */
.exercise-content.enhanced {
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 600px;
    border-radius: 0 0 12px 12px;
}

.sorting-exercise.enhanced {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.exercise-header {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.exercise-header h3 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 700;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

/* ===== ENHANCED WORDS CONTAINER ===== */
.words-container.enhanced {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    min-height: 120px;
}

.words-container.mobile {
    gap: 12px;
    padding: 20px;
}

.word-item.draggable {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 120px;
    max-width: 160px;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.word-item.draggable:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.word-item.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.word-item.dragging {
    opacity: 0.9;
    transform: rotate(5deg) scale(1.1);
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.word-item.touch-dragging {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.word-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.word-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 8px;
}

.audio-button {
    padding: 6px 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.audio-button:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.audio-button.loading {
    background: #6b7280;
    animation: pulse 1.5s ease-in-out infinite;
}

.selected-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.all-sorted-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 12px;
    border: 2px dashed #10b981;
}

.completion-message {
    font-size: 1.3rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 16px;
}

.check-answers-button {
    padding: 14px 28px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.check-answers-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* ===== ENHANCED CATEGORIES CONTAINER ===== */
.categories-container.enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.categories-container.mobile {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
}

.category-bin {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
}

.category-bin:hover {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.category-bin.tap-target {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.category-bin.has-words {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.category-bin.empty {
    border-style: dashed;
    opacity: 0.7;
}

.category-title {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.drop-zone {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.drop-zone.touch-hover {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    animation: pulse 1s ease-in-out infinite;
}

.tap-instruction {
    padding: 12px;
    background: #e0f2fe;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0369a1;
    text-align: center;
    border: 2px dashed #0284c7;
    font-weight: 600;
    animation: bounce 2s ease-in-out infinite;
}

.word-count {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.dropped-word {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.remove-button {
    padding: 2px 6px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.remove-button:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.empty-drop-zone {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

/* ===== ENHANCED REVIEW SCREEN ===== */
.answer-review-screen.enhanced {
    padding: 32px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 12px 12px;
}

.review-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.review-header.excellent {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
}

.review-header.good {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
}

.review-header.fair {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

.review-header.needs-improvement {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
}

.review-header h2 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent);
    border-radius: 50%;
}

.percentage {
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

.score {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    z-index: 1;
}

.performance-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-badge.excellent {
    background: #10b981;
    color: white;
}

.performance-badge.good {
    background: #3b82f6;
    color: white;
}

.performance-badge.fair {
    background: #f59e0b;
    color: white;
}

.performance-badge.needs-improvement {
    background: #ef4444;
    color: white;
}

.review-subtitle {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.review-categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.review-category-bin {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.review-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.review-category-title {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
}

.category-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 12px;
}

.review-category-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-word-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.review-word-item.correct {
    background: #ecfdf5;
    border: 1px solid #10b981;
}

.review-word-item.incorrect {
    background: #fef2f2;
    border: 1px solid #ef4444;
}

.review-word-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.word-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.review-word-title {
    font-weight: 600;
    color: #1e293b;
}

.feedback-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.feedback-icon.correct {
    color: #10b981;
}

.feedback-icon.incorrect {
    color: #ef4444;
}

.correction-hint {
    font-size: 0.8rem;
    color: #7f1d1d;
    font-weight: 600;
    background: #fee2e2;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.review-empty-category {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.review-summary {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.review-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px;
    border-radius: 8px;
    min-width: 80px;
}

.stat-item.correct {
    background: #ecfdf5;
    color: #059669;
}

.stat-item.incorrect {
    background: #fef2f2;
    color: #dc2626;
}

.stat-item.difficulty {
    background: #f1f5f9;
    color: #475569;
}

.stat-item span:first-child {
    font-size: 1.5rem;
}

.stat-item span:last-child {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item span:nth-child(2) {
    font-size: 1.5rem;
    font-weight: 800;
}

.session-progress {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.session-progress h5 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
}

.session-progress p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.completion-actions.enhanced {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-button {
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.action-button.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.action-button.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.action-button.secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.action-button.tertiary {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.action-button.tertiary:hover {
    background: #f9fafb;
    color: #374151;
}

/* ===== ENHANCED FEEDBACK OVERLAY ===== */
.feedback-overlay.enhanced {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.feedback-overlay.enhanced .feedback-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    animation: scaleIn 0.3s ease forwards;
}

.feedback-overlay.correct .feedback-content {
    border: 3px solid #10b981;
}

.feedback-overlay.incorrect .feedback-content {
    border: 3px solid #ef4444;
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.feedback-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.5;
}

.feedback-percentage {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
}

/* ===== NOTIFICATION SYSTEM ===== */
.exercise-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .navigation-bar.enhanced {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-center {
        order: 1;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .difficulty-selector-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        width: 90%;
        max-width: 350px;
    }
    
    .exercise-content.enhanced {
        padding: 16px;
    }
    
    .words-container.enhanced {
        padding: 16px;
        gap: 12px;
    }
    
    .word-item.draggable {
        min-width: 100px;
        max-width: 140px;
        padding: 12px;
    }
    
    .categories-container.enhanced {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    .review-stats {
        flex-direction: column;
        gap: 16px;
    }
    
    .completion-actions.enhanced {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .word-item.draggable {
        min-width: 80px;
        max-width: 120px;
        padding: 10px;
    }
    
    .word-image {
        width: 50px;
        height: 50px;
    }
    
    .word-title {
        font-size: 0.8rem;
    }
    
    .category-bin {
        padding: 12px;
        min-height: 120px;
    }
    
    .review-categories-container {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.word-item.draggable:focus,
.category-bin:focus,
.action-button:focus,
.audio-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .word-item.draggable {
        border-width: 3px;
    }
    
    .category-bin {
        border-width: 3px;
    }
    
    .feedback-overlay.enhanced .feedback-content {
        border-width: 4px;
    }
}