:root {
    /* Color Palette */
    --primary: #0d9488;          /* Rich Teal */
    --primary-light: #ccfbf1;    /* Light Teal */
    --primary-dark: #115e59;     /* Dark Teal */
    --secondary: #0f172a;        /* Slate Dark */
    --secondary-light: #334155;  /* Slate Medium */
    --bg-light: #f8fafc;         /* Off-white */
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    
    /* Semantic Colors */
    --success: #10b981;          /* Emerald Green */
    --success-bg: #ecfdf5;
    --error: #ef4444;            /* Soft Crimson */
    --error-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-dark: #b45309;     /* Deep amber warning color */
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.09);
    
    /* Layout Rules */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", Arial, sans-serif;
}

/* Accessibility Skip-to-Content Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: top 0.2s ease;
}

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

/* Screen reader utility class */
.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;
}

/* Standard focus ring outline for keyboard users */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}


/* Base resets & styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--secondary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button, input, textarea {
    font-family: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition);
}

/* Header & Navigation */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo span {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--secondary-light);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Nav Dropdown styles */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.dropdown-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    list-style: none;
    min-width: 190px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--secondary-light);
    text-align: left;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Hover behaviors for Desktop screens */
@media (min-width: 769px) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    .nav-dropdown:hover .dropdown-caret {
        transform: rotate(180deg);
    }
}

/* Mobile responsive navigation overrides for Dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--border-color);
        padding: 0 0 0 1rem;
        background-color: transparent;
        display: none;
        opacity: 1;
        visibility: visible;
        min-width: unset;
        transition: none;
    }
    
    .dropdown-menu a {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .nav-dropdown.show .dropdown-menu {
        display: block;
    }
    
    .nav-dropdown.show .dropdown-caret {
        transform: rotate(180deg);
    }
}

/* Hero Section */
.hero {
    background: radial-gradient(circle at top right, var(--primary-light) 0%, transparent 60%);
    padding: 4rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-light);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
    transform: translateY(0);
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

/* AdSense Placeholders */
.ad-container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.ad-box {
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 90px;
    transition: var(--transition);
}

.ad-box::before {
    content: "Advertisement";
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ad-sidebar {
    position: sticky;
    top: 5rem;
    min-height: 600px;
}

/* Custom Ad Fallback Styles */
.custom-ad-fallback {
    width: 100%;
    height: 100%;
    display: none; /* Controlled dynamically by JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: adFadeIn 0.5s ease-out;
}

.custom-ad-fallback a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.custom-ad-fallback a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fallback-ad-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    filter: brightness(0.95);
    object-fit: cover;
}

.custom-ad-fallback a:hover .fallback-ad-img {
    filter: brightness(1.02);
    transform: scale(1.015);
}

/* Specific styling for sidebar vertical ad fallback */
.ad-sidebar .custom-ad-fallback {
    height: auto;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-sidebar .fallback-ad-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
}

/* Hide ad placeholder decoration when showing fallback */
.ad-box.showing-fallback {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    min-height: auto !important;
    height: auto !important; /* Collapse height nicely */
}

/* Dynamic height adjustment for fallback container */
.ad-sidebar:has(.showing-fallback) {
    min-height: auto !important;
    overflow: hidden;
}

.ad-box.showing-fallback::before {
    display: none !important;
}

@keyframes adFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}


/* Layout Main Content */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 3fr 1fr;
    }
}

.test-container {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Test Controllers (Modes) */
.mode-selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
}

.mode-group {
    flex: 1;
    min-width: 250px;
}

.mode-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-light);
    margin-bottom: 0.75rem;
}

.duration-buttons, .page-buttons, .drill-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-light);
}

.mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mode-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

/* Stats Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-card.active-stat::after {
    background-color: var(--primary);
}

.stat-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
}

.stat-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--secondary-light);
    margin-top: 0.25rem;
}

/* Typing Interface */
.display-text-container {
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
}

.display-text-container:focus-within {
    border-color: var(--primary);
}

/* Nastaliq text style */
.typing-paragraph {
    direction: rtl;
    font-family: var(--font-urdu);
    font-size: 1.8rem;
    line-height: 2.3;
    text-align: justify;
    color: var(--secondary-light);
    word-break: break-word;
    user-select: none;
}

/* Word Highlights */
.word {
    position: relative;
    border-bottom: 2px solid transparent;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
    display: inline-block;
    white-space: nowrap;
}

.word.correct {
    color: var(--primary-dark);
    background-color: var(--success-bg);
}

.word.incorrect {
    color: var(--error);
    background-color: var(--error-bg);
    border-bottom: 2px dashed var(--error);
}

.word.current {
    background-color: var(--primary-light);
    border-bottom: 2px solid var(--primary);
    animation: cursorBlink 1s infinite alternate;
}

.word.incorrect-active {
    border-bottom: 2px dashed var(--error);
    background-color: var(--error-bg);
}

@keyframes cursorBlink {
    0% { border-bottom-color: var(--primary); }
    100% { border-bottom-color: transparent; }
}

/* Textarea input wrapper */
.input-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.typing-input {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-urdu);
    font-size: 1.6rem;
    line-height: 2;
    direction: rtl;
    resize: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.typing-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.typing-input:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
}

/* Typing Controls Buttons */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.ctrl-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--bg-light);
}

.ctrl-btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.ctrl-btn-primary:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
}

.font-size-adjuster {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-size-adjuster span {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--secondary-light);
}

.font-size-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-color: var(--card-bg);
}

.font-size-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Results Section styling */
.results-modal {
    margin-top: 2rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-light) 100%);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: none;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.results-badge {
    display: inline-block;
    padding: 0.25rem 1.25rem;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 50px;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.results-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .results-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.res-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.res-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.res-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-light);
    text-transform: uppercase;
}

.performance-msg {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-light);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

/* Sidebar Dashboard (Highscores) */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: padding var(--transition);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Stats Grid Layout */
.highscore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    align-items: stretch;
}

.highscore-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
    height: 100%;
    box-sizing: border-box;
    transition: var(--transition);
}

.highscore-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.highscore-card .highscore-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--secondary-light);
    display: block;
}

.highscore-card .highscore-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: block;
    margin-top: auto;
}

@media (max-width: 1200px) and (min-width: 1024px) {
    .sidebar-card {
        padding: 0.85rem;
    }
    .sidebar-title {
        font-size: 1rem;
        gap: 0.35rem;
    }
    .highscore-grid {
        gap: 0.5rem;
    }
    .highscore-card {
        padding: 0.5rem 0.35rem;
    }
    .highscore-card .highscore-lbl {
        font-size: 0.65rem;
    }
    .highscore-card .highscore-val {
        font-size: 0.95rem;
    }
}

/* Dynamic virtual keyboard panel hint */
.keyboard-hint {
    margin-top: 1rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.85rem;
    color: #1e40af;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.keyboard-hint-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* SEO content below tools */
.seo-section {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

.seo-section h2 {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-weight: 800;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
}

.seo-section h3 {
    font-size: 1.3rem;
    color: var(--secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.seo-section p {
    color: var(--secondary-light);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.seo-section ul, .seo-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-light);
}

.seo-section li {
    margin-bottom: 0.5rem;
}

/* Table styling */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.seo-table th, .seo-table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.seo-table th {
    background-color: var(--bg-light);
    font-weight: 700;
}

/* FAQs Accordion styling */
.faq-container {
    margin-top: 1.5rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-light);
    font-weight: 700;
    font-size: 1rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    content: '-';
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    background-color: #ffffff;
}

.faq-item.active .faq-answer {
    padding: 1rem;
    max-height: 200px;
    border-top: 1px solid var(--border-color);
}

/* Footer Section */
footer {
    background-color: var(--secondary);
    color: #94a3b8;
    padding: 4rem 1.5rem 2rem;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.footer-logo h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 !important;
}

.footer-info h3 {
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.85rem;
}

/* Mobile responsive menu overrides */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        box-shadow: var(--shadow-md);
        display: none;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
}

/* Generic Info Layout (About, Keyboard, Tips etc.) */
.content-page {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 2rem auto 4rem;
}

.content-page h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.content-page h2 {
    font-size: 1.6rem;
    color: var(--secondary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.content-page p {
    color: var(--secondary-light);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-page ul, .content-page ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-light);
}

.content-page li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

/* Style for Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary);
}

.form-group input, .form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.feedback-msg {
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: none;
}

.feedback-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Keyboard guide illustration */
.keyboard-layout-container {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    
    /* Custom Responsive properties */
    --key-width: 76px;
    --key-height: 100px;
    --key-gap: 0.5rem;
    --key-padding: 0.6rem 0.5rem 0.95rem 0.5rem;
    --space-key-width: 420px;
    --shift-key-width: 125px;
    --en-key-size: 0.85rem;
    --ur-key-size: 1.85rem;
    --ur-shift-size: 1.05rem;
}

.kbd-layout {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: var(--key-gap);
    direction: ltr; /* Ensure standard left-to-right QWERTY progression */
    font-family: var(--font-urdu);
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
}

.kbd-row {
    display: flex;
    gap: var(--key-gap);
    justify-content: center;
}

.kbd-key {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--key-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: var(--key-width);
    height: var(--key-height);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kbd-key-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    line-height: 1;
}

.kbd-key span.en-key {
    font-size: var(--en-key-size);
    color: var(--secondary-light);
    font-family: var(--font-sans);
    line-height: 1;
}

.kbd-key span.ur-shift-key {
    font-size: var(--ur-shift-size);
    color: var(--secondary-light);
    font-family: var(--font-urdu);
    line-height: 1;
    font-weight: 500;
    transition: var(--transition);
}

.kbd-key span.ur-key {
    font-size: var(--ur-key-size);
    color: var(--primary-dark);
    line-height: 1; /* Override huge default Urdu Nastaliq line heights */
    margin-bottom: 0px; /* Reset bottom margin since padding handles spacing now */
    transition: var(--transition);
}

.kbd-key.space-key {
    width: var(--space-key-width);
}

.kbd-key.shift-indicator-key {
    width: var(--shift-key-width);
}

/* Ensure shift and space key words scale down slightly and fit beautifully */
.kbd-key.shift-indicator-key span.ur-key,
.kbd-key.space-key span.ur-key {
    font-size: calc(var(--ur-key-size) * 0.85);
}

/* Real-time key depression styling */
.kbd-key.pressed {
    background-color: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.1);
}

/* Print Styling */
@media print {
    header, footer, .ad-container, .sidebar-card, .mode-selectors, .controls {
        display: none !important;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    .test-container {
        border: none;
        box-shadow: none;
        padding: 0;
    }
}

/* ==========================================================================
   PREMIUM TYPING.COM UPGRADES: THEMES, SOUND UTILITIES, KEY GLOWS
   ========================================================================== */

/* 1. Theme Configurations */
[data-theme="cyberpunk"] {
    --primary: #f43f5e;          /* Hot Neon Pink */
    --primary-light: #311c2e;    /* Cyber Dark Purple tint */
    --primary-dark: #fda4af;     /* Soft pink text highlight */
    --secondary: #f8fafc;        /* Off-white UI text */
    --secondary-light: #94a3b8;  /* Bright slate text */
    --bg-light: #020617;         /* Deepest space background */
    --card-bg: #0b1329;          /* Dark neon card background */
    --border-color: #1e293b;     /* Sleek cyberpunk borders */
    
    --success: #10b981;
    --success-bg: #064e3b;
    --error: #ef4444;
    --error-bg: #7f1d1d;
    --warning: #f59e0b;
}

[data-theme="retro"] {
    --primary: #eab308;          /* Amber Gold */
    --primary-light: #2d2613;    /* Warm carbon tint */
    --primary-dark: #fde047;     /* Bright amber text highlight */
    --secondary: #f5f5f5;        /* Light grey UI text */
    --secondary-light: #a3a3a3;  /* Mid grey text */
    --bg-light: #0a0a0a;         /* Terminal pitch black */
    --card-bg: #141414;          /* Pure carbon cards */
    --border-color: #262626;     /* Dark terminal grid border */
    
    --success: #22c55e;
    --success-bg: #14532d;
    --error: #ef4444;
    --error-bg: #7f1d1d;
    --warning: #f59e0b;
}

[data-theme="ivory"] {
    --primary: #854d0e;          /* Rich Warm Amber-Brown */
    --primary-light: #fef3c7;    /* Cream Warm orange tint */
    --primary-dark: #451a03;     /* Deep Rust text */
    --secondary: #1c1917;        /* Soft stone black */
    --secondary-light: #57534e;  /* Soft warm grey text */
    --bg-light: #fdfbf7;         /* Stone Antique white background */
    --card-bg: #f5f5f0;          /* Antique paper card */
    --border-color: #e7e5e4;     /* Soft slate grey stone borders */
    
    --success: #15803d;
    --success-bg: #dcfce7;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --warning: #d97706;
}

/* Base modifications for Dark Themes */
[data-theme="cyberpunk"] body, 
[data-theme="retro"] body {
    background-color: var(--bg-light);
    color: var(--secondary);
}

[data-theme="cyberpunk"] .typing-paragraph, 
[data-theme="retro"] .typing-paragraph {
    color: #cbd5e1;
}

[data-theme="cyberpunk"] .seo-section, 
[data-theme="retro"] .seo-section,
[data-theme="cyberpunk"] .sidebar-card,
[data-theme="retro"] .sidebar-card,
[data-theme="cyberpunk"] header,
[data-theme="retro"] header,
[data-theme="cyberpunk"] .faq-answer,
[data-theme="retro"] .faq-answer {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="cyberpunk"] .nav-link:hover, 
[data-theme="cyberpunk"] .nav-link.active,
[data-theme="retro"] .nav-link:hover, 
[data-theme="retro"] .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

[data-theme="cyberpunk"] .stat-card,
[data-theme="retro"] .stat-card,
[data-theme="cyberpunk"] .res-card,
[data-theme="retro"] .res-card,
[data-theme="cyberpunk"] .faq-item,
[data-theme="retro"] .faq-item,
[data-theme="cyberpunk"] .performance-msg,
[data-theme="retro"] .performance-msg {
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="cyberpunk"] .faq-question,
[data-theme="retro"] .faq-question {
    background-color: var(--card-bg);
}

/* Theme / Sound Switcher Buttons */
.nav-utility-item {
    list-style: none;
}

.utility-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-light);
    background-color: var(--bg-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.utility-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

/* 2. Visual Keyboard Guide styles */
.virtual-keyboard-section {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.keyboard-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.keyboard-guide-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
}

.kbd-toggle-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-light);
    border-radius: 50px;
    transition: var(--transition);
}

.kbd-toggle-btn:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
}

/* Highlighting next physical keys to press */
.kbd-key.active-next {
    background-color: var(--primary);
    border-color: var(--primary-dark);
    color: #ffffff !important;
    transform: scale(1.04);
    box-shadow: 0 0 12px var(--primary);
    animation: keyPulse 1.2s infinite ease-in-out alternate;
}

.kbd-key.active-next span.en-key,
.kbd-key.active-next span.ur-key,
.kbd-key.active-next span.ur-shift-key {
    color: #ffffff !important;
}

/* Highlighting Shift helper keys */
.kbd-key.active-shift {
    background-color: #f59e0b; /* Golden helper key */
    border-color: #b45309;
    color: #ffffff !important;
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.kbd-key.active-shift span.en-key,
.kbd-key.active-shift span.ur-key,
.kbd-key.active-shift span.ur-shift-key {
    color: #ffffff !important;
}

/* Interactive Shift-held states */
.kbd-layout.shift-held .ur-key {
    opacity: 0.35;
    transform: translateY(1px);
}

.kbd-layout.shift-held .ur-shift-key {
    color: var(--warning) !important;
    font-weight: 700;
    transform: scale(1.18);
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.45);
}

/* Glow for the active shifted key to press */
.kbd-key.active-next .ur-shift-key {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 0 8px #ffffff;
}

@keyframes keyPulse {
    0% { transform: scale(1); box-shadow: 0 0 4px var(--primary); }
    100% { transform: scale(1.06); box-shadow: 0 0 15px var(--primary); }
}

/* Hide animation for virtual keyboard */
.virtual-keyboard-section.hidden-kbd #visual-kbd {
    display: none;
}

.virtual-keyboard-section.hidden-kbd {
    padding-bottom: 0.5rem;
}

/* Responsive adjustments for Utility items in Mobile View */
@media (max-width: 768px) {
    .nav-utility-item {
        width: 100%;
        margin-top: 0.25rem;
    }
    
    .utility-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   ADVANCED MOBILE & TABLET RESPONSIVENESS OVERRIDES
   ========================================================================== */

/* Tablet & Smaller Devices (max-width: 768px) */
@media (max-width: 768px) {
    #keyboard-guide-container {
        display: none !important;
    }
}

/* Hide floating next key HUD on extra small mobile screens (under 480px) */
@media (max-width: 480px) {
    #floating-next-key-hud {
        display: none !important;
    }
}

/* Adjust size and padding of floating next key HUD on tablet & mobile devices (481px to 768px) */
@media (max-width: 768px) {
    .floating-hud {
        bottom: 1.25rem !important;
        right: 1.25rem !important;
        padding: 0.6rem 0.9rem 0.75rem !important;
        min-width: 120px !important;
    }
    .hud-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.25rem !important;
    }
    .hud-key-cap {
        min-width: 52px !important;
        height: 54px !important;
        padding: 0.3rem 0.45rem !important;
    }
    .hud-key-cap .en {
        font-size: 0.65rem !important;
    }
    .hud-key-cap .ur {
        font-size: 1.3rem !important;
        margin-top: -0.15rem !important;
    }
    .hud-modifier {
        height: 54px !important;
        padding: 0 0.8rem !important;
        font-size: 0.8rem !important;
    }
    .hud-plus {
        font-size: 1.2rem !important;
        margin: 0 0.15rem !important;
    }
    .hud-key-cap.hud-spacebar {
        min-width: 100px !important;
        height: 42px !important;
        font-size: 0.75rem !important;
    }

    .keyboard-layout-container {
        --key-width: 60px;
        --key-height: 82px;
        --key-gap: 0.4rem;
        --key-padding: 0.5rem 0.4rem 0.75rem 0.4rem;
        --space-key-width: 330px;
        --shift-key-width: 95px;
        --en-key-size: 0.75rem;
        --ur-key-size: 1.55rem;
        --ur-shift-size: 0.9rem;
    }
}

/* Small Tablets / Phablets (max-width: 540px) */
@media (max-width: 540px) {
    .test-container {
        padding: 1.25rem;
    }
    
    .keyboard-layout-container {
        padding: 1rem;
        --key-width: 48px;
        --key-height: 68px;
        --key-gap: 0.3rem;
        --key-padding: 0.4rem 0.3rem 0.6rem 0.3rem;
        --space-key-width: 250px;
        --shift-key-width: 80px;
        --en-key-size: 0.65rem;
        --ur-key-size: 1.3rem;
        --ur-shift-size: 0.8rem;
    }
    
    .typing-paragraph {
        font-size: 1.5rem;
        line-height: 2.1;
    }
    
    .typing-input {
        font-size: 1.5rem;
        height: 125px;
        padding: 1rem;
        line-height: 2.2;
    }
}

/* Mobile Portrait Devices (max-width: 410px) */
@media (max-width: 410px) {
    .main-wrapper {
        padding: 0 0.75rem 2rem;
        gap: 1rem;
    }
    
    .test-container {
        padding: 1rem;
    }
    
    .keyboard-layout-container {
        padding: 0.5rem;
        --key-width: 36px;
        --key-height: 58px;
        --key-gap: 0.2rem;
        --key-padding: 0.3rem 0.15rem 0.45rem 0.15rem;
        --space-key-width: 180px;
        --shift-key-width: 60px;
        --en-key-size: 0.55rem;
        --ur-key-size: 1.05rem;
        --ur-shift-size: 0.7rem;
    }
    
    .kbd-key span.ur-key {
        margin-bottom: 0px;
    }
    
    .typing-paragraph {
        font-size: 1.35rem;
        line-height: 2;
    }
    
    .typing-input {
        font-size: 1.38rem;
        height: 115px;
        padding: 0.95rem;
        line-height: 2.1;
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-val {
        font-size: 1.4rem;
    }
}

/* ==========================================================================
   FLOATING NEXT KEY HUD STYLES
   ========================================================================== */

.floating-hud {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 1000;
    background: rgba(30, 41, 59, 0.93); /* Dark Slate 800 for warm high-contrast background */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1.4rem 1.1rem;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(13, 148, 136, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    min-width: 150px;
    white-space: nowrap;
}

.floating-hud.hud-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hud-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(241, 245, 249, 0.85); /* Bright warm slate for extreme legibility */
    font-weight: 800;
    margin-bottom: 0.85rem;
    font-family: var(--font-primary);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.4rem;
    width: 100%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.hud-key-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.hud-key-cap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-width: 60px;
    height: 64px;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid var(--primary);
    border-bottom: 5px solid #0d9488b0; /* Gorgeous 3D keycap thickness depth */
    border-radius: var(--radius-md);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    animation: hudPulse 2s infinite alternate;
}

.hud-key-cap .en {
    font-size: 0.75rem;
    font-weight: 800;
    color: #99f6e4; /* Light teal for high-contrast visibility */
    align-self: flex-start;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 0 4px rgba(13, 148, 136, 0.5);
}

.hud-key-cap .ur {
    font-size: 1.65rem; /* Larger, bolder Nastaliq letter */
    font-family: var(--font-urdu);
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    align-self: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: -0.2rem;
}

.hud-key-cap.hud-spacebar {
    min-width: 140px;
    height: 48px;
    border-color: var(--primary);
    border-bottom: 5px solid #0d9488b0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.45);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-shadow: 0 0 8px #99f6e4;
    animation: hudPulse 2s infinite alternate;
}

.hud-modifier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    padding: 0 1.2rem;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: 2px solid var(--warning);
    border-bottom: 5px solid #b45309b0; /* 3D amber keycap depth */
    border-radius: var(--radius-md);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.25);
    letter-spacing: 0.05em;
    animation: shiftPulse 1.5s infinite alternate;
}

.hud-plus {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(13, 148, 136, 0.5);
    margin: 0 0.4rem;
}

@keyframes hudPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4); }
    100% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(13, 148, 136, 0.65); }
}

@keyframes shiftPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
    100% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.65); }
}

/* Developer Profile Card (Meet the Creator) */
.developer-profile-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.developer-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.dev-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
}

.dev-profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
    border: 2px solid var(--bg-light);
    letter-spacing: -1px;
    object-fit: cover;
}

.dev-profile-title-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dev-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
}

.dev-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dev-profile-bio {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.dev-profile-bio p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.dev-profile-bio p:last-child {
    margin-bottom: 0;
}

.dev-profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dev-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--text-color);
}

.dev-link-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.dev-link-btn .icon {
    font-size: 1.1rem;
}

.dev-link-btn.email {
    background-color: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.25);
    color: var(--primary);
}

.dev-link-btn.email:hover {
    background-color: var(--primary);
    color: #ffffff;
}

/* Light/Dark/Cyberpunk/Retro adaptations */
[data-theme="cyberpunk"] .dev-profile-avatar {
    background: linear-gradient(135deg, var(--cyber-yellow) 0%, var(--cyber-pink) 100%);
    color: #000;
    border-color: var(--cyber-cyan);
}
[data-theme="cyberpunk"] .dev-link-btn.email {
    background-color: rgba(243, 243, 21, 0.1);
    border-color: var(--cyber-yellow);
    color: var(--cyber-yellow);
}
[data-theme="cyberpunk"] .dev-link-btn.email:hover {
    background-color: var(--cyber-yellow);
    color: #000;
}

[data-theme="retro"] .dev-profile-avatar {
    background: var(--retro-dark);
    border-color: var(--retro-accent);
}
[data-theme="retro"] .dev-link-btn.email {
    background-color: rgba(178, 93, 37, 0.1);
    border-color: var(--retro-accent);
    color: var(--retro-accent);
}
[data-theme="retro"] .dev-link-btn.email:hover {
    background-color: var(--retro-accent);
    color: var(--retro-bg);
}

@media (max-width: 540px) {
    .developer-profile-card {
        padding: 1.5rem;
    }
    .dev-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .dev-profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .dev-profile-links {
        flex-direction: column;
        width: 100%;
    }
    .dev-link-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Urdu Typing Test - Specialized Pages Additions (Aesthetics & Layouts)
   ========================================================================== */

/* Distraction-Free / Focus (Zen) Mode */
body.zen-mode header,
body.zen-mode .ad-container,
body.zen-mode .hero,
body.zen-mode .sidebar,
body.zen-mode footer,
body.zen-mode .seo-section {
    display: none !important;
}

body.zen-mode .main-wrapper {
    grid-template-columns: 1fr !important;
    max-width: 900px;
    padding: 3rem 1.5rem;
}

body.zen-mode .test-container {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.zen-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.zen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--secondary-light);
    transition: var(--transition);
}

.zen-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Stories Selection Grid (paragraph-test.html) */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.story-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--border-color);
    transition: var(--transition);
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.story-card:hover::before {
    background-color: var(--primary);
}

.story-card.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.story-card.selected::before {
    background-color: var(--primary);
}

.story-badge {
    align-self: flex-start;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.badge-easy { background-color: #ecfdf5; color: #059669; }
.badge-medium { background-color: #fffbeb; color: #d97706; }
.badge-hard { background-color: #fef2f2; color: #dc2626; }

.story-title {
    font-family: var(--font-urdu);
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    text-align: right;
    direction: rtl;
}

.story-excerpt {
    font-family: var(--font-urdu);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--secondary-light);
    margin-bottom: 1.25rem;
    text-align: right;
    direction: rtl;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: auto;
}

.story-words {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-light);
}

.story-select-btn {
    padding: 0.4rem 1rem;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.story-select-btn:hover {
    background-color: var(--primary-dark);
}

.story-card.selected .story-select-btn {
    background-color: var(--primary-dark);
}

.completion-percentage-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 10px;
    margin: 1rem 0;
    overflow: hidden;
}

.completion-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Custom Text Input Panel (custom-test.html) */
.custom-workspace-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.custom-workspace-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.custom-workspace-subtitle {
    font-size: 0.95rem;
    color: var(--secondary-light);
    margin-bottom: 1.5rem;
}

.custom-input-area {
    width: 100%;
    height: 180px;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-urdu);
    font-size: 1.25rem;
    line-height: 1.8;
    direction: rtl;
    resize: vertical;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.custom-input-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.custom-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.custom-option-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-option-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary-light);
    text-transform: uppercase;
}

.custom-select {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    outline: none;
    cursor: pointer;
}

.custom-select:focus {
    border-color: var(--primary);
}

.custom-stats-hud {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-light);
}

.custom-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.custom-start-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.4);
}

.custom-start-btn:disabled {
    background-color: var(--border-color);
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Drills Interactive Guidance (drill-test.html) */
.drills-hud-panel {
    background-color: var(--primary-light);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.drills-hud-icon {
    font-size: 2.25rem;
    color: var(--primary);
    animation: bounceSlow 2s infinite alternate;
}

@keyframes bounceSlow {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.drills-hud-content {
    flex: 1;
}

.drills-hud-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.drills-hud-desc {
    font-size: 0.92rem;
    color: var(--secondary-light);
    line-height: 1.5;
}

.lessons-rail {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.lesson-pill {
    padding: 0.6rem 1.25rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--secondary-light);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.lesson-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lesson-pill.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

.lesson-pill.locked {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.lesson-pill.locked:hover {
    color: #94a3b8;
    border-color: #e2e8f0;
}

.finger-guide-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.finger-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.finger-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.color-l-pinky { background-color: #f43f5e; }
.color-l-ring { background-color: #fb923c; }
.color-l-middle { background-color: #facc15; }
.color-l-index { background-color: #4ade80; }
.color-r-index { background-color: #2dd4bf; }
.color-r-middle { background-color: #60a5fa; }
.color-r-ring { background-color: #c084fc; }
.color-r-pinky { background-color: #f472b6; }
.color-thumbs { background-color: #94a3b8; }

/* Finger overlays on visual keyboard keys */
.kbd-key.l-pinky { border-top: 3px solid #f43f5e; }
.kbd-key.l-ring { border-top: 3px solid #fb923c; }
.kbd-key.l-middle { border-top: 3px solid #facc15; }
.kbd-key.l-index { border-top: 3px solid #4ade80; }
.kbd-key.r-index { border-top: 3px solid #2dd4bf; }
.kbd-key.r-middle { border-top: 3px solid #60a5fa; }
.kbd-key.r-ring { border-top: 3px solid #c084fc; }
.kbd-key.r-pinky { border-top: 3px solid #f472b6; }
.kbd-key.space-key { border-top: 3px solid #94a3b8; }

/* Glowing highlight classes */
.kbd-key.active-next {
    background-color: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary-dark) !important;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
    font-weight: 800;
}

.kbd-key.active-next span.en-key,
.kbd-key.active-next span.ur-key,
.kbd-key.active-next span.ur-shift-key {
    color: var(--primary-dark) !important;
}

.kbd-key.active-shift {
    background-color: #ffedd5 !important;
    border-color: #f97316 !important;
    color: #c2410c !important;
    animation: shiftPulse 1s infinite alternate;
}

@keyframes shiftPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); box-shadow: 0 0 10px rgba(249, 115, 22, 0.4); }
}

.drill-passing-hud {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 1rem;
    border-radius: var(--radius-sm);
    color: #b45309;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Breadcrumbs Styling */
.breadcrumb-nav {
    max-width: 1200px;
    margin: 0.75rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary-light);
    list-style: none;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    color: var(--border-color);
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.breadcrumb li:last-child {
    color: var(--secondary);
    font-weight: 600;
}

/* Breadcrumb list styles for category / disabled crumb items */
.breadcrumb-disabled {
    pointer-events: none;
    color: var(--secondary-light) !important;
    font-weight: 500;
}

/* ==========================================================================
   Blog listing & Urdu Nastaliq calligraphic article rules
   ========================================================================== */

/* Urdu Blog Typography (Nastaliq alignment and line height optimizations) */
.urdu-article {
    direction: rtl !important;
    text-align: right !important;
}

.urdu-article h1, 
.urdu-article h2, 
.urdu-article h3, 
.urdu-article h4 {
    font-family: var(--font-urdu) !important;
    direction: rtl !important;
    text-align: right !important;
    line-height: 1.8 !important;
}

.urdu-article p, 
.urdu-article li,
.urdu-article span,
.urdu-article strong {
    font-family: var(--font-urdu) !important;
    direction: rtl !important;
    text-align: right !important;
    line-height: 2.2 !important;
    font-size: 1.25rem !important;
}

.urdu-article ul, 
.urdu-article ol {
    margin-right: 2rem !important;
    margin-left: 0 !important;
    direction: rtl !important;
}

/* Blog Listing Hub Styles */
.blog-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--secondary-light);
    line-height: 1.6;
}

.blog-filter-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.blog-filter-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.blog-filter-btn:hover,
.blog-filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 137, 126, 0.25);
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.blog-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--secondary-light);
    flex-wrap: wrap;
}

.blog-badge {
    background-color: rgba(5, 137, 126, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: var(--transition);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-title.urdu-font {
    font-family: var(--font-urdu) !important;
    font-size: 1.4rem !important;
    line-height: 1.6 !important;
    text-align: right !important;
    direction: rtl !important;
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--secondary-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-card-excerpt.urdu-font {
    font-family: var(--font-urdu) !important;
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    text-align: right !important;
    direction: rtl !important;
}

.blog-read-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
    margin-top: auto;
}

.blog-read-more:hover {
    color: var(--primary-dark);
    gap: 0.5rem;
}

.blog-read-more.urdu-font {
    font-family: var(--font-urdu) !important;
    font-size: 1rem !important;
    direction: rtl !important;
    justify-content: flex-start;
}


