/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile-First Responsive Design */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 0.25rem;
    }
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    border-radius: 0 !important;
}

/* Header Styles - REMOVED */

/* Navigation area - REMOVED */

/* Header and Nav styles - REMOVED */

/* Nav-btn styles - REMOVED */

/* Language switcher - REMOVED */

/* Mobile header and navigation styles - REMOVED */

/* Remaining nav styles - REMOVED */

/* REMOVED - conflicting with toggle design */

/* REMOVED - conflicting with toggle design */

/* REMOVED - conflicting with toggle design */

/* Mobile Navigation Styles */
/* Media query header/nav styles - REMOVED */

/* Main Content */
.main-content {
    padding: 2rem 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile main content adjustments */
@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Mobile card adjustments */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        margin-left: 0.125rem;
        margin-right: 0.125rem;
    }
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.25rem;
        min-height: 48px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 0.9rem;
        width: 100%;
    }
}

.btn-primary {
    background: #000c05;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 32px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.btn-primary:hover {
    /* No hover effect */
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    /* No hover effect */
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    /* No hover effect */
}

.btn-filled {
  background: #86efac;
  color: #374151;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px 32px;
  min-width: 140px;
  min-height: 48px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}
.btn-filled:hover {
  /* No hover effect */
}

.btn-outline-pill {
  background: #00ff5e;
  color: #374151;
  border: none;
  border-radius: 0px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  padding: 2px 2px !important;
  min-width: 140px;
  min-height: 48px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.btn-outline-pill:hover {
  /* No hover effect */
}

/* Form Controls - Enhanced Button-Style Dropdowns */
.select-control {
    position: relative;
    width: 100%;
    min-height: 56px;
    padding: 1rem 1.25rem;
    padding-right: 3rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Language switcher moved to navbar - old styles removed */

.search-input {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    flex: 1;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Mobile quiz container adjustments */
@media (max-width: 768px) {
    .quiz-container {
        max-width: 100%;
        padding: 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 0 0.5rem;
    }
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quiz-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.quiz-controls {
    display: flex;
    gap: 0.5rem;
    margin: 1rem auto 2rem auto;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: fit-content;
}

/* Mobile quiz controls adjustments */
@media (max-width: 768px) {
    .quiz-controls {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .quiz-controls {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
}

.quiz-controls .control-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin: 0;
}

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

.control-group label {
    color: #1a202c;
    font-weight: 500;
}

.quiz-question {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Mobile quiz question adjustments */
@media (max-width: 768px) {
    .quiz-question {
        padding: 1.5rem;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .quiz-question {
        padding: 1rem;
        border-radius: 8px;
    }
}

.verse-display {
    margin-bottom: 2rem;
}

.verse-header {
    margin-bottom: 1rem;
}

.surah-info {
    background: #f7fafc;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    color: #4a5568;
    border-top: 1.5px solid #e2e8f0 !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
}

.verse-text {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-right: none !important;
    border-top: 1.5px solid #e2e8f0 !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    position: relative;
    overflow: visible;
    padding-right: 1.7em !important;
}
.verse-text::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 8px;
  width: 5px;
  height: calc(100% - 24px);
  background: #4f8cff;
  border-radius: 8px;
  box-shadow: 0 0 8px 2px #4f8cff55;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 600px) {
  .verse-text {
    padding-right: 1.1em !important;
  }
  .verse-text::after {
    top: 6px;
    right: 4px;
    width: 4px;
    height: calc(100% - 12px);
    border-radius: 6px;
  }
}

.target-word {
    text-align: center;
    margin-bottom: 2rem;
}

.word-highlight {
    background: #667eea;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 0.5rem;
}

.quiz-form {
    margin-bottom: 2rem;
    width: 100%;
}

.quiz-option-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    width: 100%;
    flex-wrap: wrap;
}

/* RTL support for quiz option groups */
body.ur .quiz-option-group,
body.ar .quiz-option-group {
    direction: rtl;
    text-align: right;
}

/* RTL support for main content */
body.ur #main-content,
body.ar #main-content {
    direction: rtl;
    text-align: right;
}

.quiz-option-group > label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem; /* Reduced English category label size */
    min-width: 120px;
    flex-shrink: 0;
}

/* Urdu category labels - larger and bolder */
body.ur .quiz-option-group > label {
    font-size: 1.1rem; /* Larger than English */
    font-weight: 700; /* Bolder than English */
    font-family: 'JameelNooriNastaleeq', 'NOOREHUDA', 'Arial', sans-serif;
}

/* Mobile quiz form adjustments */
@media (max-width: 768px) {
    .quiz-form {
        margin-bottom: 1.5rem;
    }
    
    .quiz-option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }
    
    .quiz-option-group > label {
        min-width: auto;
        margin-bottom: 0.25rem;
        font-size: 0.9rem; /* Reduced English mobile category label size */
    }
    
    /* Urdu mobile category labels */
    body.ur .quiz-option-group > label {
        font-size: 1.0rem; /* Larger than English mobile */
        font-weight: 700;
    }
    
    .quiz-radio-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quiz-form {
        margin-bottom: 1rem;
    }
    
    .quiz-option-group {
        gap: 0.375rem;
        margin-bottom: 1rem;
    }
}

.quiz-option-btn {
    background: #f7fafc;
    border: 2px solid #c3cfe2;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, border 0.2s, color 0.2s;
    color: #4a5568;
    outline: none;
    min-width: 100px;
    min-height: 44px;
    text-align: center;
    position: relative;
    box-sizing: border-box;
    flex: 1;
    max-width: 300px;
}

/* Mobile quiz option button adjustments */
@media (max-width: 768px) {
    .quiz-option-btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .quiz-option-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
        min-width: 100px;
        flex: 1 1 calc(50% - 0.25rem);
    }
}

.quiz-option-btn.selected,
.quiz-option-btn:active,
.quiz-option-btn:focus {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
    z-index: 1;
}

/* Quiz Radio Button Group Styles */
.quiz-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

/* RTL support for quiz radio groups */
body.ur .quiz-radio-group,
body.ar .quiz-radio-group {
    direction: rtl;
    text-align: right;
}

.quiz-radio-item {
    display: flex;
    align-items: center;
    position: relative;
}

.quiz-radio-input {
    display: none;
}

.quiz-radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #f7fafc;
    border: 2px solid #c3cfe2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem; /* Reduced English font size */
    font-weight: 500;
    color: #2d3748;
    min-height: 44px;
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Urdu language specific styling - larger and bolder */
body.ur .quiz-radio-label {
    font-size: 1.15rem; /* 15% larger than English */
    font-weight: 600; /* Bolder than English */
    font-family: 'JameelNooriNastaleeq', 'NOOREHUDA', 'Arial', sans-serif;
}

.quiz-radio-label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.quiz-radio-input:checked + .quiz-radio-label {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.quiz-radio-input:focus + .quiz-radio-label {
    outline: 2px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

/* Mobile radio button adjustments */
@media (max-width: 768px) {
    .quiz-radio-group {
        gap: 0.5rem;
    }
    
    .quiz-radio-label {
        padding: 0.625rem 1rem;
        font-size: 0.9rem; /* Reduced English mobile font size */
        min-height: 40px;
    }
    
    /* Urdu mobile styling */
    body.ur .quiz-radio-label {
        font-size: 1.05rem; /* Larger than English mobile */
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .quiz-radio-group {
        gap: 0.375rem;
    }
    
    .quiz-radio-label {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem; /* Reduced English small mobile font size */
        min-height: 36px;
    }
    
    /* Urdu small mobile styling */
    body.ur .quiz-radio-label {
        font-size: 0.95rem; /* Larger than English small mobile */
        font-weight: 600;
    }
}

.quiz-option-btn input[type="radio"] {
    display: none;
}

.quiz-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

/* Mobile quiz actions adjustments */
@media (max-width: 768px) {
    .quiz-actions {
        gap: 0.75rem;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .quiz-actions {
        gap: 0.5rem;
    }
}

/* Quiz Results */
.quiz-result {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Mobile quiz result adjustments */
@media (max-width: 768px) {
    .quiz-result {
        padding: 1.5rem;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .quiz-result {
        padding: 1rem;
        border-radius: 8px;
    }
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-score.correct {
    color: #48bb78;
}

.result-score.incorrect {
    color: #f56565;
}

.result-feedback {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Mobile result details adjustments */
@media (max-width: 768px) {
    .result-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .result-details {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
}

.result-item {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 6px;
}

.result-item.correct {
    border-left: 4px solid #48bb78;
}

.result-item.incorrect {
    border-left: 4px solid #f56565;
}

/* Browse Styles */
.browse-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Mobile browse container adjustments */
@media (max-width: 768px) {
    .browse-container {
        max-width: 100%;
        padding: 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .browse-container {
        padding: 0 0.5rem;
    }
}

.browse-header {
    text-align: center;
    margin-bottom: 2rem;
}

.browse-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.browse-header p {
    color: rgba(255, 255, 255, 0.9);
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* Mobile filters adjustments */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .filters {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
}

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

.filter-group label {
    color: white;
    font-weight: 500;
}

.verbs-list {
    display: grid;
    gap: 1rem;
}

.verb-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile verb card adjustments */
@media (max-width: 768px) {
    .verb-card {
        padding: 1.25rem;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .verb-card {
        padding: 1rem;
        border-radius: 8px;
    }
}

.verb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.verb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.verb-word {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.verb-location {
    background: #f7fafc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #4a5568;
}

.verb-properties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

/* Mobile verb properties adjustments */
@media (max-width: 768px) {
    .verb-properties {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.375rem;
    }
}

@media (max-width: 480px) {
    .verb-properties {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.verb-property {
    background: #f7fafc;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.verb-property-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.verb-property-value {
    font-weight: 600;
    color: #4a5568;
}

/* Search Styles */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Mobile search container adjustments */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        padding: 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .search-container {
        padding: 0 0.5rem;
    }
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-header p {
    color: rgba(255, 255, 255, 0.9);
}

.search-form {
    margin-bottom: 2rem;
    width: 100%;
}

/* Mobile search form adjustments */
@media (max-width: 768px) {
    .search-form {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-form {
        margin-bottom: 1rem;
    }
}

.search-input-group {
    display: flex;
    gap: 1rem;
}

.search-results {
    display: grid;
    gap: 1rem;
}

/* Statistics Styles */
.stats-container {
    max-width: 1000px;
    margin: 0 auto;
}

.stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.stats-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-header p {
    color: rgba(255, 255, 255, 0.9);
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #4a5568;
    font-weight: 500;
}

.stat-chart {
    margin-top: 1rem;
    height: 200px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
}

.modal-body {
    padding: 1.5rem;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 2rem;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Arabic Text */
.arabic-text, .quran-verse, .quran-arabic, .detail-value.arabic-text {
    font-family: 'Noorehuda', 'Amiri', serif;
    font-size: 2rem;
    direction: rtl;
    text-align: right;
    line-height: 2.2rem;
    letter-spacing: 0.5px;
    color: #222;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.break-down-text {
  color: #667eea;
  background: none !important;
  display: inline-block;
  margin-top: 0.2em;
  font-size: 1.2rem;
}

.word-pair-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin: 0.5rem 0 1.2rem 0;

}

.matched-word-box {
  background: #e3e8ff;
  color: #222;
  padding: 0.7em 1.5em;
  border-radius: 10px;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
  display: flex;
  align-items: center;
}

.break-down-box {
  background: #f0fff4;
  color: #31825c;
  padding: 0.7em 1.5em;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.08);
  display: flex;
  align-items: center;
}

/* --- Distinct backgrounds for matched and breakdown boxes --- */
.matched-word-box {
  background: #fffbe6 !important; /* soft yellow */
  border: 1.5px solid #e2e8f0 !important;
  color: #222 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}
.break-down-box {
  background: #ffeaea !important; /* soft red/pink */
  border: 1.5px solid #e2e8f0 !important;
  color: #222 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

/* --- Text background highlight for matched and breakdown boxes --- */
.text-bg-yellow {
  background: #ffe066;
  color: #222;
  padding: 0.1em 0.4em;
  border-radius: 0.4em;
  display: inline-block;
}
.text-bg-red {
  background: #ff6f6f;
  color: #fff;
  padding: 0.1em 0.4em;
  border-radius: 0.4em;
  display: inline-block;
}

/* --- Responsive Design: Mobile-First, All Devices --- */
html {
  box-sizing: border-box;
  font-size: 16px;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body {
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card-box, .modal-content {
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.heading-gradient {
  border-radius: 10px;
  padding: clamp(18px, 5vw, 40px) 0;
  margin-bottom: 2rem;
}

.main-heading, .quiz-header h2, .target-word h3 {
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 1.5rem;
}

.lang-btn, #newQuestionBtn, .select-control, .btn-filled, .btn-outline-pill, .btn-pill-white {
  min-height: 44px;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  padding: 8px 16px;
  border-radius: 6px;
  margin: 0;
}

.quiz-container, .browse-container, .search-container, .stats-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 0.5rem;
}

.verse-display.card-box, .quiz-form.card-box {
  margin-bottom: 1.2rem;
}

.quiz-form.card-box {
  padding: 1.2rem 1rem;
}

.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.quiz-option-group {
  margin-bottom: 1rem;
}

.quran-verse, .verse-arabic {
  font-size: clamp(1.1rem, 4vw, 2rem);
  line-height: 2.2rem;
  word-break: break-word;
}

/* Responsive: mobile-first */
@media (max-width: 900px) {
  .container {
    max-width: 98vw;
    padding: 0 0.5rem;
  }
  .quiz-container, .browse-container, .search-container, .stats-container {
    max-width: 98vw;
    padding: 1rem 0.2rem;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 17px;
  }
  body, .container {
    padding: 0;
    margin: 0;
    width: 100vw;
    min-width: 0;
    background: #f7f8fa;
  }
  .container {
    max-width: 100vw;
    padding: 0 2vw;
  }
  .heading-gradient {
    padding: 18px 0 18px 0;
    border-radius: 0 0 14px 14px;
    margin-bottom: 1.2rem;
  }
  .main-heading, .quiz-header h2, .target-word h3 {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 0.7rem;
  }
  .top-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
  }
  .lang-btn, #newQuestionBtn, .select-control, .btn-filled, .btn-outline-pill, .btn-pill-white {
    width: 100%;
    min-width: 0;
    font-size: 1.1rem;
    margin-bottom: 8px;
    padding: 4px 0;
    border-radius: 14px;
  }
  .quiz-container, .browse-container, .search-container, .stats-container {
    max-width: 100vw;
    padding: 0.5rem 0.2rem;
  }
  .card-box, .quiz-form.card-box, .verse-display.card-box {
    padding: 14px 8px;
    border-radius: 14px;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100vw;
  }
  .quiz-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .quiz-option-group {
    margin-bottom: 1.2rem;
  }
  .quran-verse, .verse-arabic {
    font-size: 1.3rem;
    line-height: 2.1rem;
    text-align: right;
    padding: 0.5rem 0.2rem;
    word-break: break-word;
  }
  .modal-content {
    width: 98vw;
    max-width: 98vw;
    padding: 1rem 0.5rem;
    border-radius: 14px;
  }
  .verbs-list, .search-results, .stats-content {
    overflow-x: auto;
    width: 100%;
  }
  /* Hide less important elements */
  .quiz-header p, .browse-header p, .search-header p, .stats-header p {
    display: none;
  }
  /* Make all tap targets large */
  button, .lang-btn, .quiz-option-btn, .btn-filled, .btn-outline-pill, .btn-pill-white {

  }
}

@media (max-width: 400px) {
  html {
    font-size: 15px;
  }
  .main-heading, .quiz-header h2, .target-word h3 {
    font-size: 1rem;
  }
  .card-box, .quiz-form.card-box, .verse-display.card-box, .modal-content {
    border-radius: 8px;
    padding: 8px 2px;
  }
  .lang-btn, #newQuestionBtn, .select-control, .btn-filled, .btn-outline-pill, .btn-pill-white {
    border-radius: 8px;
    font-size: 1rem;
    padding: 10px 0;
  }
}

/* Horizontal scroll for wide lists/tables */
.verbs-list, .search-results, .stats-content {
  overflow-x: auto;
  width: 100%;
}

/* Hide less important elements on very small screens */
@media (max-width: 400px) {
  .quiz-header p, .browse-header p, .search-header p, .stats-header p {
    display: none;
  }
}

/* Touch-friendly: increase tap area for buttons */
button, .lang-btn, .quiz-option-btn, .btn-filled, .btn-outline-pill, .btn-pill-white {
  min-height: 44px;
  min-width: 44px;
}

/* Ensure modals/cards never overflow */
.modal-content, .card-box {
  box-sizing: border-box;
  overflow-x: auto;
}

@font-face {
    font-family: 'Noorehuda';
    src: url('/static/NOOREHUDA.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
} 

@font-face {
    font-family: 'JameelNooriNastaleeq';
    src: url('/static/JameelNooriNastaleeq.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body[dir="rtl"], .rtl {
    font-family: 'JameelNooriNastaleeq', 'Amiri', serif, sans-serif;
} 

body[dir="rtl"] .quiz-option-btn {
    font-family: 'JameelNooriNastaleeq', 'Amiri', serif, sans-serif;
}
body[dir="rtl"] .result-user-answer,
body[dir="rtl"] .result-correct-answer,
.result-property {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-family: 'JameelNooriNastaleeq', 'Amiri', serif, sans-serif;
    direction: rtl;
    text-align: center;
}

body[dir="rtl"] .result-property {
    font-family: 'JameelNooriNastaleeq', 'Amiri', serif, sans-serif;
} 

.urdu-font {
    font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Amiri', serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    direction: rtl;
    letter-spacing: 0.02em;
    display: block;
    margin: 0 auto;
} 

/* Basic submit button class */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding:12px;
  border: 1px solid gray;
  border-radius: 12px;
  background: #ffffff;
  color: rgb(0, 0, 0);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}
/*.btn-submit {min-height: 0 !important; line-height: 1 !important; }
.btn-submit i { margin: 0 6px 0 0; line-height: 1; }

/* Force consistent size on larger screens overriding generic button rules */
.quiz-actions #submitAnswerBtn.btn-submit {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 20px !important;
}
.btn-submit:hover { background: #000000; 
color: #ffffff;}
.btn-submit:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

.pill-btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 32px;
  min-width: 120px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  outline: none;
  border: none;
  margin: 0 8px;
}

.pill-btn--white {
  background: #fff;
  color: #111;
  border: none;
}
.pill-btn--white:hover {
  /* No hover effect */
}

.pill-btn--outline {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.pill-btn--outline:hover {
  /* No hover effect */
} 

.btn-pill-white {
  background: #86efac !important;
  color: #374151 !important;
  border: none !important;
  border-radius: 50px !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  padding: 12px 32px !important;
  min-width: 140px !important;
  min-height: 48px !important;
  cursor: pointer !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
  font-family: 'Inter', Arial, Helvetica, sans-serif !important;
}

.btn-pill-white:hover {
  /* No hover effect */
} 

@font-face {
  font-family: 'Noorehuda';
  src: url('/static/NOOREHUDA.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'JameelNooriNastaleeq';
  src: url('/static/JameelNooriNastaleeq.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

.quran-verse, .verse-arabic, .urdu-font {
  font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Amiri', serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  direction: rtl;
  letter-spacing: 0.02em;
}

/* Enhanced Urdu text styling for quiz content */
.quiz-header h1.urdu-font,
.quiz-header p.urdu-font {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  text-align: center;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.quiz-header p.urdu-font {
  font-size: 1.1rem;
  font-weight: 500;
  color: #4a5568;
  line-height: 1.7;
  text-align: center;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
}

/* Urdu button styling */
.btn.urdu-font,
button.urdu-font {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  min-width: 120px;
  line-height: 1.4;
  display: block;
  margin: 0 auto;
}

/* Urdu select options */
select option.urdu-font {
  font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Amiri', serif;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  direction: rtl;
} 

.options-container {
  background: #6d8ae6;
  border-radius: 22px;
  padding: 28px 12px;
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto 2rem auto;
  max-width: 520px;
  width: 100%;
  min-width: 0;
  border: 1.5px solid #e0e0e0; /* soft grey line instead of shadow */
  box-shadow: none;
}

.option-card {
  background: #e9edfb;
  border-radius: 16px;
  padding: 22px 0;
  font-size: 2rem;
  font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Noto Naskh Arabic', serif;
  color: #222;
  border: 1.5px solid #e0e0e0; /* soft grey line */
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.15s;
  text-align: center;
  min-width: 110px;
  flex: 1 1 0;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.option-card:hover {
  /* No hover effect */
}

.option-card.selected {
  background: #d1f7e6;
  color: #1a3a2b;
  border: 1.5px solid #34d399;
  font-weight: 700;
}

@media (max-width: 600px) {
  .options-container {
    flex-direction: column;
    gap: 12px;
    padding: 14px 2vw;
    max-width: 99vw;
  }
  .option-card {
    width: 100%;
    min-width: 0;
    padding: 14px 0;
    font-size: 1.2rem;
  }
} 

/* --- Force white background and soft grey border for main containers --- */
body {
  background: #fff !important;
}
.quiz-container, .browse-container, .search-container, .stats-container {
  background: #fff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: none !important;
} 

/* --- Consistent, very rounded card style for all containers and inners --- */
.quiz-container, .browse-container, .search-container, .stats-container,
.card, .verb-card, .quiz-question, .quiz-result, .modal-content, .stat-card, .search-results, .verbs-list, .modal {
  background: #fff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 22px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04) !important;
} 

/* --- Make all header/title and subtitle text black for visibility --- */
.header-title, .header-subtitle, .quiz-header h2, .quiz-header p, .browse-header h2, .browse-header p, .search-header h2, .search-header p, .stats-header h2, .stats-header p, .text-white, h1, h2, h3, h4, h5, h6 {
  color: #222 !important;
  background: none !important;
} 

/* --- Improved theme for inner boxes and option cards --- */
.word-highlight, .matched-word-box, .break-down-box, .quiz-option-btn {
  background: #f9fafb !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #222 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

/* Selected/active state for options */
.quiz-option-btn.selected, .quiz-option-btn:active, .quiz-option-btn:focus {
  background: #e0e7ef !important;
  color: #222 !important;
  border-color: #a0aec0 !important;
} 

/* --- Center word-pair-container and its children for mobile responsiveness --- */
.word-pair-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
}
@media (max-width: 600px) {
  .word-pair-container {
    flex-direction: column;
    gap: 0.7rem;
    align-items: center;
  }
} 

@media (max-width: 600px) {
  .quiz-option-group {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .quiz-option-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.95rem;
    min-width: 80px;
    max-width: 100%;
    word-break: break-word;
    white-space: normal;
  }
} 

#newQuestionBtn, .quiz-actions .btn, .btn-primary, .btn-outline-pill {
  font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Noto Naskh Arabic', 'Amiri', serif !important;
}
#newQuestionBtn, .quiz-actions .btn, .btn-primary, .btn-outline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  max-width: 320px;
  width: auto;
  padding: 0.5em 1.4em !important;
  margin: 0 auto;
  font-size: 1.15rem !important;
  background: #0073ff !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  font-weight: 700;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
  text-shadow: none !important;
  transition: box-shadow 0.25s, border-color 0.25s, background 0.25s;
}
#newQuestionBtn:hover, .quiz-actions .btn:hover, .btn-primary:hover, .btn-outline-pill:hover,
#newQuestionBtn:focus, .quiz-actions .btn:focus, .btn-primary:focus, .btn-outline-pill:focus {
  /* No hover effect */
}
@media (max-width: 600px) {
  #newQuestionBtn, .quiz-actions .btn, .btn-primary, .btn-outline-pill {
    width: auto !important;
    min-width: 0 !important;
    max-width: 95vw !important;
    font-size: 1.1rem !important;
    padding: 0.9em 1.2em !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
} 

.feedback-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 0 16px 4px #25d36680, 0 0 32px 8px #25d36640;
  border: none;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  margin: 0.5rem 0 0.2rem 0.75rem; /* offset from edges */
  text-decoration: none;
}
.feedback-whatsapp-btn:hover, .feedback-whatsapp-btn:focus {
  /* No hover effect */
}
.feedback-hint {
  font-size: 0.85rem;
  color: #222;
  opacity: 0.45;
  text-align: center;
  margin-top: 0.1rem;
  max-width: 80px;
  line-height: 1.2;
  user-select: none;
}
@media (max-width: 600px) {
  .feedback-whatsapp-btn {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
    box-shadow: 0 0 12px 3px #25d36680, 0 0 24px 6px #25d36640;
  }
} 

/* Teaching Module Styles */
.teaching-container {
    max-width: 800px;
    margin: 0 auto;
}

.teaching-header {
    text-align: center;
    margin-bottom: 2rem;
}

.teaching-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.teaching-header p {
    color: #666;
    font-size: 1.1rem;
}

.teaching-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.teaching-verse {
    border-radius: 24px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #06b6d4;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.teaching-verse::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

.teaching-verse:hover {
    /* No hover effect - keep same background */
}

.teaching-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.teaching-hints {
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.teaching-hints h4 {
    color: #0ea5e9;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.teaching-hints ul {
    list-style: none;
    padding: 0;
}

.teaching-hints li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0f2fe;
    color: #0369a1;
}

.teaching-hints li:last-child {
    border-bottom: none;
}

.teaching-analysis {
    border-radius: 20px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #f59e0b;
    background: #f0fdf4;
}

.teaching-analysis h4 {
    color: #22c55e;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.analysis-item {
    background: white;
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 4px solid #22c55e;
}

.analysis-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.analysis-value {
    color: #22c55e;
    font-weight: 500;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .teaching-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .teaching-actions {
        flex-direction: column;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
} 

.teaching-actions button {
    border: none;
    border-radius: 16px;
    padding: 0.9em 2.2em;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0.5em;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
    outline: none;
    display: inline-block;
    min-width: 140px;
    min-height: 48px;
    letter-spacing: 0.01em;
}
.teaching-actions button:active {
    transform: scale(0.97);
}
.teaching-actions .btn-white {
    background: #fff;
    color: #222;
    border: 2px solid #e2e8f0;
}
.teaching-actions .btn-white:hover, .teaching-actions .btn-white:focus {
    background: #f3f4f6;
    color: #181818;
    box-shadow: 0 4px 18px 2px #e2e8f0;
}
.teaching-actions .btn-black {
    background: #181818;
    color: #fff;
    border: 2px solid #181818;
}
.teaching-actions .btn-black:hover, .teaching-actions .btn-black:focus {
    /* No hover effect */
}

@media (max-width: 600px) {
    .teaching-actions button {
        width: 100%;
        margin: 0.5em 0;
        min-width: 0;
        font-size: 1.05rem;
    }
} 

.hints-table, .analysis-table {
    width: 100%;
    display: table;
    border-collapse: separate;
    border-spacing: 0 0.5em;
    margin-top: 0.5em;
}
.hints-row, .analysis-row {
    display: table-row;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.hints-row:hover, .analysis-row:hover {
    /* No hover effect */
}
.hints-label, .analysis-label {
    display: table-cell;
    font-weight: 600;
    color: #374151;
    padding: 0.7em 1.2em;
    background: #f3f4f6;
    border-radius: 8px 0 0 8px;
    min-width: 120px;
    vertical-align: middle;
}
.hints-value, .analysis-value {
    display: table-cell;
    color: #2563eb;
    font-weight: 500;
    padding: 0.7em 1.2em;
    background: #f9fafb;
    border-radius: 0 8px 8px 0;
    vertical-align: middle;
    text-align: right;
}
@media (max-width: 600px) {
    .hints-label, .analysis-label, .hints-value, .analysis-value {
        display: block;
        width: 100%;
        border-radius: 8px 8px 0 0;
        text-align: left;
        padding: 0.7em 0.8em;
    }
    .hints-row, .analysis-row {
        display: block;
        margin-bottom: 0.7em;
    }
    .hints-table, .analysis-table {
        display: block;
    }
} 

.teaching-nav-btns {
    display: flex;
    gap: 0.7em;
    align-items: center;
    margin-top: 0.5em;
}
@media (max-width: 600px) {
    .teaching-nav-btns {
        flex-direction: column;
        gap: 0.5em;
        width: 100%;
    }
    .teaching-nav-btns button {
        width: 100%;
    }
} 

/* --- Restored Teaching nav buttons custom style --- */
.btn-nav {
  background: #fff;
  color: #222;
  border: 2px solid #667eea;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.7em 2em;
  min-width: 120px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  margin: 0 0.5em;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}
.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f3f4f6;
  color: #aaa;
  border-color: #e2e8f0;
}
.btn-nav:hover:not(:disabled), .btn-nav:focus:not(:disabled) {
  /* No hover effect */
} 

/* Logo styles - REMOVED */ 
.highlight {
  background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
  color: #1f2937;
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(251, 191, 36, 0.3);
  cursor: pointer;
  display: inline-block;
  line-height: 1.2;
  margin: 0 0.125rem;
}

.highlight:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
}

.highlight.target-word-clickable {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05em;
  border: 2px solid #1d4ed8;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse-glow 2s infinite;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  display: inline-block;
  line-height: 1.2;
  margin: 0 0.125rem;
  z-index: 1;
}

.highlight.target-word-clickable::before {
  content: "🔍";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.highlight.target-word-clickable:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
  border-color: #1e40af;
}

.highlight.target-word-clickable:hover::before {
  opacity: 1;
  transform: scale(1.1);
}

/* Enhanced Teaching Analysis Styles */
.teaching-analysis {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.teaching-analysis:hover {
    /* No hover effect - keep same background */
}

/* Enhanced Target Word Display */
.target-word-display {
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 24px;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    border: 1px solid #ef4444;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.target-word-display::before {
    content: "📖";
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 1.2rem;
    opacity: 0.8;
}



.target-word-display:hover {
    /* No hover effect - keep same background */
}

/* Pulse glow animation for target word */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6);
    }
}

/* Enhanced Word Highlighting - Removed duplicate styles */

/* Enhanced Button Styles */
.btn-outline-pill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-outline-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-pill:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    padding: 0.875rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced Analysis Table */
.analysis-table-container {
    margin: 1rem 0;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.analysis-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #5a67d8;
    min-width: 80px;
    transition: all 0.3s ease;
}

.analysis-header:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.analysis-value {
    padding: 1rem 0.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    background: #f8f9fa;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    min-width: 80px;
    transition: all 0.3s ease;
}

.analysis-value:hover {
    background: #f1f5f9;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* RTL/LTR Direction Support */
.analysis-header[style*="direction: rtl"],
.analysis-value[style*="direction: rtl"] {
    text-align: right;
    font-family: 'JameelNooriNastaleeq', 'Arial', sans-serif;
    font-size: 1.1rem;
}

.analysis-header[style*="direction: ltr"],
.analysis-value[style*="direction: ltr"] {
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

/* Loading Animation */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Language Toggle Indicator */
.language-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Enhanced Typography */
.teaching-verse-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

/* Enhanced Focus States */
.btn:focus,
.analysis-header:focus,
.analysis-value:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Enhanced Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Enhanced Error States */
.error-state {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

/* Enhanced Success States */
.success-state {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #22c55e;
    color: #16a34a;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

/* New Card-based Analysis Layout */
.analysis-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.analysis-card {
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #3b82f6;
    background: white;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    width: 100%;
    box-sizing: border-box;
}

.analysis-card:hover {
    /* No hover effect - keep same background */
}

.card-header {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 3px solid #3b82f6;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.125rem;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
    border-radius: 16px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 1px solid #8b5cf6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-value:hover {
    /* No hover effect - keep same background */
}

/* Responsive adjustments for cards */
@media (max-width: 768px) {
    .analysis-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
        margin: 1rem 0.5rem;
    }
    
    .analysis-card {
        padding: 0.75rem;
        min-height: 70px;
    }
    
    .card-header {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }
    
    .card-value {
        font-size: 0.875rem;
        padding: 0.375rem;
        min-height: 35px;
    }
}

@media (max-width: 600px) {
    .analysis-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
        margin: 0.75rem 0.25rem;
    }
    
    .analysis-card {
        padding: 0.5rem;
        min-height: 60px;
    }
    
    .card-header {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .card-value {
        font-size: 0.8rem;
        padding: 0.25rem;
        min-height: 30px;
    }
}

@media (max-width: 400px) {
    .analysis-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
        padding: 0.375rem;
        margin: 0.5rem 0.125rem;
    }
    
    .analysis-card {
        padding: 0.375rem;
        min-height: 55px;
    }
    
    .card-header {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }
    
    .card-value {
        font-size: 0.75rem;
        padding: 0.2rem;
        min-height: 25px;
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    .analysis-card {
        border: 2px solid #374151;
        background: #ffffff;
    }
    
    .card-header {
        color: #1f2937;
        border-bottom-color: #6b7280;
    }
    
    .card-value {
        background: #f3f4f6;
        color: #1f2937;
    }
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay .modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Conjugation Modal Styles */
.conjugation-modal {
  max-width: 1200px;
  width: 95%;
}

/* Root Variations Modal Styles */
.root-variations-modal {
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.root-variations-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.root-variations-filters select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: white;
  min-width: 120px;
}

.root-variations-filters select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.root-variations-pagination, .modal-pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  background: #86efac;
  color: #374151;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 80px;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pagination-btn-prev,
.pagination-btn-next {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #10b981 100%);
}

.pagination-btn-number {
  min-width: 50px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  text-transform: none;
  letter-spacing: normal;
}

.pagination-btn-number:hover:not(:disabled) {
  background: #86efac;
  color: #374151;
}

.pagination-btn-active {
  background: #10b981 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.pagination-ellipsis {
  color: #9ca3af;
  font-weight: 600;
  padding: 0 0.5rem;
  font-size: 1.1rem;
}

.pagination-btn:hover:not(:disabled) {
  background: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pagination-btn:disabled {
  background: #f1f5f9;
  color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.6;
}

.pagination-info {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  color: #4a5568;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  text-align: center;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.page-count {
  font-weight: 700;
  color: #1e293b;
}

.total-items {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
  .modal-pagination-container {
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
    flex-direction: column;
  }
  
  .pagination-numbers {
    order: 1;
    gap: 0.25rem;
  }
  
  .pagination-btn-prev {
    order: 0;
    min-width: 100px;
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
  
  .pagination-btn-next {
    order: 2;
    min-width: 100px;
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
  
  .pagination-btn-number {
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
    min-width: 40px;
  }
  
  .pagination-info {
    order: 3;
    padding: 0.675rem 1.25rem;
    font-size: 0.85rem;
    min-width: 100px;
    margin-top: 0.5rem;
  }

  .page-count {
    font-size: 0.9rem;
  }

  .total-items {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .modal-pagination-container {
    gap: 0.25rem;
  }
  
  .pagination-numbers {
    gap: 0.2rem;
  }
  
  .pagination-btn-prev,
  .pagination-btn-next {
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .pagination-btn-number {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    min-width: 35px;
  }
  
  .pagination-ellipsis {
    font-size: 1rem;
    padding: 0 0.25rem;
  }
  
  .pagination-info {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .modal-pagination-container {
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination-btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    min-width: 65px;
    flex: 0 0 auto;
  }
  
  .pagination-info {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    min-width: 90px;
    flex: 0 0 auto;
    order: -1;
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

.modal-summary {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 500;
  color: #495057;
  margin-bottom: 1rem;
}

.verse-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
}

.verse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.verse-info {
  font-size: 0.875rem;
  color: #64748b;
}

.verse-text {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  text-align: right;
  direction: rtl;
  font-family: 'Noorehuda', 'JameelNooriNastaleeq', 'Noto Naskh Arabic', 'Amiri', serif;
}

.verse-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.verse-analysis-card {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
}

.verse-analysis-card .card-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verse-analysis-card .card-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

@media (max-width: 768px) {
  .root-variations-filters {
    flex-direction: column;
  }
  
  .root-variations-filters select {
    min-width: auto;
  }
  
  .verse-analysis {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .verse-text {
    font-size: 1rem;
  }
}

.conjugation-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.conjugation-modal .modal-header h3 {
  margin: 0;
  color: #2d3748;
  font-size: 1.5rem;
  font-weight: 600;
}

.conjugation-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 1.5rem;
}

.conjugation-modal .modal-body {
  flex: 1;
  overflow-y: auto;
}

.conjugation-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  min-width: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Filter container styling for all modal types */
.conjugation-filters,
.root-variations-filters,
.pattern-variations-filters,
.mood-variations-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.conjugation-filters select,
.root-variations-filters select,
.pattern-variations-filters select,
.mood-variations-filters select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  min-width: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.conjugation-filters select:focus,
.root-variations-filters select:focus,
.pattern-variations-filters select:focus,
.mood-variations-filters select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.conjugation-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
  table-layout: fixed;
}

.conjugation-table th,
.conjugation-table td {
  padding: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.conjugation-table th {
  background: #343a40;
  color: #ffffff;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.conjugation-table td {
  color: #2d3748;
  background: #ffffff;
}

.conjugation-table .arabic-text {
  font-family: 'Amiri', 'Noto Sans Arabic', Arial;
  font-size: 1.1rem;
  direction: rtl;
  text-align: right !important;
}

.conjugation-table tbody tr:hover {
  background: #f8f9fa !important;
}

.conjugation-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.conjugation-table tbody tr:nth-child(even):hover {
  background: #e9ecef !important;
}

/* Small button styles */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #4299e1;
  color: #4299e1;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #4299e1;
  color: white;
}

/* Conjugation button specific styles */
.conjugation-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid #667eea;
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
}

.conjugation-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;
}

.conjugation-btn:hover::before {
  left: 100%;
}

.conjugation-btn:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  border-color: #5a67d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.conjugation-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.conjugation-btn i {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.conjugation-btn:hover i {
  transform: scale(1.1);
}

/* Responsive table */
@media (max-width: 768px) {
  .conjugation-filters {
    flex-direction: column;
  }
  
  .filter-select {
    min-width: auto;
  }
  
  .conjugation-table {
    font-size: 0.8rem;
  }
  
  .conjugation-table th,
  .conjugation-table td {
    padding: 0.5rem 0.25rem;
  }
  
  .conjugation-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  
  .conjugation-btn i {
    font-size: 0.8rem;
    margin-right: 0.3rem;
  }
}

/* Verse Navigator Styles */
.navigator-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.navigator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.navigator-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navigator-header p {
  font-size: 1.1rem;
  color: #718096;
  font-weight: 400;
}

.navigator-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.navigator-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.navigator-controls label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.95rem;
}

.navigator-controls .select-control,
.navigator-controls .input-control {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;
}

.navigator-controls .select-control:focus,
.navigator-controls .input-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.navigator-controls .input-control {
  font-family: 'Inter', sans-serif;
}

#navigateBtn {
  align-self: center;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#navigateBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#navigateBtn:active {
  transform: translateY(0);
}

.navigator-result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.navigator-result .verse-display {
  text-align: center;
}

.navigator-result .verse-header {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
}

.navigator-result .surah-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.navigator-result .surah-info span {
  font-weight: 600;
  font-size: 1.1rem;
}

.navigator-result .verse-text {
  margin-top: 1.5rem;
}

.navigator-result .verse-text p {
  font-family: 'Noorehuda', 'Amiri', serif;
  font-size: 1.8rem;
  line-height: 2.5;
  color: #2d3748;
  direction: rtl;
  text-align: right;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

/* Responsive design for navigator */
@media (max-width: 768px) {
  .navigator-container {
    padding: 1rem;
    margin: 0 1rem;
  }
  
  .navigator-header h2 {
    font-size: 2rem;
  }
  
  .navigator-controls {
    padding: 1rem;
  }
  
  .navigator-result .verse-text p {
    font-size: 1.4rem;
    line-height: 2;
  }
  
  .navigator-result .surah-info {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  /* General mobile improvements */
  html {
    font-size: 16px;
  }
  
  body {
    padding: 0;
    margin: 0;
    width: 100vw;
    overflow-x: hidden;
  }
  
  .container {
    max-width: 100vw;
    padding: 0 1rem;
    margin: 0;
  }
  
  /* Header and nav styles - REMOVED */
  
  /* Nav active styles - REMOVED */
  
  /* REMOVED - mobile nav-btn styles */
  
  /* Main content improvements */
  .main-content {
    padding: 0.5rem 0;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Quiz container improvements */
  .quiz-container, .browse-container, .search-container, .stats-container {
    max-width: 100%;
    padding: 0.25rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .quiz-header, .browse-header, .search-header, .stats-header {
    text-align: center;
    padding: 1rem 0.5rem;
    margin-bottom: 1rem;
  }
  
  .quiz-header h2, .browse-header h2, .search-header h2, .stats-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .quiz-header p, .browse-header p, .search-header p, .stats-header p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
  }
  
  /* Controls improvements */
  .quiz-controls, .top-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0 0.5rem;
  }
  
  .control-group {
    width: 100%;
    margin-bottom: 0;
  }
  
  .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
  }
  
  /* Button improvements */
  .btn, .btn-primary, .btn-outline-pill, .btn-filled, .btn-pill-white, 
  .lang-btn, #newQuestionBtn, .select-control {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  /* Select control improvements */
  .select-control {
    background-size: 16px;
    padding-right: 2.5rem;
    font-size: 1rem;
  }
  
  /* Verse display improvements */
  .verse-display {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 16px;
  }
  
  .verse-header {
    margin-bottom: 1rem;
  }
  
  .surah-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
  }
  
  .verse-text {
    font-size: 1.25rem;
    line-height: 2rem;
    text-align: center;
    padding: 1rem 0.5rem;
    word-break: break-word;
    margin-bottom: 1rem;
  }
  
  .target-word {
    text-align: center;
    margin: 1rem 0;
  }
  
  .target-word h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .word-highlight {
    font-size: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
  }
  
  /* Quiz form improvements */
  .quiz-form {
    margin: 1rem 0;
    padding: 0;
  }
  
  .quiz-option-group {
    margin-bottom: 1rem;
  }
  
  .quiz-option-btn {
    width: 100%;
    min-height: 56px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    border-radius: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  /* Quiz actions improvements */
  .quiz-actions {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
  }
  
  
  /* Feedback button improvements */
  .feedback-whatsapp-btn {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .feedback-hint {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 0.5rem;
  }
  
  /* Modal improvements */
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    margin: 2rem auto;
    padding: 1rem;
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .modal-header {
    padding: 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 16px 16px 0 0;
  }
  
  .modal-header h3 {
    font-size: 1.25rem;
  }
  
  .modal-body {
    padding: 0;
  }
  
  /* Table improvements */
  .conjugation-table, .analysis-table {
    font-size: 0.85rem;
    width: 100%;
    overflow-x: auto;
  }
  
  .conjugation-table th,
  .conjugation-table td,
  .analysis-table th,
  .analysis-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  /* Analysis cards improvements */
  .analysis-cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .analysis-card {
    padding: 1rem;
    border-radius: 16px;
  }
  
  .card-header {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }
  
  .card-value {
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
  }
  
  /* Teaching section improvements */
  .teaching-container {
    padding: 0.5rem;
  }
  
  .teaching-controls {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .teaching-verse {
    padding: 1rem;
    border-radius: 16px;
    margin: 1rem 0;
  }
  
  .teaching-actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
  }
  
  .teaching-actions button {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
  }
  
  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Browse section improvements */
  .filters {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .verbs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .verb-card {
    padding: 1rem;
    border-radius: 16px;
  }
  
  /* Search section improvements */
  .search-form {
    padding: 0 0.5rem;
  }
  
  .search-input-group {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
  }
  
  /* Stats section improvements */
  .stats-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .stat-card {
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
  }
  
  .stat-number {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Extra small screen improvements */
  html {
    font-size: 15px;
  }
  
  .container {
    padding: 0 0.5rem;
  }
  
  .header {
    background: rgba(255, 255, 255, 0.95) !important; /* Force white background */
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid #9ca3af !important; /* Force 1px gray border on small screens */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }
  

  
  .nav {
    top: auto !important;
  }
  
  /* REMOVED - nav-btn styles */
  
  .quiz-header h2, .browse-header h2, .search-header h2, .stats-header h2 {
    font-size: 1.25rem;
  }
  
  .verse-text {
    font-size: 1.1rem;
    line-height: 1.8rem;
    padding: 0.75rem 0.25rem;
  }
  
  .word-highlight {
    font-size: 1.25rem;
    padding: 0.75rem;
  }
  
  .btn, .btn-primary, .btn-outline-pill, .btn-filled, .btn-pill-white,
  .lang-btn, #newQuestionBtn, .select-control {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.75rem 0.875rem;
  }
  
  .quiz-option-btn {
    min-height: 48px;
    padding: 0.875rem;
    font-size: 0.9rem;
  }
  
  
  .feedback-whatsapp-btn {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .modal-content {
    width: 98vw;
    max-width: 98vw;
    margin: 1rem auto;
    padding: 0.75rem;
  }
  
  .analysis-cards-container {
    padding: 0 0.25rem;
  }
  
  .analysis-card {
    padding: 0.75rem;
  }
  
  .card-value {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  /* Very small screen improvements */
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 0.25rem;
  }
  
  .header {
    border-bottom: 1px solid #9ca3af; /* Ensure 1px gray border on very small screens */
  }
  
  
  .nav {
    top: auto !important;
  }
  
  /* REMOVED - very small screen nav-btn styles */
  
  .quiz-header h2, .browse-header h2, .search-header h2, .stats-header h2 {
    font-size: 1.1rem;
  }
  
  .verse-text {
    font-size: 1rem;
    line-height: 1.6rem;
    padding: 0.5rem 0.125rem;
  }
  
  .word-highlight {
    font-size: 1.1rem;
    padding: 0.5rem;
  }
  
  .btn, .btn-primary, .btn-outline-pill, .btn-filled, .btn-pill-white,
  .lang-btn, #newQuestionBtn, .select-control {
    min-height: 40px;
    font-size: 0.85rem;
    padding: 0.625rem 0.75rem;
  }
  
  .quiz-option-btn {
    min-height: 44px;
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  

  
  .feedback-whatsapp-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  
  .modal-content {
    width: 99vw;
    max-width: 99vw;
    margin: 0.5rem auto;
    padding: 0.5rem;
  }
  
  .analysis-cards-container {
    padding: 0;
  }
  
  .analysis-card {
    padding: 0.5rem;
  }
  
  .card-value {
    padding: 0.375rem;
    font-size: 0.85rem;
  }
}

/* Landscape orientation fixes */
@media (max-width: 768px) and (orientation: landscape) {
  .nav.active {
    max-height: 200px;
  }
  
  /* REMOVED - landscape nav-btn styles */
  
  .main-content {
    padding: 0.5rem 0;
  }
  
  .quiz-header, .browse-header, .search-header, .stats-header {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .quiz-controls, .top-controls {
    margin: 0.5rem 0;
  }
  
  .verse-display {
    margin: 0.5rem 0;
    padding: 0.75rem;
  }
  
  .verse-text {
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.5rem;
  }
  
  .target-word {
    margin: 0.5rem 0;
  }
  
  .quiz-form {
    margin: 0.5rem 0;
  }
  
  .quiz-actions {
    margin-top: 1rem;
  }
}

/* High DPI screen improvements */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hamburger-line {
    height: 2px;
  }
  
  .btn, .btn-primary, .btn-outline-pill, .btn-filled, .btn-pill-white,
  .lang-btn, #newQuestionBtn, .select-control {
    border-width: 0.5px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn, .btn-primary, .btn-outline-pill, .btn-filled, .btn-pill-white,
  .lang-btn, #newQuestionBtn, .select-control, .quiz-option-btn {
    min-height: 48px;
    min-width: 48px;
  }
  
  /* REMOVED - touch device nav-btn styles */
  
  .feedback-whatsapp-btn {
    min-height: 48px;
    min-width: 48px;
  }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .header {
    background: #ffffff !important; /* Force white background even in dark mode */
    border-bottom: 1px solid #e2e8f0 !important; /* Force gray border */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }
  
  .nav {
    background: #111827 !important; /* Force dark background */
  }
  
  /* REMOVED - dark mode nav-btn styles */
}

/* --- Enhanced Button-Style Dropdown Styles for Pattern Search --- */
.pattern-search-dropdowns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 2rem;
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pattern-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.pattern-dropdown-label {
  color: #1f2937;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-align: left;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 0.25rem;
}

.pattern-dropdown-select {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 1rem 1.25rem;
  padding-right: 3rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.pattern-dropdown-select:hover {
  border-color: #9ca3af;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.pattern-dropdown-select:hover::after {
  border-top-color: #4b5563;
}

.pattern-dropdown-select:focus {
  outline: none;
  border-color: #3b82f6;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.pattern-dropdown-select:focus::after {
  border-top-color: #3b82f6;
}

.pattern-dropdown-select:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Custom dropdown arrow styling */
.pattern-dropdown-select::-ms-expand {
  display: none;
}

/* Dropdown option styling */
.pattern-dropdown-select option {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 2px 0;
}

.pattern-dropdown-select option:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #1f2937;
  font-weight: 600;
}

.pattern-dropdown-select option:checked {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Pattern search results display */
.pattern-search-results {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pattern-search-results .results-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  margin-right: 0.75rem;
  font-size: 0.875rem;
  line-height: 24px;
  text-align: center;
  font-weight: bold;
}

.pattern-search-results .results-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Pattern search filters container */
.pattern-filters-container {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.pattern-filters-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.25rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

/* Responsive design for dropdowns */
@media (max-width: 768px) {
  .pattern-search-dropdowns {
    padding: 0 0.75rem;
    gap: 0.875rem;
    margin: 1.25rem 0;
  }
  
  .pattern-dropdown-group {
    gap: 0.375rem;
  }
  
  .pattern-dropdown-label {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
  }
  
  .pattern-dropdown-select {
    min-height: 52px;
    padding: 1rem 1.125rem;
    padding-right: 2.75rem;
    font-size: 1rem;
    border-radius: 14px;
    background-size: 1.375rem;
    background-position: right 0.875rem center;
  }
  
  .pattern-filters-container {
    padding: 1.25rem;
    border-radius: 18px;
    margin: 1.25rem 0;
  }
  
  .pattern-filters-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
  }
  
  .pattern-search-results {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin: 1.25rem 0;
  }
  
  .pattern-search-results .results-text {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .pattern-search-dropdowns {
    padding: 0 0.5rem;
    gap: 0.75rem;
    margin: 1rem 0;
  }
  
  .pattern-dropdown-select {
    min-height: 56px;
    padding: 1.125rem 1.25rem;
    padding-right: 3rem;
    font-size: 1.05rem;
    border-radius: 16px;
    background-size: 1.5rem;
    background-position: right 1rem center;
  }
  
  .pattern-dropdown-label {
    font-size: 0.95rem;
    font-weight: 700;
  }
  
  .pattern-filters-container {
    padding: 1rem;
    border-radius: 16px;
    margin: 1rem 0;
  }
  
  .pattern-filters-title {
    font-size: 0.95rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
  }
  
  .pattern-search-results {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin: 1rem 0;
  }
  
  .pattern-search-results .results-icon {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    line-height: 20px;
    margin-right: 0.5rem;
  }
  
  .pattern-search-results .results-text {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .pattern-search-dropdowns {
    padding: 0 0.375rem;
    gap: 0.625rem;
    margin: 0.875rem 0;
  }
  
  .pattern-dropdown-select {
    min-height: 52px;
    padding: 1rem 1.125rem;
    padding-right: 2.75rem;
    font-size: 1rem;
    border-radius: 14px;
  }
  
  .pattern-dropdown-label {
    font-size: 0.9rem;
  }
  
  .pattern-filters-container {
    padding: 0.875rem;
    border-radius: 14px;
    margin: 0.875rem 0;
  }
  
  .pattern-filters-title {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
  }
  
  .pattern-search-results {
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    margin: 0.875rem 0;
  }
  
  .pattern-search-results .results-text {
    font-size: 0.9rem;
  }
}

/* Dark mode support for dropdowns */
@media (prefers-color-scheme: dark) {
  .pattern-dropdown-select {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #f9fafb;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  }
  
  .pattern-dropdown-select:hover {
    border-color: #6b7280;
    background-color: #374151;
  }
  
  .pattern-dropdown-select:focus {
    border-color: #60a5fa;
    background-color: #374151;
  }
  
  .pattern-dropdown-select option {
    background-color: #1f2937;
    color: #f9fafb;
  }
  
  .pattern-dropdown-select option:hover {
    background-color: #374151;
  }
  
  .pattern-dropdown-select option:checked {
    background-color: #3b82f6;
    color: #ffffff;
  }
  
  .pattern-dropdown-label {
    color: #f9fafb;
  }
  
  .pattern-filters-container {
    background-color: #1f2937;
    border-color: #4b5563;
  }
  
  .pattern-filters-title {
    color: #f9fafb;
    border-bottom-color: #4b5563;
  }
  
  .pattern-search-results {
    background-color: #374151;
    border-color: #4b5563;
  }
  
  .pattern-search-results .results-text {
    color: #f9fafb;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pattern-dropdown-select {
    border-width: 2px;
    border-color: #000000;
  }
  
  .pattern-dropdown-select:focus {
    border-color: #0000ff;
    box-shadow: 0 0 0 3px #0000ff;
  }
  
  .pattern-filters-container {
    border-width: 2px;
    border-color: #000000;
  }
  
  .pattern-filters-title {
    border-bottom-width: 2px;
    border-bottom-color: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .pattern-dropdown-select {
    transition: none;
  }
  
  .pattern-dropdown-select:hover {
    transform: none;
  }
  
  .pattern-dropdown-select:active {
    transform: none;
  }
}

/* Focus visible support for better accessibility */
.pattern-dropdown-select:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Button-like inner shadow effect */
.pattern-dropdown-select::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

/* Custom dropdown arrow - positioned on the right */
.pattern-dropdown-select::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #6b7280;
  pointer-events: none;
  z-index: 2;
  transition: all 0.2s ease;
}

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
  .pattern-dropdown-select {
    min-height: 60px;
    padding: 1.25rem 1.5rem;
    padding-right: 3.5rem;
    font-size: 1.1rem;
  }
  
  .pattern-dropdown-label {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .pattern-dropdown-select option {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
  }
}

/* Print styles */
@media print {
  .pattern-search-dropdowns,
  .pattern-filters-container,
  .pattern-search-results {
    display: none;
  }
}

/* --- Enhanced Teaching Section Dropdown Styling --- */
.filters-section {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  justify-content: center;
  align-items: center;
}

.filters-section .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  max-width: 200px;
}

.filters-section .filter-group label {
  color: #1f2937;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-align: left;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 0.25rem;
}

.filters-section .filter-group select {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 1rem 1.25rem;
  padding-right: 3rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.filters-section .filter-group select:hover {
  border-color: #9ca3af;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.filters-section .filter-group select:focus {
  outline: none;
  border-color: #3b82f6;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.filters-section .filter-group select:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Custom dropdown arrow styling */
.filters-section .filter-group select::-ms-expand {
  display: none;
}

/* Custom dropdown arrow - positioned on the right */
.filters-section .filter-group select::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #6b7280;
  pointer-events: none;
  z-index: 2;
  transition: all 0.2s ease;
}

.filters-section .filter-group select:hover::after {
  border-top-color: #4b5563;
}

.filters-section .filter-group select:focus::after {
  border-top-color: #3b82f6;
}

/* Dropdown option styling */
.filters-section .filter-group select option {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 2px 0;
}

.filters-section .filter-group select option:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #1f2937;
  font-weight: 600;
}

.filters-section .filter-group select option:checked {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Button-like inner shadow effect */
.filters-section .filter-group select::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

/* Focus visible support for better accessibility */
.filters-section .filter-group select:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Responsive design for teaching dropdowns */
@media (max-width: 768px) {
  .filters-section {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    margin: 1.5rem 0;
    max-width: 500px;
  }
  
  .filters-section .filter-group {
    gap: 0.5rem;
    max-width: 100%;
  }
  
  .filters-section .filter-group label {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }
  
  .filters-section .filter-group select {
    min-height: 52px;
    padding: 1rem 1.125rem;
    padding-right: 2.75rem;
    font-size: 1rem;
    border-radius: 14px;
  }
}

@media (max-width: 600px) {
  .filters-section {
    padding: 1.25rem;
    gap: 1rem;
    margin: 1.25rem 0;
    max-width: 450px;
  }
  
  .filters-section .filter-group label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  .filters-section .filter-group select {
    min-height: 48px;
    padding: 0.875rem 1rem;
    padding-right: 2.5rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .filters-section {
    padding: 1rem;
    gap: 0.875rem;
    margin: 1rem 0;
    max-width: 400px;
  }
  
  .filters-section .filter-group {
    gap: 0.375rem;
  }
  
  .filters-section .filter-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }
  
  .filters-section .filter-group select {
    min-height: 44px;
    padding: 0.75rem 0.875rem;
    padding-right: 2.25rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
  .filters-section .filter-group select {
    min-height: 60px;
    padding: 1.25rem 1.5rem;
    padding-right: 3.5rem;
    font-size: 1.1rem;
  }
  
  .filters-section .filter-group label {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .filters-section .filter-group select option {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
  }
}

/* Print styles */
@media print {
  .filters-section {
    display: none;
  }
}

/* Language Switcher - REMOVED */

/* Language toggle switch styles - REMOVED */

/* Toggle track and slider styles - REMOVED */

/* RTL and language toggle styles - REMOVED */

/* Mobile language switcher styles - REMOVED */

/* Quiz content can use RTL while navbar stays fixed */
#quiz.rtl,
#teaching.rtl {
  direction: rtl;
  text-align: right;
}

#quiz.rtl .quiz-header,
#teaching.rtl .teaching-header {
  direction: rtl;
  text-align: right;
}

#quiz.rtl .quiz-controls,
#teaching.rtl .teaching-controls {
  direction: rtl;
}

#quiz.rtl .control-group,
#teaching.rtl .control-group {
  direction: rtl;
}

/* Ensure quiz options and content can flow RTL when needed */
#quiz.rtl .quiz-form,
#quiz.rtl .quiz-actions {
  direction: rtl;
}

/* Enhanced Urdu mode styling */
#quiz.rtl .quiz-header h1,
#quiz.rtl .quiz-header p {
  text-align: center;
  direction: rtl;
  margin: 0 auto;
  max-width: 100%;
}

#quiz.rtl .quiz-header {
  text-align: center;
  direction: rtl;
}

#quiz.rtl .quiz-controls {
  text-align: center;
  direction: rtl;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  margin: 1rem auto 2rem auto !important;
  width: fit-content !important;
}

#quiz.rtl .control-group {
  text-align: center;
  direction: rtl;
  display: flex;
  flex-direction: row-reverse !important;
  align-items: center;
  margin: 0 !important;
}

#quiz.rtl .btn,
#quiz.rtl button {
  text-align: center;
  direction: rtl;
  margin: 0 auto;
}

#quiz.rtl .select-control {
  text-align: center;
  direction: rtl;
  margin: 0 auto;
  min-width: 200px;
}

#quiz.rtl .select-control option {
  text-align: center;
  direction: rtl;
}

/* Urdu text spacing and readability */
#quiz.rtl .urdu-font,
#teaching.rtl .urdu-font {
  letter-spacing: 0.03em;
  word-spacing: 0.1em;
  line-height: 1.8;
  text-align: center;
}

/* Better Urdu button styling in RTL mode */
#quiz.rtl .btn.urdu-font,
#quiz.rtl button.urdu-font {
  padding: 0.875rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin: 0 auto;
  display: block;
}

/* Center all quiz content in Urdu mode */
#quiz.rtl .quiz-container {
  text-align: center;
  direction: rtl;
}

#quiz.rtl .quiz-header,
#quiz.rtl .quiz-controls,
#quiz.rtl .quiz-question,
#quiz.rtl .quiz-actions {
  text-align: center;
  direction: rtl;
}

/* Additional centering for Urdu mode */
#quiz.rtl .quiz-controls {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem !important;
}

#quiz.rtl .control-group {
  display: flex;
  flex-direction: row-reverse !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: none !important;
}

#quiz.rtl .control-group label {
  text-align: center;
  margin-bottom: 0.5rem;
  width: 100%;
}

#quiz.rtl .control-group select,
#quiz.rtl .control-group button {
  text-align: center;
  margin: 0 auto;
  width: 100%;
  max-width: 250px;
}

/* Ensure proper spacing in Urdu mode */
#quiz.rtl .quiz-header h1,
#quiz.rtl .quiz-header p {
  margin-bottom: 1rem;
}

#quiz.rtl .quiz-controls {
  margin: 2rem 0;
}

/* REMOVED - nav-btn active border handling */

/* Responsive compact pill navbar overrides */
@media (max-width: 768px) {
  body { margin: 0 !important; padding: 0 !important; }
  .header { 
    background: transparent !important;
    padding: 0 !important;
    min-height: 0 !important;
    margin: 2rem 0 0 0 !important;
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
  }
 
  .logo { display: none !important; }
  .hamburger-menu { display: none !important; }
  
  /* Show the nav as a standalone pill */
  .nav {
    display: flex !important;
    width: fit-content !important;
    max-width: min(900px, calc(100% - 2rem)) !important;
    background: #111827 !important;
    border-radius: 9999px !important;
    padding: 0.45rem 3.75rem 0.45rem 0.6rem !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    gap: 0.35rem !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    min-height: 40px !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1000 !important;
    align-self: center !important;
  }
  
/* Perfect Pill Navbar Design */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: transparent;
  padding: 1rem 0;
  margin: 2rem 0 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Navbar styling for all screen sizes - High specificity */
.header .nav,
#mainNav.nav,
nav.nav {
  display: flex !important;
  width: 100% !important;
  max-width: 1100px !important;
  background: #111827 !important;
  border-radius: 9999px !important;
  padding: 0.5rem 1.5rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  gap: 1rem !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
  min-height: 45px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 1000 !important;
  align-self: center !important;
  justify-content: space-between !important;
  top: auto !important;
}

/* Ensure navbar styles for large screens */
@media (min-width: 921px) {
  .header .nav,
  #mainNav.nav,
  nav.nav {
    display: flex !important;
    width: 100% !important;
    max-width: 1100px !important;
    background: #111827 !important;
    border-radius: 9999px !important;
    padding: 0.6rem 1.75rem !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    gap: 1.25rem !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    min-height: 50px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1000 !important;
    align-self: center !important;
    justify-content: space-between !important;
    top: auto !important;
  }
}

/* Final override for navbar - maximum specificity */
body .header .nav,
body #mainNav.nav,
body nav.nav {
  display: flex !important;
  width: 100% !important;
  max-width: 1100px !important;
  background: #111827 !important;
  border-radius: 9999px !important;
  padding: 0.5rem 1.5rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  gap: 1rem !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
  min-height: 45px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 1000 !important;
  align-self: center !important;
  justify-content: space-between !important;
  top: auto !important;
}


.nav-buttons {
  display: flex !important;
  gap: 0 !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  min-width: 160px !important;
  max-width: 250px !important;
  flex: 1 1 auto !important;
}

.nav-btn {
  background: transparent !important;
  color: #000000 !important;
  border: none !important;
  padding: 0.4rem 1rem !important;
  border-radius: 9px !important;
  font-weight: 600 !important;
  font-size: clamp(0.75rem, 2vw, 0.875rem) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  min-height: 32px !important;
  position: relative !important;
  letter-spacing: 0.025em !important;
  flex: 1 !important;
  white-space: nowrap !important;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  cursor: pointer !important;
}

.nav-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.nav-btn i {
  font-size: 1rem;
}


/* RESPONSIVE NAVBAR STYLES - Apply to all screens */
.header {
  background: transparent !important;
  padding: 0 !important;
  margin: 1rem 0 0 0 !important;
  display: block !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  width: 100% !important;
}

.header-content {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  background: #111827 !important;
  border-radius: 0 !important;
  padding: 0.5rem 1.5rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  gap: 1rem !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
  min-height: 45px !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 1000 !important;
  justify-content: space-between !important;
  top: auto !important;
  flex-wrap: nowrap !important;
}

.nav-title {
  color: #e5e7eb !important;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem) !important;
  white-space: nowrap !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

/* Modern Classic Language Switcher */
.language-switcher-nav {
  position: relative !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  padding: 3px !important;
  display: flex !important;
  align-items: center !important;
  width: clamp(80px, 15vw, 100px) !important;
  height: 32px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  flex-shrink: 0 !important;
}

.language-switcher-nav .lang-option {
  color: #a1a1aa !important;
  font-size: clamp(0.65rem, 1.8vw, 0.75rem) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: center !important;
  width: 50% !important;
  height: 26px !important;
  white-space: nowrap !important;
  position: relative !important;
  z-index: 2 !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  letter-spacing: 0.05em !important;
}

.language-switcher-nav .lang-option:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  cursor: pointer !important;
}

.language-switcher-nav .lang-option.active {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #1f2937 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-1px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Sliding animation for toggle effect */
.language-switcher-nav[data-lang="ur"] .lang-option[data-lang="en"] {
  transform: translateX(0) !important;
}

.language-switcher-nav[data-lang="ur"] .lang-option[data-lang="ur"] {
  transform: translateX(0) !important;
}




.nav-buttons {
  display: flex;
  gap: 0;
  align-items: center;
}

.nav-btn {
  background: #f8fafc;
  color: #1e3a8a;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  position: relative;
}


/* Responsive Design - Mobile First */
@media (max-width: 480px) {
  .nav {
    padding: 0.4rem 1rem !important;
    gap: 0.5rem !important;
    min-height: 40px !important;
    max-width: 95% !important;
  }
  
  .nav-title {
    font-size: 0.8rem !important;
    display: none !important; /* Hide title on very small screens */
  }
  
  .nav-buttons {
    min-width: 140px !important;
    max-width: 200px !important;
  }
  
  .nav-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
    min-height: 28px !important;
    gap: 0.3rem !important;
  }
  
  .language-switcher-nav {
    width: 70px !important;
    height: 28px !important;
  }
  
  .language-switcher-nav .lang-option {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.3rem !important;
    height: 24px !important;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 0.4rem 1.2rem !important;
    gap: 0.8rem !important;
    min-height: 42px !important;
    max-width: 92% !important;
  }
  
  .nav-title {
    font-size: 0.9rem !important;
  }
  
  .nav-buttons {
    min-width: 150px !important;
    max-width: 220px !important;
  }
  
  .nav-btn {
    padding: 0.35rem 0.8rem !important;
    font-size: 0.75rem !important;
    min-height: 30px !important;
  }
  
  .language-switcher-nav {
    width: 80px !important;
    height: 30px !important;
  }
  
  .language-switcher-nav .lang-option {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.4rem !important;
    height: 26px !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .nav {
    padding: 0.5rem 1.8rem !important;
    gap: 1.2rem !important;
    min-height: 48px !important;
    max-width: 85% !important;
  }
  
  .nav-title {
    font-size: 1.1rem !important;
  }
  
  .nav-buttons {
    min-width: 180px !important;
    max-width: 240px !important;
  }
  
  .nav-btn {
    padding: 0.45rem 1.2rem !important;
    font-size: 0.8rem !important;
    min-height: 34px !important;
  }
  
  .language-switcher-nav {
    width: 90px !important;
    height: 34px !important;
  }
  
  .language-switcher-nav .lang-option {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.6rem !important;
    height: 28px !important;
  }
}

@media (min-width: 1025px) {
  .nav {
    padding: 0.6rem 2rem !important;
    gap: 1.5rem !important;
    min-height: 50px !important;
    max-width: 800px !important;
  }
  
  .nav-title {
    font-size: 1.2rem !important;
  }
  
  .nav-buttons {
    min-width: 200px !important;
    max-width: 250px !important;
  }
  
  .nav-btn {
    padding: 0.5rem 1.5rem !important;
    font-size: 0.875rem !important;
    min-height: 36px !important;
  }
  
  .language-switcher-nav {
    width: 100px !important;
    height: 36px !important;
  }
  
  .language-switcher-nav .lang-option {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.8rem !important;
    height: 30px !important;
  }
}

/* Large Screen Styles (greater than 768px) */
@media (min-width: 769px) {
  .header {
    background: transparent !important;
    padding: 0 !important;
    margin: 2rem 0 0 0 !important;
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
  }
  
  .header-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1200px !important;
    padding: 0 1rem !important;
    margin: 0 auto !important;
  }
  
  .nav {
    display: flex !important;
    width: fit-content !important;
    max-width: 800px !important;
    background: #111827 !important;
    border-radius: 9999px !important;
    padding: 0.6rem 2rem !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    gap: 1.5rem !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    min-height: 50px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1000 !important;
    justify-content: space-between !important;
    top: auto !important;
  }
  
  .nav-title {
    color: #e5e7eb !important;
    font-family: 'Amiri', serif !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  
  .nav-buttons {
    display: flex !important;
    gap: 0 !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px !important;
  }
  
  .nav-btn {
    background: transparent !important;
    color: #a1a1aa !important;
    border: none !important;
    padding: 0.5rem 1.8rem !important;
    border-radius: 9px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    min-height: 36px !important;
    position: relative !important;
    letter-spacing: 0.025em !important;
    flex: 1 !important;
  }
  
  .nav-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
  }
  
  .nav-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  
  .language-switcher-nav {
    position: relative !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    padding: 3px !important;
    display: flex !important;
    align-items: center !important;
    width: 100px !important;
    height: 32px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
  }
  
  .language-switcher-nav .lang-option {
    color: #a1a1aa !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 0.3rem 1rem !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: center !important;
    width: 50% !important;
    height: 26px !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 2 !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    letter-spacing: 0.05em !important;
  }
  
  .language-switcher-nav .lang-option:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
  }
  
  .language-switcher-nav .lang-option.active {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #1f2937 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 0.3rem 1rem;
    gap: 0.75rem;
    min-height: 40px;
    max-width: 95%;
  }
  
  .nav-title {
    font-size: 0.95rem;
  }
  
  .nav-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-height: 26px;
  }
  
  .nav-btn i {
    font-size: 0.85rem;
  }
  
  .lang-option {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
  }
}

/* FINAL OVERRIDE - Force navbar styles for all screen sizes */
nav#mainNav.nav,
.header nav.nav,
body .header nav.nav,
html body .header nav.nav,
html body nav.nav {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  padding: 0.6rem 1.75rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  gap: 1rem !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
  min-height: 48px !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 1000 !important;
  align-self: center !important;
  justify-content: space-between !important;
  top: auto !important;
}

/* ULTIMATE OVERRIDE - Target specific HTML structure */
header nav#mainNav.nav[role="navigation"] {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  padding: 0.6rem 1.75rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  gap: 1rem !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
  min-height: 48px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 1000 !important;
  align-self: center !important;
  justify-content: space-between !important;
  top: auto !important;
}
}

/* ===== FINAL UNIFIED HEADER + NAV THEME (authoritative) ===== */
/* This block normalizes all header/nav styles across breakpoints. */
header.header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: transparent !important;
  margin-top: 12px !important;
}

.header-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 12px !important;
}

/* Pill navbar container */
nav#mainNav.nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(0.5rem, 2.5vw, 1.25rem) !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 12px !important;
  padding: clamp(8px, 1.6vw, 12px) clamp(16px, 3vw, 24px) !important;
  white-space: nowrap !important;
}

/* Brand title */
nav#mainNav.nav .nav-title {
  color: #111827 !important;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem) !important;
  letter-spacing: 0.2px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
}

/* Segmented control (Quiz/Teaching) */
nav#mainNav.nav .nav-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  flex: 1 1 320px !important;
  max-width: 420px !important;
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 3px !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.02) !important;
}

nav#mainNav.nav .nav-btn {
  flex: 1 1 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: clamp(30px, 5.5vw, 36px) !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: none !important;
  background: transparent !important;
  color: #374151 !important;
  font-weight: 600 !important;
  font-size: clamp(0.75rem, 1.8vw, 0.9rem) !important;
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease !important;
}

nav#mainNav.nav .nav-btn:hover { background: #e5e7eb !important; color: #111827 !important; transform: translateY(-1px) !important; }

nav#mainNav.nav .nav-btn.active {
  background: black !important;
  color: #fff !important;
}

/* Language switcher */
nav#mainNav.nav .language-switcher-nav {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  width: clamp(84px, 16vw, 110px) !important;
  height: clamp(30px, 5.5vw, 36px) !important;
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  padding: 3px !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.02) !important;
}

nav#mainNav.nav .language-switcher-nav .lang-option {
  flex: 1 1 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  border-radius: 999px !important;
  color: #374151 !important;
  font-weight: 700 !important;
  font-size: clamp(0.7rem, 1.6vw, 0.8rem) !important;
  letter-spacing: .02em !important;
  background: transparent !important;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease !important;
}

nav#mainNav.nav .language-switcher-nav .lang-option:hover { background: #e5e7eb !important; color: #111827 !important; transform: translateY(-1px) !important; }

nav#mainNav.nav .language-switcher-nav .lang-option.active {
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.08) !important;
}

/* Layout behavior on narrow screens */
@media (max-width: 640px) {
  nav#mainNav.nav { gap: 10px !important; padding: 8px 12px !important; }
  nav#mainNav.nav .nav-title { display: none !important; }
  nav#mainNav.nav .nav-buttons { flex: 1 1 auto !important; max-width: none !important; }
}

/* Layout behavior on very large screens */
@media (min-width: 1280px) {
  nav#mainNav.nav { max-width: 1100px !important; }
}

/* ===== FINAL LANGUAGE PARITY OVERRIDES (EN = UR look) ===== */
/* Keep RTL where needed but unify sizes, spacing, and weights across languages */
.urdu-font {
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

/* Edge-to-edge navbar with 2px inset on left and right */
header nav#mainNav.nav,
nav#mainNav.nav {
  width: calc(100% - 4px) !important;
  margin: 0 2px !important;
  border-radius: 0 !important;
}

/* ===== Final button color override (global) ===== */
button,
.btn,
.btn-primary,
.btn-filled,
.btn-outline-pill,
.btn-pill-white,
#newQuestionBtn,
.btn-nav,
.quiz-actions .btn,
#submitAnswerBtn,
.language-switcher-nav .lang-option.active {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
  box-shadow: none !important;
}

button:hover,
.btn:hover,
.btn-primary:hover,
.btn-filled:hover,
.btn-outline-pill:hover,
.btn-pill-white:hover,
#newQuestionBtn:hover,
.btn-nav:hover,
.quiz-actions .btn:hover,
#submitAnswerBtn:hover { opacity: 0.95 !important; }

.quiz-header h1,
.quiz-header h1.urdu-font {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #111827 !important;
  text-align: center !important;
  margin-bottom: 0.75rem !important;
}

.quiz-header p,
.quiz-header p.urdu-font {
  font-size: clamp(1rem, 2.2vw, 1.125rem) !important;
  line-height: 1.7 !important;
  color: #4b5563 !important;
  text-align: center !important;
  margin: 0 auto 1.25rem auto !important;
  max-width: 900px !important;
}

/* Make primary CTA consistent across languages */
#newQuestionBtn,
#newTeachingVerseBtn,
#applyFiltersBtn,
.btn.btn-primary,
.btn.urdu-font.btn-primary,
button.urdu-font.btn-primary {
  font-size: clamp(0.95rem, 2vw, 1.05rem) !important;
  font-weight: 700 !important;
  padding: 0.9rem 1.6rem !important;
  border-radius: 999px !important;
}

/* ===== EXAM PAGE (prototype) ===== */
.exam-container { display: flex; flex-direction: column; gap: 16px; padding: 12px 8px; }
.exam-row { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; }
.exam-group { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.exam-label { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-weight: 700; color: #111827; text-align: center; margin: 0 0 6px 0; }
.exam-actions { display: flex; justify-content: center; padding-top: 8px; }

.exam-results { margin-top: 8px; }
/* Removed legacy flat list styles from early prototype */

/* Exam tables and action bar */
.exam-summary { display: flex; gap: 24px; justify-content: flex-start; margin: 6px 0 10px; }
.exam-actionbar { display: flex; gap: 10px; justify-content: flex-end; margin: 8px 0; }
.exam-tables { margin-top: 8px; }
.exam-table { width: 100%; border-collapse: collapse; background: #fff; }
.exam-table th, .exam-table td { border: 1px solid #d1d5db; padding: 8px 10px; text-align: left; }
.exam-table th { background: #f3f4f6; font-weight: 700; }
.hidden { display: none !important; }

/* ===== Custom Multi-Select Dropdown ===== */
.select-control.hidden-native { display: none !important; }
.multi-select { position: relative; width: 100%; }
.multi-select .ms-control { width: 100%; padding: 10px 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.04) inset; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.multi-select .ms-value { color: #111827; font-size: 0.95rem; }
.multi-select .ms-caret { color: #6b7280; font-size: 0.9rem; }
.multi-select .ms-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid #d1d5db; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.12); z-index: 2000; padding: 8px; max-height: 260px; overflow: auto; display: none; }
.multi-select.open .ms-menu { display: block; }
.multi-select .ms-search { padding: 6px 8px; }
.multi-select .ms-search input { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 0.95rem; }
.multi-select .ms-actions { display: flex; gap: 8px; padding: 6px 8px; }
.multi-select .ms-actions button { padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; cursor: pointer; }
.multi-select .ms-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.multi-select .ms-option:hover { background: #f3f4f6; }
.multi-select .ms-option input { width: 16px; height: 16px; }
.multi-select .ms-label { font-size: 0.95rem; }

/* ===== Fixed Header/Navbar ===== */
body .header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 10px 0 0 0 !important;
}

/* Ensure container content is pushed below the fixed header */
body .container, body .main-content {
  padding-top: 90px !important;
}

@media (max-width: 640px) {
  body .container, body .main-content { padding-top: 72px !important; }
}

/* Inputs sizing to mimic prototype */
#examBaab.select-control, #examAfaal.select-control { min-height: 40px; }
#examCount.input-control { min-height: 40px; }

/* Restyled and centered number input */
#examCount.input-control {
  width: clamp(80px, 10vw, 120px) !important;
  height: 44px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid #d1d5db !important;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(0,0,0,.06) !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: #111827 !important;
  margin: 0 auto !important;
}
#examCount.input-control:hover { border-color: #cbd5e1 !important; }
#examCount.input-control:focus { outline: none !important; border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,.2) !important; }

/* Hide default number spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

@media (max-width: 768px) {
  .exam-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .exam-label { text-align: left; }
}