/* Urdu Graded Vocabulary - Main Stylesheet */

/* ===== BASE STYLES ===== */
* {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
}

body {
    direction: rtl;
    text-align: right;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* ===== NAVIGATION ===== */
.navbar {
    background-color: #374151 !important;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    padding: 0;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255,255,255,0.1);
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
}

.dropdown-menu {
    text-align: right;
    direction: rtl;
    background-color: #374151;
    border: none;
}

.dropdown-item {
    color: rgba(255,255,255,0.9);
}

.dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    padding: 4rem 0 3rem;
    margin-bottom: 3rem;
    color: white;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* ===== SEARCH BOX ===== */
.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    direction: rtl;
    text-align: right;
}

.search-box input:focus {
    outline: none;
}

.search-box button {
    background: #0891b2;
    border: none;
    padding: 1rem 2rem;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #0e7490;
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-heading i {
    color: #06b6d4;
}

.section-heading--center {
    text-align: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: #1e293b;
}

/* ===== GRADE CARDS ===== */
.grades-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grade-card {
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: white;
    border: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    filter: brightness(1.1);
}

/* Grade Colors */
.grade-1 {
    background: #16a34a;
}

.grade-2 {
    background: #2563eb;
}

.grade-3 {
    background: #ea580c;
}

.grade-4 {
    background: #dc2626;
}

.grade-5 {
    background: #9333ea;
}

.grade-card .card-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.5rem;
}

.grade-card .grade-number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
}

.grade-1 .grade-number { color: white; }
.grade-2 .grade-number { color: white; }
.grade-3 .grade-number { color: white; }
.grade-4 .grade-number { color: white; }
.grade-5 .grade-number { color: white; }

.grade-card .word-count-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.25rem;
}

.grade-card .word-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

/* ===== GRADE BADGES ===== */
.grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.grade-badge-1 {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.grade-badge-2 {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.grade-badge-3 {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.grade-badge-4 {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.grade-badge-5 {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
}

/* ===== WORD COUNT BADGE ===== */
.word-count-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
}

.word-count-zero {
    color: #9ca3af;
}

/* ===== TRANSLATION STATUS ICONS ===== */
.translation-status-yes {
    color: #10b981;
    font-weight: bold;
    font-size: 18px;
}

.translation-status-no {
    color: #ef4444;
    font-weight: bold;
    font-size: 18px;
}

.translation-missing {
    color: #ef4444;
    font-style: italic;
}

.translation-missing::before {
    content: '\26A0\FE0F ';
}

/* ===== URDU/RTL TEXT UTILITIES ===== */
.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 16px;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

.urdu-textarea {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 18px;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

/* ===== TOTAL COUNT BOX ===== */
.total-count-box {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

/* ===== SIDEBAR SECTIONS (Home Page) ===== */
.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
}

.sidebar-section h5 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
}

.sidebar-content {
    padding: 0;
}

/* Word Origins */
.origins-section h5 {
    border-color: #9333ea;
    color: #9333ea;
}

.origin-table {
    width: 100%;
    direction: rtl;
}

.origin-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.origin-table tr:last-child {
    border-bottom: none;
}

.origin-table td {
    padding: 0.75rem 0.5rem;
}

.origin-table td:first-child {
    text-align: right;
    color: #475569;
}

.origin-table td:last-child {
    text-align: left;
    font-weight: 700;
    color: #9333ea;
}

/* Themes Sidebar */
.themes-section h5 {
    border-color: #06b6d4;
    color: #06b6d4;
}

.themes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.theme-badge {
    background: #e0f2fe;
    color: #0891b2;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-block;
}

.theme-badge:hover {
    background: #0891b2;
    color: white;
    transform: translateY(-2px);
}

.theme-count {
    font-weight: 700;
    margin-right: 0.25rem;
}

.view-all-link {
    display: inline-block;
    color: #06b6d4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #0891b2;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    height: 100%;
}

.action-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    color: #0891b2;
}

.action-button i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.action-button span {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ===== ABOUT SECTION ===== */
.about-section {
    background: #f8fafc;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.info-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
}

.info-box h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.info-box p {
    color: #475569;
    line-height: 1.8;
}

.audience-list {
    list-style: none;
    padding: 0;
}

.audience-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

.audience-list li:last-child {
    border-bottom: none;
}

.audience-list li:before {
    content: "\2713 ";
    color: #16a34a;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* ===== PROJECT INFO SECTION ===== */

.project-info-hero {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 50%, #f0f9ff 100%);
    border: 1px solid #99f6e4;
    padding: 2.5rem;
}

.project-info-hero .section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #0e7490;
}

.project-info-highlight {
    background: #f0fdfa;
    border-right: 4px solid #0891b2;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    border-radius: 8px;
    color: #0e7490;
    font-weight: 600;
    line-height: 1.8;
}

.project-info-hero .project-info-highlight {
    background: white;
}

.strategy-list {
    list-style: none;
    padding: 0;
    counter-reset: strategy-counter;
}

.strategy-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    counter-increment: strategy-counter;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.strategy-list li:last-child {
    border-bottom: none;
}

.strategy-list li:before {
    content: counter(strategy-counter);
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.benefits-list {
    list-style: none;
    padding: 0;
}

.benefits-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

.benefits-list li:last-child {
    border-bottom: none;
}

.benefits-list li:before {
    content: "\2713 ";
    color: #16a34a;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    background: white;
    padding: 4rem 0;
}

.feature-box {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-icon.bg-blue,
.bg-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.feature-icon.bg-green,
.bg-green {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.feature-icon.bg-orange,
.bg-orange {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.feature-box h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.feature-box p {
    color: #64748b;
    line-height: 1.8;
}

/* ===== METHODOLOGY BOXES ===== */
.method-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.method-box:hover {
    transform: translateY(-5px);
}

.method-number {
    width: 50px;
    height: 50px;
    background: #0891b2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.method-box h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.method-box p {
    color: #64748b;
    margin: 0;
    font-size: 0.9rem;
}

/* ===== STATISTICS CARDS (Home Page) ===== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

.text-blue { color: #2563eb; }
.text-green { color: #16a34a; }
.text-orange { color: #ea580c; }
.text-cyan { color: #06b6d4; }

/* ===== APPS SECTION ===== */
.apps-section {
    background: #f8fafc;
    padding: 4rem 0;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.app-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.app-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.app-card .btn {
    padding: 0.75rem 2rem;
    border-radius: 8px;
}

/* ===== APPS PAGE ===== */
.apps-cards-section {
    padding: 3rem 0;
}

.app-tool-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-tool-card:hover {
    border-color: #06b6d4;
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.app-tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.app-tool-icon--generate {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.app-tool-icon--rewrite {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.app-tool-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.app-tool-description {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 2rem;
    max-width: 400px;
}

.app-tool-btn {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: auto;
}

.app-tool-btn--generate {
    background: #16a34a;
    color: white;
}

.app-tool-btn--generate:hover {
    background: #15803d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.app-tool-btn--rewrite {
    background: #2563eb;
    color: white;
}

.app-tool-btn--rewrite:hover {
    background: #1d4ed8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* How It Works */
.apps-how-section {
    background: #f8fafc;
    padding: 4rem 0;
}

.apps-how-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 3rem;
}

.apps-steps {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.apps-step {
    text-align: center;
    flex: 0 0 250px;
    max-width: 250px;
}

.apps-step-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.apps-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.apps-step-desc {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

.apps-step-connector {
    display: flex;
    align-items: center;
    padding-top: 1.25rem;
    color: #cbd5e1;
    font-size: 1.5rem;
}

/* Apps Features */
.apps-features-section {
    padding: 4rem 0;
    background: white;
}

.apps-feature-card {
    text-align: center;
    padding: 2rem;
}

.apps-feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.apps-feature-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.apps-feature-card p {
    color: #64748b;
    line-height: 1.8;
    margin: 0;
}

@media (max-width: 768px) {
    .app-tool-card {
        padding: 2rem 1.5rem;
    }

    .apps-steps {
        flex-direction: column;
        align-items: center;
    }

    .apps-step {
        flex: none;
        max-width: 100%;
    }

    .apps-step-connector {
        transform: rotate(90deg);
        padding-top: 0;
    }
}

/* ===== APP TOOL PAGES (Generate & Rewrite) ===== */

/* Breadcrumb */
.app-breadcrumb {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 2rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.app-breadcrumb a {
    color: #06b6d4;
    text-decoration: none;
    font-weight: 500;
}

.app-breadcrumb a:hover {
    text-decoration: underline;
}

.app-breadcrumb .separator {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

/* Form container */
.app-form-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.app-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-form-title i {
    color: #06b6d4;
}

.app-field-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 1.05rem;
}

/* Grade selector radio cards */
.app-grade-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.app-grade-radio {
    display: none;
}

.app-grade-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    text-align: center;
    background: white;
}

.app-grade-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-grade-radio:checked + .app-grade-label {
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.app-grade-radio[value="1"]:checked + .app-grade-label {
    border-color: #16a34a;
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.app-grade-radio[value="2"]:checked + .app-grade-label {
    border-color: #2563eb;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.app-grade-radio[value="3"]:checked + .app-grade-label {
    border-color: #ea580c;
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.app-grade-radio[value="4"]:checked + .app-grade-label {
    border-color: #dc2626;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.app-grade-radio[value="5"]:checked + .app-grade-label {
    border-color: #9333ea;
    background: linear-gradient(135deg, #9333ea, #7e22ce);
}

.app-grade-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.app-grade-name {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Text input area */
.app-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    direction: rtl;
    text-align: right;
    line-height: 2;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.app-textarea:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.app-textarea--large {
    min-height: 220px;
}

.app-textarea-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Submit button */
.app-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 10px;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.app-submit-btn--generate {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.app-submit-btn--generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

.app-submit-btn--rewrite {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.app-submit-btn--rewrite:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.app-submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
}

/* Loading spinner */
.app-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: app-spin 0.8s linear infinite;
}

.app-spinner--visible {
    display: inline-block;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

/* Results section */
.app-result-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border-top: 4px solid #06b6d4;
}

.app-result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.app-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-result-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.app-result-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.15rem;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
    color: #1e293b;
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    border-right: 4px solid #06b6d4;
    white-space: pre-wrap;
}

/* Side-by-side comparison for rewrite */
.app-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.app-comparison-col {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.05rem;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
    white-space: pre-wrap;
}

.app-comparison-col--original {
    border-right: 4px solid #94a3b8;
}

.app-comparison-col--simplified {
    border-right: 4px solid #16a34a;
}

.app-comparison-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-comparison-label--original {
    color: #64748b;
}

.app-comparison-label--simplified {
    color: #16a34a;
}

/* Error message */
.app-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    color: #dc2626;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.app-error i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Back to apps link */
.app-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.app-back-link:hover {
    color: #06b6d4;
}

/* Responsive for app tool pages */
@media (max-width: 768px) {
    .app-comparison {
        grid-template-columns: 1fr;
    }

    .app-grade-selector {
        justify-content: center;
    }

    .app-form-section {
        padding: 1.5rem;
    }

    .app-result-section {
        padding: 1.5rem;
    }

    .app-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1e293b;
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 0 2rem;
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.footer-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #22d3ee;
}

.footer-divider {
    width: 80px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== LANGUAGE BADGES ===== */
.language-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.language-badge-ur { background: #8b5cf6; }
.language-badge-en { background: #3b82f6; }
.language-badge-sd { background: #10b981; }

/* ===== ACTION LINKS ===== */
.action-link {
    color: #2563eb;
    text-decoration: none;
}

.action-link:hover {
    text-decoration: underline;
}

/* ================================================================
   GRADE DETAIL PAGE
   ================================================================ */

/* Grade Hero */
/* ===== GRADE HERO (Detail Page) ===== */
.grade-hero {
    padding: 2.5rem 0;
    margin-bottom: 0;
    color: white;
}

.grade-hero-1 { background: #16a34a; }
.grade-hero-2 { background: #2563eb; }
.grade-hero-3 { background: #ea580c; }
.grade-hero-4 { background: #dc2626; }
.grade-hero-5 { background: #9333ea; }

.grade-hero-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.grade-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: white;
    white-space: nowrap;
}

.grade-hero-divider {
    width: 1px;
    height: 3rem;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.grade-hero-stats {
    display: flex;
    gap: 2.5rem;
}

.grade-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grade-hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.grade-hero-stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

/* Vocabulary Section */
.vocabulary-section {
    padding: 2rem 0 3rem;
    background: white;
}

.theme-count-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Search and Filter Bar */
.search-filter-bar {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.search-filter-bar .form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.search-filter-bar .form-control {
    text-align: right;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.625rem;
}

.search-filter-bar .form-control:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Vocabulary Table */
.vocabulary-table {
    width: 100%;
    background: white;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.vocabulary-table thead {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.vocabulary-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #cbd5e1;
    font-size: 1rem;
}

.vocabulary-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.vocabulary-table tbody tr:hover {
    background: #f8fafc;
}

.vocabulary-table tbody tr:last-child {
    border-bottom: none;
}

.vocabulary-table td {
    padding: 1rem;
    text-align: right;
    vertical-align: top;
}

.word-col {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0c4a6e;
    width: 15%;
}

.word-link {
    color: #0c4a6e;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.word-link:hover {
    color: #06b6d4;
    transform: translateX(-2px);
}

.definition-col {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    width: 40%;
}

.theme-col {
    font-size: 0.9rem;
    color: #64748b;
    width: 20%;
}

.origin-col {
    font-size: 0.9rem;
    color: #64748b;
    width: 12%;
}

.pos-col {
    width: 13%;
}

.pos-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.pagination-info {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}

.pagination {
    margin: 0;
}

.pagination .page-link {
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.85rem;
    margin: 0 0.25rem;
    border-radius: 8px;
}

.pagination .page-item.active .page-link {
    background: #06b6d4;
    border-color: #06b6d4;
    color: white;
}

.pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pagination .page-item.disabled .page-link {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* Grade Detail - Theme Cards */
.theme-card {
    display: block;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
    height: 100%;
}

.theme-card:hover {
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-card-header {
    margin-bottom: 1rem;
}

.theme-name-urdu {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.theme-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.theme-card-footer .word-count-badge {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    background: transparent;
    padding: 0;
}

.theme-card-footer i {
    color: #06b6d4;
    font-size: 1.1rem;
}

/* Download Section */
.download-section {
    padding: 2rem 0 3rem;
}

.download-card {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
}

.download-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.download-card p {
    margin: 0;
    opacity: 0.9;
}

.download-card .btn-success {
    background: white;
    color: #06b6d4;
    font-weight: 600;
    border: none;
}

.download-card .btn-success:hover {
    background: #f8fafc;
    color: #0891b2;
}

/* ================================================================
   WORD DETAIL PAGE
   ================================================================ */

.word-detail-page {
    padding: 2rem 0 4rem;
    background: #f8fafc;
}

/* Breadcrumb */
.breadcrumb-nav {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
}

.breadcrumb-nav a {
    color: #06b6d4;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

/* Word Header */
.word-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.word-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.word-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

/* Content Sections */
.content-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.content-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-section .section-title i {
    color: #06b6d4;
}

.section-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #475569;
}

.definition-text {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.9;
}

.examples-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.examples-list li {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-right: 4px solid #06b6d4;
    border-radius: 8px;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.examples-list li:last-child {
    margin-bottom: 0;
}

.explanation-text {
    margin: 0;
    line-height: 1.9;
}

/* Sidebar Cards */
.sidebar-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    color: #06b6d4;
}

/* Characteristics */
.characteristics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.char-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.char-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
}

.char-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.frequency-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.frequency-badge.high {
    background: #16a34a;
    color: white;
}

.frequency-badge.medium {
    background: #f59e0b;
    color: white;
}

/* Theme Tags (Word Detail) */
.themes-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theme-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #22d3ee;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.theme-tag:hover {
    background: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Related Words */
.related-words-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-word-link {
    display: block;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    color: #0c4a6e;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.related-word-link:hover {
    background: #e0f2fe;
    border-color: #06b6d4;
    transform: translateX(-4px);
}

.word-family-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 0;
}

/* Linguistic Info */
.linguistic-info p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #475569;
}

/* More Research */
.more-research ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.more-research li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.more-research li:last-child {
    border-bottom: none;
}

.more-research a {
    color: #0c4a6e;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.more-research a:hover {
    color: #06b6d4;
}

.more-research a::before {
    content: '\2190 ';
    margin-left: 0.5rem;
}

/* ================================================================
   THEME DETAIL PAGE
   ================================================================ */

/* Vocabulary Grid */
.vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vocabulary-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.vocabulary-card:hover {
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.word-main {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.word-main-link {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.word-main-link:hover {
    color: #06b6d4;
}

.word-definition {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.word-pos {
    margin-top: 0.75rem;
}

/* Theme Icon */
.theme-icon-large {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

.theme-icon-large i {
    font-size: 5rem;
    color: white;
}

.grade-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* ================================================================
   THEMES LIST PAGE
   ================================================================ */

/* Grade Filter Tabs */
.grade-filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grade-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
}

.grade-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.grade-tab.active {
    color: white;
    border-color: transparent;
}

.grade-tab:first-child.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.grade-tab-1.active {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.grade-tab-2.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.grade-tab-3.active {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.grade-tab-4.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.grade-tab-5.active {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
}

/* Grade Section */
.grade-section {
    padding: 2rem 0;
}

.grade-section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.theme-count-text {
    font-size: 1rem;
    color: #64748b;
    font-weight: normal;
}

/* Theme List Cards */
.theme-list-card {
    display: block;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
    height: 100%;
}

.theme-list-card:hover {
    border-color: #06b6d4;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.theme-list-card--empty {
    opacity: 0.5;
    cursor: default;
    border-style: dashed;
}

.theme-list-card--empty:hover {
    border-color: #e2e8f0;
    transform: none;
    box-shadow: none;
}

.theme-list-header {
    margin-bottom: 1rem;
}

.theme-list-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.theme-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.theme-list-footer i {
    color: #06b6d4;
    font-size: 1.25rem;
}

/* ================================================================
   SEARCH PAGE
   ================================================================ */

.search-page {
    min-height: 80vh;
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

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

.search-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-page .search-box {
    max-width: 800px;
}

.back-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.8rem 2rem;
    border: 2px solid #64748b;
    border-radius: 25px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s;
}

.back-button:hover {
    background: #64748b;
    color: white;
}

.results-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.results-header {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #1e293b;
}

.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results-title {
    font-size: 1.5rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.no-results-message {
    font-size: 1.2rem;
    color: #94a3b8;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    text-decoration: none;
}

.result-word {
    font-size: 2rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 1rem;
    text-align: right;
}

.result-definition {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.8;
    text-align: right;
    margin-bottom: 1rem;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.result-meta-tags {
    display: flex;
    gap: 0.5rem;
}

.result-card .grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
}

.result-card .grade-number {
    background: rgba(255,255,255,0.3);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.result-pos {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 20px;
    color: #475569;
    font-size: 0.9rem;
}

.result-origin {
    padding: 0.5rem 1rem;
    background: #e2e8f0;
    border-radius: 20px;
    color: #475569;
    font-size: 0.9rem;
}

/* ================================================================
   STATISTICS PAGE
   ================================================================ */

.statistics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.stats-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stats-title i {
    color: #06b6d4;
}

.total-words {
    font-size: 1.25rem;
    color: #64748b;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Statistics Page - Stat Cards (scoped) */
.statistics-container .stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.statistics-container .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.statistics-container .card-header {
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-card-blue .card-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.stat-card-purple .card-header {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
}

.stat-card-cyan .card-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.stat-card-orange .card-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card-green .card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card-rose .card-header {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.stat-bar-rose {
    background: linear-gradient(90deg, #f43f5e 0%, #fb7185 100%);
}

.card-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Chart Canvas */
.statistics-container canvas {
    max-height: 200px;
    margin-bottom: 1rem;
}

.stats-sub-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.stat-bar-cumulative {
    background: linear-gradient(90deg, #93c5fd 0%, #bfdbfe 100%);
}

/* Stats Lists */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.statistics-container .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
}

.statistics-container .stat-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}

.stat-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-bar {
    height: 32px;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    transition: width 0.3s ease;
    min-width: 50px;
}

.stat-value {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-percentage {
    color: #64748b;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* Compact Lists */
.stats-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.stat-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.stat-item-compact:last-child {
    border-bottom: none;
}

.stat-count {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-link {
    color: #0c4a6e;
    text-decoration: none;
    transition: color 0.2s;
}

.stat-link:hover {
    color: #06b6d4;
}

/* Statistics Download Section */
.statistics-container .download-section {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.download-title {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-title i {
    font-size: 1.5rem;
}

.download-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.download-btn {
    background: white;
    color: #059669;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #059669;
}

.download-btn-all {
    background: #fbbf24;
    color: #92400e;
}

.download-btn-all:hover {
    background: #fcd34d;
    color: #92400e;
}

/* Stats Row */
.stats-row .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
}

/* ===== GRADE COMPARISON SECTION ===== */
.grade-comparison-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 3rem;
}

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

.comparison-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comparison-title i {
    color: #9333ea;
}

.comparison-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.comparison-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comparison-chart-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.comparison-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
    text-align: center;
}

.comparison-chart-card canvas {
    max-height: 250px;
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.comparison-table thead {
    background: #f1f5f9;
}

.comparison-table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.comparison-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 500;
}

.comparison-table tbody tr:hover {
    background: #f8fafc;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

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

@media (max-width: 992px) {
    .word-title {
        font-size: 2.25rem;
    }

    .sidebar-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .grades-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .grade-card .grade-number {
        font-size: 3rem;
    }

    .grade-hero-inner {
        gap: 1rem;
    }

    .grade-hero-title {
        font-size: 1.5rem;
    }

    .grade-hero-stats {
        gap: 1.5rem;
    }

    .grade-hero-stat-value {
        font-size: 1.2rem;
    }

    .vocabulary-table {
        font-size: 0.9rem;
    }

    .word-col {
        font-size: 1.25rem;
    }

    .vocabulary-table th,
    .vocabulary-table td {
        padding: 0.75rem 0.5rem;
    }

    .pagination-section {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination {
        font-size: 0.85rem;
    }

    .word-title {
        font-size: 2rem;
    }

    .content-section,
    .word-header,
    .sidebar-card {
        padding: 1.25rem;
    }

    .char-item {
        padding: 0.5rem;
    }

    .vocabulary-grid {
        grid-template-columns: 1fr;
    }

    .theme-icon-large {
        width: 140px;
        height: 140px;
    }

    .theme-icon-large i {
        font-size: 4rem;
    }

    .grade-filter-tabs {
        gap: 0.5rem;
    }

    .grade-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .grade-section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .statistics-container {
        padding: 1rem;
    }

    .stats-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .comparison-charts {
        grid-template-columns: 1fr;
    }

    .comparison-chart-card canvas {
        max-height: 200px;
    }

    .comparison-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .grades-container {
        grid-template-columns: 1fr;
    }
}
