/* =========================================================
   ACE Grammar Engine
   File: sent_urdu_form.css
   Compact flash-card layout
   ========================================================= */


/* =========================================================
   1. RESET / PAGE
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f4f6f8;
    color: #1f2937;
}

.ace-shell {
    width: min(1100px, calc(100% - 24px));
    margin: 18px auto;
}


/* =========================================================
   2. TOP BAR
   ========================================================= */

.ace-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 10px;
}

.ace-topbar h1 {
    margin: 0;

    font-size: 22px;
    line-height: 1.15;
}

.record-count {
    margin-top: 3px;

    color: #6b7280;
    font-size: 12px;
}


/* =========================================================
   3. FILTER / CONTROL AREA
   ========================================================= */

.variant-filter,
.index-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px 10px;
    margin: 0;
}

.variant-filter {
    justify-content: flex-end;
}

.ace-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ace-field label,
.variant-filter label,
.index-controls label {
    white-space: nowrap;

    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.ace-field select,
.variant-filter select,
.index-controls select {
    width: auto;

    padding: 7px 30px 7px 10px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;
    color: #111827;

    font-family: inherit;
    font-size: 13px;

    outline: none;
}

.ace-field select {
    min-width: 145px;
}

.variant-filter select {
    min-width: 190px;
    max-width: 300px;
}

.ace-field select:focus,
.variant-filter select:focus,
.index-controls select:focus {
    border-color: #9ca3af;

    box-shadow:
        0 0 0 3px rgba(17, 24, 39, 0.06);
}


/* =========================================================
   4. FLASH CARD
   ========================================================= */

.flash-card {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.06);
}

.flash-card + .flash-card {
    margin-top: 12px;
}


/* =========================================================
   5. FLASH CARD HEADER
   ========================================================= */

.flash-card-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;

    gap: 6px;
    padding: 10px 12px;

    border-bottom: 1px solid #eceff2;
}

.record-heading {
    min-width: 0;

    text-align: center;
}

.record-number {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.15;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 5px;
    margin-top: 4px;
}

.record-meta span {
    display: inline-block;

    padding: 2px 7px;

    border-radius: 999px;

    background: #f3f4f6;
    color: #4b5563;

    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   6. NAVIGATION ARROWS
   ========================================================= */

.nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border: 1px solid #e5e7eb;
    border-radius: 50%;

    background: #ffffff;
    color: #374151;

    text-decoration: none;

    font-size: 17px;
    line-height: 1;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.nav-arrow:hover {
    background: #f3f4f6;
    border-color: #d1d5db;

    transform: translateY(-1px);
}

.nav-arrow.disabled {
    opacity: 0.22;
    pointer-events: none;
}

.small-arrow {
    width: 25px;
    height: 25px;

    font-size: 14px;
}


/* =========================================================
   7. SENTENCE LIST
   ========================================================= */

.sentence-list {
    padding: 0;
}

.sentence-row {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: center;

    gap: 9px;

    margin: 0;
    padding: 8px 12px;

    border-bottom: 1px solid #f0f1f3;
}

.sentence-row:last-child {
    border-bottom: 0;
}

.sentence-row:hover {
    background: #fafafa;
}


/* =========================================================
   8. INDEX BADGE
   ========================================================= */

.index-badge {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 52px;
    height: 26px;

    padding: 0 6px;

    border-radius: 7px;

    background: #f3f4f6;
    color: #6b7280;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   9. SENTENCE COLUMNS
   English | Urdu | Arabic | IPA
   ========================================================= */

.sentence-content {
    display: grid;

    grid-template-columns:
        minmax(150px, 1fr)
        minmax(170px, 1.15fr)
        minmax(170px, 1.15fr)
        minmax(150px, 1.05fr);

    align-items: center;

    gap: 14px;

    min-width: 0;
}

.english,
.urdu,
.arabic,
.ipa {
    min-width: 0;

    margin: 0;
    padding: 0;

    overflow-wrap: anywhere;
}


/* ---------------------------------------------------------
   English
   --------------------------------------------------------- */

.english {
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}


/* ---------------------------------------------------------
   Urdu
   --------------------------------------------------------- */

.urdu {
    font-family:
        "Noto Nastaliq Urdu",
        "Noto Naskh Arabic",
        serif;

    font-size: 17px;
    line-height: 1.8;

    text-align: right;
    direction: rtl;
}


/* ---------------------------------------------------------
   Arabic
   --------------------------------------------------------- */

.arabic {
    font-family:
        "Noto Naskh Arabic",
        "Amiri",
        serif;

    font-size: 19px;
    line-height: 1.6;

    text-align: right;
    direction: rtl;
}


/* ---------------------------------------------------------
   Arabic Frequency Link
   --------------------------------------------------------- */

.arabic-frequency-link {
    color: inherit;
    text-decoration: none;
}

.arabic-frequency-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ---------------------------------------------------------
   IPA
   --------------------------------------------------------- */

.ipa {
    font-family:
        "Charis SIL",
        "Doulos SIL",
        serif;

    color: #374151;

    font-size: 14px;
    line-height: 1.45;

    text-align: left;
}


/* ---------------------------------------------------------
   Missing Data
   --------------------------------------------------------- */

.missing {
    color: #b91c1c;

    font-size: 12px;
}


/* =========================================================
   10. FOOTER NAVIGATION
   ========================================================= */

.flash-card-foot {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 7px 10px;

    border-top: 1px solid #eceff2;

    background: #fafafa;
    color: #6b7280;

    font-size: 11px;
}

.empty-card {
    padding: 32px;

    color: #6b7280;

    text-align: center;
}


/* =========================================================
   11. TABLET
   ========================================================= */

@media (max-width: 900px) {

    .sentence-content {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);

        gap: 6px 14px;
    }

    .english {
        grid-column: 1;
        grid-row: 1;
    }

    .urdu {
        grid-column: 2;
        grid-row: 1;
    }

    .ipa {
        grid-column: 1;
        grid-row: 2;
    }

    .arabic {
        grid-column: 2;
        grid-row: 2;
    }
}


/* =========================================================
   12. MOBILE
   ========================================================= */

@media (max-width: 760px) {

    .ace-shell {
        width: calc(100% - 14px);
        margin: 8px auto;
    }


    /* Top bar */

    .ace-topbar {
        flex-direction: column;
        align-items: stretch;

        gap: 8px;
    }

    .ace-topbar h1 {
        font-size: 19px;
    }


    /* Controls */

    .variant-filter,
    .index-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .ace-field {
        width: 100%;
    }

    .ace-field select,
    .variant-filter select,
    .index-controls select {
        flex: 1;

        min-width: 0;
        max-width: none;
    }


    /* Card */

    .flash-card {
        border-radius: 10px;
    }

    .flash-card-head {
        grid-template-columns: 32px minmax(0, 1fr) 32px;

        padding: 8px;
    }

    .record-number {
        font-size: 15px;
    }

    .record-meta {
        gap: 3px;
    }

    .record-meta span {
        padding: 2px 5px;

        font-size: 10px;
    }


    /* Sentence rows */

    .sentence-row {
        grid-template-columns: 48px minmax(0, 1fr);

        gap: 7px;

        padding: 8px;
    }

    .index-badge {
        min-width: 44px;

        font-size: 10px;
    }

    .sentence-content {
        display: grid;

        grid-template-columns: 1fr;

        gap: 3px;
    }

    .english,
    .urdu,
    .arabic,
    .ipa {
        grid-column: auto;
        grid-row: auto;
    }

    .english,
    .ipa {
        text-align: left;
    }

    .urdu,
    .arabic {
        text-align: right;
    }

    .english {
        font-size: 13px;
    }

    .urdu {
        font-size: 16px;
    }

    .arabic {
        font-size: 18px;
    }

    .ipa {
        font-size: 13px;
    }
}


/* =========================================================
   13. VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 480px) {

    .sentence-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .index-badge {
        min-width: 36px;
        padding: 0 3px;

        font-size: 9px;
    }

    .nav-arrow {
        width: 27px;
        height: 27px;

        font-size: 15px;
    }

    .small-arrow {
        width: 23px;
        height: 23px;

        font-size: 13px;
    }
}