/* 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 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    margin: 0 !important;
    padding: 0 1rem !important;
    min-height: 64px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-bottom: none; /* Remove the separate bottom border */
}

/* Mobile header adjustments */
@media (max-width: 768px) {
    .header-content {
        padding: 0 0.75rem !important;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem !important;
        min-height: 56px;
    }
}

/* Optionally, if you want the logo and nav to be tightly grouped and centered as a unit: */
.header-content {
    flex-direction: row;
}

.logo, .nav {
    /* No float or margin-left/right, just flex children */
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: #4a5568;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Remove the separate header::after line since we're using border-bottom */
.header::after {
    display: none;
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 2;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
    .nav {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav {
        gap: 1rem;
    }
}

.nav-btn {
    position: relative;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    transition: color 0.2s;
    overflow: visible;
    margin: 0 !important;
    padding: 0 0 0.5rem 0 !important;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.nav-btn::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80px;
    bottom: 0px; /* Position the underline to connect with the header border */
    height: 1px; /* Changed to 1px underline */
    background: #667eea !important; /* Blue underline that merges with border */
    border-radius: 0; /* Remove border radius for seamless merge */
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    transform-origin: center;
    z-index: 3; /* Higher z-index to overlay the border */
}

.nav-btn.active,
.nav-btn:not(.active):hover {
    color: #222 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.nav-btn.active::after,
.nav-btn:not(.active):hover::after {
    transform: translateX(-50%) scaleX(1) !important;
}

/* Debug: Make sure active nav button is visible */
.nav-btn.active {
    color: #222 !important;
    font-weight: 600 !important;
}

.nav-btn.active::after {
    background: #667eea !important; /* Consistent blue color */
    transform: translateX(-50%) scaleX(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile Navigation Styles */
@media (max-width: 920px) {
    .header-content {
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem !important;
    }
    .hamburger-menu {
        display: flex;
    }
    .nav {
        position: absolute;
        top: 64px;
        left: 0;
        width: 100vw;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        padding-top: 0 !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.07);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(.4,0,.2,1);
        z-index: 20;
    }
    .nav.active {
        max-height: 400px;
        /* enough for 4-5 nav items */
        transition: max-height 0.35s cubic-bezier(.4,0,.2,1);
        box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    }
    .nav-btn {
        width: 100%;
        max-width: 300px;
        padding: 1rem 2rem !important;
        margin: 0.5rem 0 !important;
        font-size: 1.2rem;
        justify-content: center;
        border-radius: 12px;
        background: rgba(255,255,255,0.8) !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .nav-btn::after {
        display: none;
    }
    
    /* Mobile nav button active state with bottom border */
    .nav-btn.active {
        border-bottom: 1px solid #667eea !important;
        background: rgba(102, 126, 234, 0.1) !important;
    }
    .nav-btn.active,
    .nav-btn:not(.active):hover {
        background: #667eea !important;
        color: white !important;
        border-color: #667eea !important;
        box-shadow: 0 4px 12px rgba(102,126,234,0.3) !important;
    }
    
    /* Ensure mobile nav buttons also have consistent styling */
    .nav-btn.active {
        border-bottom: 1px solid #667eea !important;
    }
    
    /* Mobile nav button active state with blue underline */
    .nav-btn.active::after {
        transform: translateX(-50%) scaleX(1) !important; /* Show the underline */
        background: #667eea !important; /* Blue underline */
    }
    .logo {
        font-size: 1.1rem;
    }
    .logo span {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem !important;
    }
    .nav-btn {
        max-width: 280px;
        padding: 0.8rem 1.5rem !important;
        font-size: 1.1rem;
    }
    .logo {
        font-size: 1rem;
    }
}

/* 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;
}

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

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

/* 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: #86efac;
    color: #374151;
    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: #86efac;
  color: #374151;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  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);
}
.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 Options */
.language-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-option:hover {
    /* No hover effect */
}

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

.language-option input[type="radio"]:checked + .language-label {
    color: #667eea;
    font-weight: 600;
}

.language-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.language-label {
    color: #4a5568;
    transition: color 0.2s ease;
}

.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: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* 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 0.5rem;
}

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

.control-group label {
    color: white;
    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-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Mobile quiz form adjustments */
@media (max-width: 768px) {
    .quiz-form {
        margin-bottom: 1.5rem;
    }
    
    .quiz-option-group {
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }
}

@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-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: 14px 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, .nav-btn, .quiz-option-btn, .btn-filled, .btn-outline-pill, .btn-pill-white {
    min-height: 48px;
    min-width: 48px;
    font-size: 1.1rem;
  }
}

@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, .nav-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,
body[dir="rtl"] .result-property {
    font-family: 'JameelNooriNastaleeq', 'Amiri', serif, sans-serif;
} 

.urdu-font {
    font-family: 'JameelNooriNastaleeq', 'Noorehuda', 'Amiri', serif;
} 

#submitAnswerBtn {
  background: #fff !important;
  color: #222 !important;
  border: 2.5px solid #222 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 1rem;
  padding: 10px 32px !important;
  box-shadow: none !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: box-shadow 0.25s, border-color 0.25s, background 0.25s, color 0.25s;
}
#submitAnswerBtn:hover, #submitAnswerBtn:focus {
  /* No hover effect */
} 

.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', 'Noto Naskh Arabic', 'Amiri', serif;
} 

.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: #86efac !important;
  color: #374151 !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-bottom: 0.2rem;
  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 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #222;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.logo i {
    font-size: 2.2rem;
    color: #222;
} 
.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;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  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;
}

.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;
    }
    
    .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;
    }
    
    .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;
    }
    
    .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 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem 0;
}

.root-variations-pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.root-variations-pagination button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.root-variations-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.root-variations-pagination .page-info {
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-radius: 0.375rem;
  font-weight: 500;
}

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

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

.conjugation-table th,
.conjugation-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.conjugation-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #4a5568;
}

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

.conjugation-table .arabic-text {
  font-family: 'Noorehuda', 'Amiri', serif;
  font-size: 1.1rem;
  direction: rtl;
  text-align: right;
}

.conjugation-table tbody tr:hover {
  background: #f7fafc;
}

/* 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;
  }
}

/* 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 improvements */
  .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    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 mobile */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }
  
  .header-content {
    padding: 0 1rem !important;
    min-height: 60px;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo {
    font-size: 1rem;
    flex-shrink: 0;
  }
  
  .logo span {
    display: none;
  }
  
  /* Navigation improvements */
  .nav {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100vw;
    height: auto;
    max-height: 0;
    background: rgba(255, 255, 255, 0.98) !important; /* Force white background */
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
  }
  
  .nav.active {
    max-height: 300px;
    padding: 1rem 0;
  }
  
  .nav-btn {
    width: 90%;
    max-width: 280px;
    padding: 1rem 1.5rem !important;
    margin: 0.25rem 0 !important;
    font-size: 1.1rem;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    color: #374151 !important; /* Ensure proper text color */
    position: relative !important; /* Required for absolute positioning of ::after */
  }
  
  .nav-btn::after {
    content: '' !important;
    display: block !important; /* Show the underline on mobile */
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) scaleX(0) !important; /* Start hidden */
    width: 80px !important;
    bottom: 0px !important; /* Position to merge with border */
    height: 1px !important; /* 1px underline */
    background: #667eea !important; /* Blue underline */
    border-radius: 0 !important; /* No border radius for seamless merge */
    transition: transform 0.3s cubic-bezier(.4,0,.2,1) !important;
    transform-origin: center !important;
    z-index: 3 !important; /* Higher z-index to overlay border */
  }
  
  .nav-btn.active::after {
    transform: translateX(-50%) scaleX(1) !important; /* Show underline when active */
  }
  
  /* Main content improvements */
  .main-content {
    padding: 1rem 0;
    margin-top: 0;
  }
  
  /* Quiz container improvements */
  .quiz-container, .browse-container, .search-container, .stats-container {
    max-width: 100%;
    padding: 0.5rem;
    margin: 0;
  }
  
  .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;
  }
  
  #submitAnswerBtn {
    width: 100%;
    min-height: 56px;
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 12px;
  }
  
  /* 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;
  }
  
  .header-content {
    padding: 0 0.5rem !important;
    min-height: 56px;
  }
  
  .nav {
    top: 56px;
  }
  
  .nav-btn {
    width: 95%;
    max-width: 260px;
    padding: 0.875rem 1.25rem !important;
    font-size: 1rem;
  }
  
  .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;
  }
  
  #submitAnswerBtn {
    min-height: 48px;
    font-size: 1rem;
    padding: 0.875rem;
  }
  
  .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 */
  }
  
  .header-content {
    padding: 0 0.25rem !important;
    min-height: 52px;
  }
  
  .nav {
    top: 52px;
  }
  
  .nav-btn {
    width: 98%;
    max-width: 240px;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem;
  }
  
  .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;
  }
  
  #submitAnswerBtn {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.75rem;
  }
  
  .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;
  }
  
  .nav-btn {
    padding: 0.75rem 1.25rem !important;
    margin: 0.125rem 0 !important;
  }
  
  .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;
  }
  
  .nav-btn {
    min-height: 48px;
    min-width: 48px;
  }
  
  .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: #ffffff !important; /* Force white background */
  }
  
  .nav-btn {
    background: rgba(255, 255, 255, 0.9) !important; /* Force white background */
    border-color: #e2e8f0 !important; /* Force light border */
    color: #374151 !important; /* Force dark text */
  }
  
  .nav-btn.active,
  .nav-btn:not(.active):hover {
    background: #667eea !important;
    border-color: #667eea !important;
    color: white !important;
  }
}

/* --- 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;
  }
}