        :root {
            --primary: #1a9837;
            --primary-dark: #137a2c;
            --primary-light: #e6f7ea;
            --secondary: #2d3748;
            --secondary-light: #4a5568;
            --light: #f7fafc;
            --gray: #e2e8f0;
            --gray-dark: #cbd5e0;
            --error: #f56565;
            --error-light: #fed7d7;
            --correct: #48bb78;
            --correct-light: #c6f6d5;
            --warning: #ed8936;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --transition: all 0.2s ease-in-out;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
        }
        :lang(ar) {
            font-family: 'Noto Sans Arabic', sans-serif !important;
        }
        :lang(ur) {
            font-family: 'Noto Nastaliq Urdu', sans-serif !important;
        }
        body.arabic, body.arabic * {
            font-family: 'Noto Sans Arabic', sans-serif;
        }
        body.urdu, body.urdu * {
            font-family: 'Noto Nastaliq Urdu', sans-serif;
        }
        body {
            background-color: #f8f9fa;
            color: var(--secondary);
            min-height: 100vh;
            line-height: 1.6;
        }
        .app-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }
        body.rtl {
            direction: rtl;
        }
        body.rtl .app-container {
            text-align: right;
        }
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--gray);
        }
        .header-left h1 {
            color: var(--primary);
            font-size: 2rem;
            margin-bottom: 0.5rem;
            font-weight: 700;
        }
        .header-left p {
            color: var(--secondary-light);
            font-size: 0.9rem;
        }
        .user-info {
            display: flex;
            gap: 1rem;
            align-items: center;
        }
        body.rtl .user-info {
            flex-direction: row-reverse;
        }
        .logout-btn, .leaderboard-btn, .about-btn {
            background: none;
            border: none;
            color: var(--primary);
            cursor: pointer;
            text-decoration: underline;
            font-size: 1rem;
            transition: var(--transition);
        }
        .logout-btn:hover, .leaderboard-btn:hover, .about-btn:hover {
            color: var(--primary-dark);
        }
        .screen {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--shadow-md);
            padding: 2.5rem;
            margin-bottom: 2rem;
            display: none;
            animation: fadeIn 0.3s ease-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .screen.active {
            display: block;
        }
        .screen-title {
            color: var(--primary);
            margin-bottom: 1.5rem;
            text-align: center;
            font-size: 1.8rem;
            font-weight: 700;
        }
        .screen-description {
            text-align: center;
            color: var(--secondary-light);
            margin-bottom: 2rem;
            max-width: 700px;
            margin-left: auto;
            margin-right: auto;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--gray);
            border-radius: 8px;
            font-size: 1rem;
            transition: var(--transition);
        }
        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(26, 152, 55, 0.2);
        }
        .select-control {
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232d3748' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            padding-right: 2.5rem;
        }
        body.rtl .select-control {
            background-position: left 1rem center;
            padding-right: 1rem;
            padding-left: 2.5rem;
        }
        .btn {
            display: inline-flex;
            padding: 0.75rem 1.5rem;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: var(--transition);
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .btn-primary {
            background-color: var(--primary);
            color: white;
        }
        .btn-primary:hover {
            background-color: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }
        .btn-secondary {
            background-color: var(--gray);
            color: var(--secondary);
        }
        .btn-secondary:hover {
            background-color: var(--gray-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }
        .btn-group {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            flex-wrap: wrap;
        }
        body.rtl .btn-group {
            justify-content: flex-end;
        }
        .typing-display {
            font-size: 1.5rem;
            line-height: 1.6;
            padding: 1.5rem;
            background-color: var(--light);
            border-radius: 8px;
            margin-bottom: 1.5rem;
            min-height: 150px;
            border: 1px solid var(--gray);
            white-space: pre-wrap;
        }
        .arabic {
            direction: rtl;
            font-size: 1.2rem;
        }
        .urdu {
            direction: rtl;
            font-size: 1.2rem;
        }
        .typing-input {
            width: 100%;
            padding: 1rem;
            font-size: 1.2rem;
            border: 2px solid var(--gray);
            border-radius: 8px;
            transition: var(--transition);
        }
        .typing-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(26, 152, 55, 0.2);
        }
        .current-char {
            background-color: rgba(26, 152, 55, 0.2);
            border-radius: 2px;
            padding: 0 2px;
        }
        .correct-char {
            color: var(--correct);
        }
        .incorrect-char {
            color: var(--error);
            text-decoration: underline;
        }
        .error-suggestion {
            color: var(--error);
            font-size: 0.9rem;
            margin-top: 0.5rem;
            padding: 0.5rem;
            background-color: var(--error-light);
            border-radius: 4px;
            display: inline-block;
        }
        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin: 1.5rem 0;
        }
        .stat-card {
            background-color: white;
            border-radius: 8px;
            padding: 1.5rem;
            text-align: center;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        .stat-label {
            color: var(--secondary-light);
            font-size: 0.9rem;
        }
        .timer {
            font-size: 3rem;
            font-weight: 700;
            color: var(--primary);
            text-align: center;
            margin: 1.5rem 0;
            font-family: monospace;
        }
.certificate {
    background: white;
    border-radius: 16px;
    padding: 3rem 3rem 4rem;
    max-width: 820px;
    margin: 3rem auto;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: radial-gradient(circle at center, rgba(26,152,55,0.1) 0%, transparent 70%);
    color: #333;
    text-align: center;
}

.certificate::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid var(--primary);
    border-radius: 14px;
    pointer-events: none;
}

.logo-container {
    max-width: 150px;
    margin: 0 auto 2rem;
}

.logo-container img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.certificate-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.75rem;
}

.certificate-name {
    font-size: 2.25rem;
    margin: 1.5rem 0;
    padding: 1.2rem 0;
    border-top: 2px dashed #bbb;
    border-bottom: 2px dashed #bbb;
    color: var(--secondary);
    font-weight: 600;
}

.certificate-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.certificate-stat {
    background-color: var(--primary-light);
    padding: 1.25rem 1.75rem;
    border-radius: 10px;
    min-width: 140px;
    box-shadow: 0 4px 8px rgba(26,152,55,0.15);
    text-align: center;
}

.certificate-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.certificate-footer {
    margin-top: 3rem;
    color: var(--secondary-light);
    font-style: normal;
    font-size: 1rem;
}

body.rtl .certificate {
    text-align: center;
}

        .keyboard-container {
            margin: 1.5rem 0;
            direction: ltr;
            user-select: none;
        }
        .keyboard {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-width: 800px;
            margin: 0 auto;
            padding: 1rem;
            background-color: #f0f4f8;
            border-radius: 12px;
            box-shadow: var(--shadow-md);
        }
        .keyboard-row {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
        }
        .key {
            background-color: white;
            border: 1px solid var(--gray);
            border-radius: 6px;
            padding: 0.75rem 0.5rem;
            min-width: 40px;
            height: 50px;
            text-align: center;
            font-size: 1rem;
            color: var(--secondary);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            box-shadow: 0 2px 0 rgba(0,0,0,0.1);
        }
        .key::after {
            content: attr(data-finger);
            position: absolute;
            top: -20px;
            font-size: 0.7rem;
            color: var(--primary);
            opacity: 0;
            transition: opacity 0.2s;
            font-weight: 600;
        }
        .key.finger-highlight::after {
            opacity: 1;
        }
        .key.highlight {
            background-color: var(--correct);
            color: white;
            transform: translateY(2px);
            box-shadow: 0 0 0 rgba(0,0,0,0.1);
        }
        .key.error {
            background-color: var(--error);
            color: white;
            animation: shake 0.5s;
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-3px); }
            40%, 80% { transform: translateX(3px); }
        }
        .key.next-key {
            background-color: rgba(26, 152, 55, 0.2);
            color: var(--secondary);
            font-weight: bold;
        }
        .key.space {
            flex-grow: 1;
            min-width: 100px;
			max-width: 300px;
        }
        .key.special {
            background-color: var(--gray);
            font-size: 0.8rem;
        }
        .key.extra-wide {
            min-width: 60px;
        }
        .achievement {
            background-color: var(--light);
            padding: 1.5rem;
            border-radius: 8px;
            margin: 1.5rem 0;
            text-align: center;
            border-left: 4px solid var(--warning);
            box-shadow: var(--shadow-sm);
        }
        .achievement-icon {
            font-size: 2rem;
            color: var(--warning);
            margin-bottom: 0.5rem;
        }
        .achievement-title {
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            animation: fadeIn 0.3s;
        }
        .modal-content {
            background-color: white;
            border-radius: 12px;
            padding: 2rem;
            max-width: 800px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            position: relative;
        }
        .modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            cursor: pointer;
            font-size: 1.5rem;
            color: var(--secondary);
            background: none;
            border: none;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
        }
        .modal-close:hover {
            background-color: var(--gray);
        }
        body.rtl .modal-close {
            right: auto;
            left: 1rem;
        }
        .error-message {
            color: var(--error);
            font-size: 0.9rem;
            margin-top: 0.5rem;
            padding: 0.5rem;
            background-color: var(--error-light);
            border-radius: 4px;
            display: inline-block;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
            box-shadow: var(--shadow-sm);
            border-radius: 8px;
            overflow: hidden;
        }
        th, td {
            padding: 0.75rem 1rem;
            text-align: left;
            border-bottom: 1px solid var(--gray);
        }
        body.rtl th, body.rtl td {
            text-align: right;
        }
        th {
            background-color: var(--primary);
            color: white;
            font-weight: 600;
        }
        tr:nth-child(even) {
            background-color: var(--light);
        }
        tr:hover {
            background-color: var(--gray);
        }
        .about-section {
            background-color: white;
            border-radius: 12px;
            padding: 2rem;
            margin: 2rem 0;
            box-shadow: var(--shadow-sm);
        }
        .about-section h2 {
            color: var(--primary);
            margin-bottom: 1rem;
        }
        .about-section p {
            margin-bottom: 1rem;
            line-height: 1.7;
        }
        .feature-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin: 2rem 0;
        }
        .feature-card {
            background-color: var(--light);
            padding: 1.5rem;
            border-radius: 8px;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-md);
        }
        .feature-icon {
            font-size: 2rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }
        .feature-title {
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--secondary);
        }
        @media (max-width: 768px) {
            .app-container {
                padding: 1rem;
            }
            .app-header {
                flex-direction: column;
                gap: 1rem;
                text-align: center;
            }
            .user-info {
                flex-direction: column;
                gap: 0.5rem;
            }
            .screen {
                padding: 1.5rem;
            }
            .certificate {
                padding: 1.5rem;
            }
            .certificate-stats {
                flex-direction: column;
                align-items: center;
            }
            .keyboard {
                padding: 0.5rem;
            }
            .key {
                min-width: 30px;
                height: 40px;
                padding: 0.3rem;
                font-size: 0.9rem;
            }
            .key.space {
                min-width: 100px;
            }
            .btn-group {
                justify-content: center;
            }
            .typing-display {
                font-size: 1.2rem;
                padding: 1rem;
            }
            .arabic, .urdu {
                font-size: 1.5rem;
            }
        }
        @media (max-width: 480px) {
            .key {
                min-width: 25px;
                height: 35px;
                font-size: 0.8rem;
                padding: 0.2rem;
            }
            .key::after {
                top: -15px;
                font-size: 0.6rem;
            }
            .stat-card {
                padding: 1rem;
            }
            .stat-value {
                font-size: 1.5rem;
            }
        }
		
		.about-section {
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
