/* The full CSS code from your snippet goes here. */
/* I have copied it exactly as you provided it. */

/* Hide download button by default */
#frq_urdu_download_report_btn {
    display: none;
}

/* Enhanced difficulty display in results */
.frq_urdu_typing_difficulty_display {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.1);
    padding: 15px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    color: #FFD93D;
    border: 1px solid rgba(255,255,255,0.2);
    direction: ltr; /* English UI element */
}
.frq_urdu_typing_difficulty_display strong {
    color: #fff;
    margin-right: 8px;
    margin-left: 0;
}

/* Main container */
.frq_urdu_typing_container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Primary font for English UI */
    color: #fff;
    position: relative;
    overflow: hidden;
    direction: ltr; /* Overall LTR direction for English UI */
    text-align: left; /* Overall LTR alignment for English UI */
}

/* Background pattern */
.frq_urdu_typing_container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.frq_urdu_typing_header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.frq_urdu_typing_title {
    font-size: 2.8em;
    margin: 0 0 12px 0;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #FFD93D, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.frq_urdu_typing_subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

.frq_urdu_typing_controls {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 35px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.frq_urdu_typing_control_group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.15);
    padding: 12px 18px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.frq_urdu_typing_control_group:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.frq_urdu_typing_control_group label {
    font-weight: 600;
    font-size: 0.95em;
}

.frq_urdu_typing_select {
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.95);
    color: #333;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    direction: ltr; /* Ensure LTR for select box */
    text-align: left; /* Ensure LTR for select box */
}

.frq_urdu_typing_select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,217,61,0.3);
    transform: scale(1.02);
}

.frq_urdu_typing_btn {
    padding: 14px 28px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.05em;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
    position: relative;
    overflow: hidden;
}

.frq_urdu_typing_btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.frq_urdu_typing_btn:hover::before {
    left: 100%;
}

.frq_urdu_typing_btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255,107,107,0.4);
}

.frq_urdu_typing_btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.frq_urdu_typing_stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.frq_urdu_typing_stat {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 18px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    flex: 1;
    min-width: 130px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.frq_urdu_typing_stat:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.2);
}

.frq_urdu_typing_stat_value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #FFD93D;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.frq_urdu_typing_stat_label {
    font-size: 0.9em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.frq_urdu_typing_progress {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.frq_urdu_typing_progress_bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #FFD93D);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.frq_urdu_typing_progress_bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.2) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.2) 75%);
    background-size: 20px 20px;
    animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
    from { background-position: 0 0; }
    to { background-position: 20px 0; }
}

/* Text display area - FIXED FOR URDU */
.frq_urdu_typing_text_display {
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    font-size: 1.6em;
    line-height: 2.2;
    font-family: 'Noto Nastaliq Urdu', serif !important;
    font-weight: 500;
    box-shadow: inset 0 3px 15px rgba(0,0,0,0.1), 0 5px 20px rgba(0,0,0,0.1);
    height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    align-items: flex-start;
    align-content: flex-start;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(255,255,255,0.3);
    direction: rtl !important; /* RTL for Urdu words display */
    text-align: right !important; /* Right align for Urdu words display */
    unicode-bidi: embed;
}

/* Instruction text for when no words are loaded */
.frq_urdu_typing_instruction {
    font-family: 'Noto Nastaliq Urdu', serif !important;
    font-size: 1.2em;
    color: #666;
    text-align: center;
    width: 100%;
    direction: rtl;
}

/* Individual word styling - FIXED FOR URDU */
.frq_urdu_typing_word {
    display: inline-flex;
    white-space: nowrap;
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: 'Noto Nastaliq Urdu', serif !important; /* Explicitly apply Noto Naskh Arabic */
    direction: rtl;
    unicode-bidi: embed;
    text-align: right;
    font-size: 1em;
}

.frq_urdu_typing_word.correct {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 2px 4px rgba(76,175,80,0.3);
}

.frq_urdu_typing_word.incorrect {
    background-color: #f44336;
    color: white;
    box-shadow: 0 2px 4px rgba(244,67,54,0.3);
}

.frq_urdu_typing_word.current {
    background-color: #2196F3;
    color: white;
    animation: frq_urdu_typing_pulse 1.5s infinite;
    box-shadow: 0 3px 8px rgba(33,150,243,0.4);
    transform: scale(1.05);
}

@keyframes frq_urdu_typing_pulse {
    0%, 100% { opacity: 1; box-shadow: 0 3px 8px rgba(33,150,243,0.4); }
    50% { opacity: 0.7; box-shadow: 0 5px 15px rgba(33,150,243,0.6); }
}

.frq_urdu_typing_input_section {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

/* Input area - FIXED FOR URDU */
.frq_urdu_typing_input_area {
    width: 100%;
    padding: 25px;
    border: none;
    border-radius: 20px;
    font-size: 5m;
    font-family: 'Noto Nastaliq Urdu', serif !important; /* Noto Naskh Arabic for Urdu input */
    font-weight: 500;
    background: rgba(255,255,255,0.95);
    color: #333;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    resize: none;
    outline: none;
    min-height: 70px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
    direction: rtl !important; /* RTL for Urdu input */
    text-align: right !important; /* Right align for Urdu input */
    unicode-bidi: embed;
}

.frq_urdu_typing_input_area:focus {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2), 0 0 0 3px rgba(255,217,61,0.3);
    transform: scale(1.01);
}

.frq_urdu_typing_input_area::placeholder {
    color: #666;
    font-style: italic;
    text-align: right; /* Placeholder text should be LTR */
    direction: rtl; /* Placeholder text should be LTR */
}

.frq_urdu_typing_results {
    background: rgba(255,255,255,0.15);
    padding: 30px;
    border-radius: 20px;
    margin-top: 25px;
    backdrop-filter: blur(10px);
    display: none;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    direction: ltr; /* Ensure LTR for English UI */
    text-align: left; /* Ensure LTR for English UI */
}

.frq_urdu_typing_results.show {
    display: block;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frq_urdu_typing_results h3 {
    margin: 0 0 25px 0;
    font-size: 1.8em;
    text-align: center;
    color: #FFD93D;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.frq_urdu_typing_result_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.frq_urdu_typing_result_item {
    background: rgba(255,255,255,0.15);
    padding: 18px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.frq_urdu_typing_result_item:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.2);
}

.frq_urdu_typing_result_item strong {
    display: block;
    font-size: 1.5em;
    color: #FFD93D;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.frq_urdu_typing_mistakes {
    margin-top: 25px;
    padding: 25px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    direction: rtl; /* Mistake section itself is RTL for word flow */
    text-align: right; /* Mistake section itself is RTL for word flow */
}

.frq_urdu_typing_mistakes h4 {
    margin: 0 0 18px 0;
    color: #FF6B6B;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    direction: ltr; /* "Words to practice" label is English/LTR */
    text-align: left; /* "Words to practice" label is English/LTR */
}

.frq_urdu_typing_mistake_words {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start; /* Align words to left for RTL flow */
    direction: rtl; /* Ensure the words themselves flow RTL */
}

/* Mistake words - FIXED FOR URDU */
.frq_urdu_typing_mistake_word {
    background: #FF6B6B;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    font-family: 'Noto Nastaliq Urdu', serif !important; /* Noto Naskh Arabic for Urdu mistake words */
    font-weight: bold;
    font-size: 1em;
    box-shadow: 0 3px 8px rgba(255,107,107,0.3);
    transition: all 0.2s ease;
    direction: rtl;
    unicode-bidi: embed;
}

.frq_urdu_typing_mistake_word:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .frq_urdu_typing_container {
        margin: 15px;
        padding: 25px;
    }
    
    .frq_urdu_typing_title {
        font-size: 2.2em;
    }
    
    .frq_urdu_typing_controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .frq_urdu_typing_control_group {
        width: 100%;
        justify-content: center;
    }
    
    .frq_urdu_typing_stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .frq_urdu_typing_text_display {
        height: 180px;
        font-size: 1.2em;
        padding: 20px;
    }

    .frq_urdu_typing_input_area {
        font-size: 1.1em;
        padding: 20px;
    }

    .frq_urdu_typing_result_grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Custom time input styling */
.frq_urdu_typing_select[type="number"] {
    width: 80px;
    text-align: center;
}

#frq_urdu_custom_time_group {
    transition: all 0.3s ease;
}

/* Enhanced download button */
#frq_urdu_download_report_btn {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    font-size: 1.1em;
    padding: 15px 30px;
    border-radius: 15px;
    margin-top: 20px;
    width: 100%;
    box-shadow: 0 8px 20px rgba(76,175,80,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#frq_urdu_download_report_btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#frq_urdu_download_report_btn:hover::before {
    left: 100%;
}

#frq_urdu_download_report_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255,107,107,0.4);
}

/* Scrollbar styling for webkit browsers */
.frq_urdu_typing_text_display::-webkit-scrollbar {
    width: 8px;
}

.frq_urdu_typing_text_display::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.frq_urdu_typing_text_display::-webkit-scrollbar-thumb {
    background: rgba(102,126,234,0.6);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.frq_urdu_typing_text_display::-webkit-scrollbar-thumb:hover {
    background: rgba(102,126,234,0.8);
}

/* Loading animation for better UX */
.frq_urdu_typing_loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #FFD93D;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip styles for better user guidance */
.frq_urdu_typing_tooltip {
    position: relative;
    cursor: help;
}

.frq_urdu_typing_tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.frq_urdu_typing_tooltip:hover::after {
    opacity: 1;
}

/* Enhanced focus states for accessibility */
.frq_urdu_typing_btn:focus,
.frq_urdu_typing_select:focus,
.frq_urdu_typing_input_area:focus {
    outline: 3px solid rgba(255,217,61,0.5);
    outline-offset: 2px;
}

/* Print styles for report generation */
@media print {
    .frq_urdu_typing_container {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .frq_urdu_typing_results {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
    }
}