/* ===== فونت ایران سنس ===== */
@font-face{
    font-family:"IranSans";
    src:url("../fonts/IRANSansWeb.woff2") format("woff2"),
        url("../fonts/IRANSansWeb.woff") format("woff");
    font-weight:normal;
    font-style:normal;
}

/* ===== متغیرهای اصلی رنگ و ظاهر ===== */
:root{
    --bg-main:#f1eada;
    --bg-gradient-from:#f1eada;
    --bg-gradient-to:#f1eada;

    --text-main:#8a5227;
    --accent:#8a522d;
    --border-soft:#d6c1a3;
    --premium:#c27b00;

    --shadow-soft:0 6px 18px rgba(0,0,0,0.08);
    --radius-card:18px;
}

/* ===== بدنه صفحه ===== */
*,
*::before,
*::after{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
    
}

body{
    font-family:"IranSans",sans-serif;
    background:#f1eada;
    color:var(--text-main);
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    direction:rtl;
}



/* ===== کانتینر اصلی ===== */
.app-wrapper{
    width:100%;
    max-width:960px;
    margin:1.2rem;
    background-color:transparent;
}

/* ===== کارت اصلی فرم ===== */
.main-card{
    /*  background:rgba(255,255,255,0.85); */
    border-radius:24px;
    box-shadow:var(--shadow-soft);
    padding:1.5rem 1.8rem 1.8rem;
    backdrop-filter:blur(6px);
    border:1px solid rgba(214,193,163,0.7);
}

/* ===== هدر (فقط تصویر) ===== */
.hero{
    text-align:center;
    margin-bottom:1.4rem;
}

.hero-image{
    display:flex;
    justify-content:center;
    align-items:center;
}

.hero-image img{
    max-width:260px;
    width:100%;
    height:auto;
    border-radius:18px;
   /*  box-shadow:0 8px 22px rgba(0,0,0,0.18); */
}

/* اگر دیگر استفاده نمی‌شود، می‌توان حذف کرد */
.hero-title,
.hero-subtitle{
    display:none;
}

/* ===== فرم جستجو ===== */
.search-form{
    display:flex;
    flex-direction:column;
    gap:0.85rem;
}

/* ===== کارت‌های هر بخش ===== */
.section-card{
    background:transparent;
    border-radius:var(--radius-card);
    border:1px solid var(--border-soft);
    padding:1rem 1.2rem 1.1rem;
    box-shadow:var(--shadow-soft);
    margin-bottom:0.2rem;
}

.section-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:0.7rem;
    gap:0.4rem;
}

.section-title{
    font-size:0.95rem;
    font-weight:600;
    display:flex;
    align-items:center;
    gap:0.35rem;
}

.section-title .emoji{
    font-size:1.1rem;
}

.section-badge{
    font-size:0.72rem;
    padding:0.1rem 0.4rem;
    border-radius:999px;
    border:1px solid var(--border-soft);
    color:#7a5a30;
    background-color:rgba(241,234,218,0.7);
}

/* نشان پولی */
.section-badge.premium{
    border-color:var(--premium);
    color:#fff;
    background:linear-gradient(135deg,#f0b14a,#c27b00);
}

/* متن زیر عنوان */
.section-description{
    font-size:0.78rem;
    color:#8b7460;
    margin-bottom:0.4rem;
}

/* ===== چیدمان داخلی گزینه‌ها ===== */
.section-body{
    display:flex;
    flex-wrap:wrap;
    gap:0.45rem;
}

/* برای ریشه‌ها: چند ستون در دسکتاپ */
.section-body.roots{
    max-height:220px;
    overflow-y:auto;
    padding-left:0.1rem;
}

/* ===== گزینه‌های انتخابی (pill) ===== */
.choice-pill{
    position:relative;
}

/* مخفی کردن input */
.choice-pill input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

/* ظاهر لیبل به شکل pill */
.choice-pill label{
    display:inline-flex;
    align-items:center;
    gap:0.35rem;
    padding:0.3rem 0.6rem;
    border-radius:999px;
    border:1px solid var(--border-soft);
    font-size:0.8rem;
    cursor:pointer;
    color:#6b4b33;
    background-color:rgba(255,255,255,0.8);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* دایره/مربع کنار متن (محل نمایش تیک) */
.choice-pill label::before{
    content:'';
    width:14px;
    height:14px;
    border-radius:50%;
    border:2px solid currentColor;
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:11px;
    line-height:1;
}

/* برای حالت چک‌باکس، گوشه‌ها مربعی شود */
.choice-pill.is-checkbox label::before{
    border-radius:4px;
}

/* در حالت انتخاب: پس‌زمینه قهوه‌ای، متن سفید، تیک سفید با حاشیه قهوه‌ای */
.choice-pill input:checked + label{
    background:#8a522d;
    color:#fff;
    border-color:#8a522d;
    box-shadow:0 0 0 2px rgba(138,82,45,0.25);
}

/* تیک در حالت انتخاب */
.choice-pill input:checked + label::before{
    content:'✔';
    background:#fff;
    color:#8a522d;
    border-color:#8a522d;
}

/* روی hover کمی پررنگ‌تر شود */
.choice-pill label:hover{
    box-shadow:0 0 0 1px rgba(138,82,45,0.3);
}

/* برچسب گزینه‌های پولی 
.choice-pill[data-premium="true"] label{
    position:relative;
    padding-inline-start:0.6rem;
}

.choice-pill[data-premium="true"] label::after{
    content:'پولی';
    font-size:0.6rem;
    margin-right:0.2rem;
    padding:0 0.35rem;
    border-radius:999px;
    border:1px solid rgba(194,123,0,0.8);
    color:#fff;
    background:linear-gradient(135deg,#f0b14a,#c27b00);
}
*/
/* ===== select (ماه/روز) ===== */
.select-row{
    display:flex;
    gap:0.5rem;
    flex-wrap:wrap;
}

.select-row .select-group{
    flex:1 1 120px;
    min-width:120px;
}

.select-row label{
    display:block;
    font-size:0.78rem;
    margin-bottom:0.2rem;
    color:#7a5a30;
}

.select-row select{
    width:100%;
    padding:0.35rem 0.5rem;
    border-radius:8px;
    border:1px solid var(--border-soft);
    background-color:rgba(255,255,255,0.9);
    font-family:"IranSans",sans-serif;
    font-size:0.8rem;
    color:#5a3f2b;
    outline:none;
    direction:rtl;
}

.select-row select:focus{
    border-color:#8a522d;
    box-shadow:0 0 0 2px rgba(138,82,45,0.2);
}

/* ===== سطر چک‌باکس‌های ساده (مانند ابجد و اطلاعات تکمیلی) ===== */
.inline-options{
    display:flex;
    flex-wrap:wrap;
    gap:0.45rem;
}

/* ===== نوار پایین فرم (دکمه جستجو و متن حق عضویت) ===== */
.form-footer{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:0.6rem;
    margin-top:0.6rem;
    padding-top:0.7rem;
    border-top:1px dashed var(--border-soft);
}

.plan-note{
    font-size:0.78rem;
    color:#8b7460;
}

.plan-note strong{
    color:#8a522d;
}

/* دکمه ارسال */
.btn-primary{
    border:none;
    padding:0.45rem 1.5rem;
    border-radius:999px;
    background:#8a522d;
    color:#fff;
    font-family:"IranSans",sans-serif;
    font-size:0.86rem;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:0.4rem;
    box-shadow:0 6px 14px rgba(138,82,45,0.4);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.btn-primary span.icon{
    font-size:1rem;
    display:inline-block;
    transform:translateY(1px);
}

.btn-primary:hover{
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(138,82,45,0.5);
    background:#744221;
}

.btn-primary:active{
    transform:translateY(0);
    box-shadow:0 4px 10px rgba(138,82,45,0.35);
}

/* ===== پیام خطا (اعتبارسنجی) ===== */
.error-message{
    margin-top:0.5rem;
    font-size:0.78rem;
    color:#b3261e;
}

/* ===== اسکرول سفارشی برای لیست ریشه‌ها ===== */
.section-body.roots::-webkit-scrollbar{
    width:6px;
}

.section-body.roots::-webkit-scrollbar-track{
    background:rgba(241,234,218,0.8);
    border-radius:999px;
}

.section-body.roots::-webkit-scrollbar-thumb{
    background:#c19a6b;
    border-radius:999px;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width:768px)
{
    body{
        align-items:flex-start;
    }

    .app-wrapper{
        margin:0.6rem;
    }

    .main-card{
        padding:1.1rem 1rem 1.4rem;
        border-radius:18px;
    }

    .hero-image img{
        max-width:220px;
        border-radius:14px;
    }

    .section-card{
        padding:0.9rem 0.8rem 1rem;
        border-radius:14px;
    }

    .section-body.roots{
        max-height:180px;
    }

    .form-footer{
        flex-direction:column-reverse;
        align-items:flex-start;
    }

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

.options-row{
    display: flex;
    
    gap: 0.5rem;
    
    flex-wrap: wrap;
    
    align-items: center;
    
    }
    
    .section-body.roots .choice-pill{
    
    display: inline-flex;
    
    align-items: center;
    
    margin: 0.25rem;
    
    }
    
    .parent-fields {
        margin-top: 12px;
    }
    
    .parent-fields .form-row {
        margin-top: 12px;
    }
    
    .parent-fields label {
        display: block;
        margin-bottom: 8px;
    }
    
    .text-wrapper input[type="text"] {
        width: 100%;
        padding: 6px 8px;
        border-radius: 8px;
        border: 1px solid #d6c1a3;
        font-family: "IranSans", sans-serif;
        background: #fff;
        color: #5a3f2b;
        outline: none;
        box-sizing: border-box;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        direction: rtl;
    }
    
    .text-wrapper input[type="text"]:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }
    
    .text-wrapper input[type="text"]::placeholder {
        color: #94a3b8;
    }

    .parent-fields {
        margin-top: 12px;
    }
    
    .parent-fields-row {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    
    .parent-field-item label {
        display: block;
        margin-bottom: 8px;
    }
    
    .text-wrapper input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
    
   
        .results-container {
            max-width: 1200px;
            margin: 30px auto;
            padding: 15px;
        }

        .results-card {
            background: #fff;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }

        .results-card h2, .results-card h3 {
            margin-top: 0;
        }

        .summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
            margin-bottom: 20px;
        }

        .summary-item {
            background: #f8f9fb;
            border-radius: 12px;
            padding: 10px 12px;
            font-size: 14px;
        }

        .summary-item strong {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }

        .table-wrapper {
            width: 100%;
            overflow-x: auto;
            margin-bottom: 20px;
        }

        table.results-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 1000px;
        }

        .results-table th, .results-table td {
            border: 1px solid #e6e6e6;
            padding: 10px 8px;
            text-align: center;
            vertical-align: middle;
            white-space: nowrap;
        }

        .results-table th {
            background: #f2f5fa;
            font-size: 13px;
        }

        .results-table td {
            font-size: 14px;
        }

        .empty-box, .error-box {
            padding: 16px;
            border-radius: 12px;
        }

        .empty-box {
            background: #fff8e1;
            color: #7a5d00;
        }

        .error-box {
            background: #fdeaea;
            color: #8a1f1f;
        }

        .pagination {
            margin-top: 20px;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 6px;
        }

        .pagination a, .pagination span {
            padding: 8px 12px;
            border-radius: 8px;
            text-decoration: none;
            border: 1px solid #ddd;
            background: #fff;
            color: #333;
            font-size: 14px;
        }

        .pagination a:hover {
            background: #eee;
        }

        .pagination .current {
            background: #2f6fed;
            color: #fff;
            border-color: #2f6fed;
        }

        .back-link {
            display: inline-block;
            padding: 10px 16px;
            border-radius: 10px;
            background: #2f6fed;
            color: #fff;
            text-decoration: none;
            margin-top: 20px;
        }

        .back-link:hover {
            background: #1f57c8;
        }

        /* ============================================
   CLEAN – ISOLATED – FINAL TABLE STYLING
   (Desktop + Mobile, Card Layout)
   ============================================ */

.names-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    font-family: inherit;
    user-select: none;
    
}

/* هدر جدول مخفی می‌شود */
.names-table thead {
    display: none;
}

/* هر ردیف جدول = یک کارت */
.names-table tr {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 20px;

    background: #fffdfb;
    border: 1px solid #ecd9c8;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 22px;

    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    position: relative;
}

/* هدر کارت (نام) */
.names-table tr .card-title {
    grid-column: 1 / -1;
    font-size: 20px;
    font-weight: 900;
    color: #6f3f1d;
    margin-bottom: 4px;
    border-bottom: 2px solid #f1e4da;
    padding-bottom: 6px;
}

/* سلول‌ها */
.names-table td {
    font-size: 14px;
    color: #000;
    display: flex;
    align-items: center;
    line-height: 1.9;
}

/* عنوان کنار مقدار */
.names-table td::before {
    content: attr(data-label) " ";
    font-weight: 700;
    color: #7a4a25;
    margin-left: 5px;
    white-space: nowrap;
}

/* ---- گروه‌بندی ---- */

/* گروه ۱ — 4 ستون: جنسیت + ریشه + معنی */
.names-table td.gender,
.names-table td.root,
.names-table td.meaning {
    grid-column: span 1;
}

/* گروه ۲ — 4 ستون: تلفظ‌ها + قرآن */
.names-table td.pron-en,
.names-table td.pron-latin,
.names-table td.quran,
.names-table td.quran-notes {
    grid-column: span 1;
}

/* مشابه‌ها */
.names-table td.similar {
    grid-column: 1 / -1;
    display: block;
}

.names-table td.similar p {
    margin: 4px 0;
}

/* معانی زبان‌ها – همیشه یک پاراگراف کامل */
.names-table td.lang {
    grid-column: 1 / -1;
    display: block;
    direction: rtl;
    text-align: right;
    line-height: 2;
}

/* عنوان جدا برای lang */
.names-table td.lang::before {
    content: attr(data-label);
    display: block;
    font-weight: 800;
    color: #7a4a25;
    margin-bottom: 6px;
}

/* محتوا */
.names-table td.lang * {
    direction: rtl;
    text-align: right;
}

.names-table td.lang ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.names-table td.lang li {
    margin: 4px 0;
}

/* ابجد */
.names-table td.abjad {
    grid-column: span 1;
}

/* ============================================
   MOBILE – 2 COLUMNS
   ============================================ */
@media (max-width: 768px) {

    .names-table tr {
        grid-template-columns: repeat(2, 1fr);
        padding: 18px;
    }

    .names-table tr .card-title {
        font-size: 18px;
    }

    /* گروه ۱ → ۲ ستونه */
    .names-table td.gender,
    .names-table td.root,
    .names-table td.meaning {
        grid-column: span 1;
    }

    /* گروه ۲ → ۲ ستونه */
    .names-table td.pron-en,
    .names-table td.pron-latin,
    .names-table td.quran,
    .names-table td.quran-notes {
        grid-column: span 1;
    }

    /* مشابه‌ها و زبان‌ها → فول عرض */
    .names-table td.similar,
    .names-table td.lang {
        grid-column: 1 / -1;
    }
}


/* کارت مدرن */
.names-table tr{
    background:linear-gradient(180deg,#fffdfb,#fff8f3);
    transition:all .25s ease;
    }
    
    /* hover */
    .names-table tr:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 22px rgba(0,0,0,0.08);
    }
    
    /* هدر کارت */
    .names-table .card-title{
    font-size:22px;
    font-weight:900;
    color:#6f3f1d;
    padding-bottom:8px;
    border-bottom:2px solid #f1e4da;
    margin-bottom:6px;
    }
    
    /* معنی برجسته */
    .names-table td.meaning{
    font-weight:600;
    color:#5b3b1f;
    }
    
    /* badge جنسیت */
    .badge-girl{
    background:#ffe6f1;
    color:#c2185b;
    padding:3px 10px;
    border-radius:20px;
    font-size:13px;
    }
    
    .badge-boy{
    background:#e6f0ff;
    color:#1a5ad7;
    padding:3px 10px;
    border-radius:20px;
    font-size:13px;
    }
    
    /* tag مشابه ها */
    .tag{
    display:inline-block;
    background:#f3ede6;
    color:#5b3b1f;
    padding:4px 9px;
    border-radius:7px;
    margin:3px;
    font-size:13px;
    }
    
    /* آیکون فیلدها */
    .names-table td.root::before{
    content:"🌍 ریشه : ";
    }
    
    .names-table td.meaning::before{
    content:"📜 معنی : ";
    }
    
    .names-table td.pron-en::before{
    content:"🔊 تلفظ انگلیسی : ";
    }
    
    .names-table td.pron-latin::before{
    content:"🔊 تلفظ لاتین : ";
    }
    
    .names-table td.quran::before{
    content:"📖 در قرآن : ";
    }
    
    .names-table td.quran-notes::before{
    content:"📚 توضیح قرآنی : ";
    }
    
   

    /* سطر مشابه‌ها */

.names-table td.similar-boy{
    grid-column:1 / 3;
    content:"👥  نام های هم آوا پسر : ";
    }
    
    .names-table td.similar-girl{
    grid-column:3 / 5;
    content:"👥  نام های هم آوا دختر : ";
    }
    
    .names-table td.abjad1::before{
    content:"🔢 ابجد کبیر : ";
    }

    .names-table td.abjad2::before{
        content:"🔢 ابجد صغیر : ";
        }
    

    /* کل سطر مشابه‌ها یک ستون کامل باشد */
.names-table td.similar-group{
    grid-column: 1 / -1;
}

/* باکس داخلی دو ستونه */
.similar-box{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* هر ستون مشابه */
.similar-col .field-label{
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

/* تگ‌های مشابه */
.tags{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag{
    background: #f4f0e8;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
}

/* در موبایل دو ستون زیر هم شوند */
@media(max-width: 768px){
    .similar-box{
        grid-template-columns: 1fr;
    }
}
/* سطر توضیح قرآنی تمام عرض */
.names-table td.quran-desc{
    grid-column: 1 / -1 !important;
    width: 100%;
}

/* متن توضیح */
.names-table td.quran-desc{
    line-height: 2;
}


.similar-toggle {
    padding-top: 1px;
    padding-bottom: 1px;
    min-height: auto;
    line-height: 1.2;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #df25eb);
    color: #fff;
    font-size: 11px;
    font-weight: 200;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
    min-width: 85px;
    height: 24px;
    padding: 0 8px;
}

.similar-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.similar-toggle:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}

.similar-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* ===== Fix POST pagination buttons to look like old links ===== */
.pagination form{
    display:inline;
    margin:0;
}

.pagination button{
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.pagination button:hover{
    background: #eee;
}

/* current page (disabled button) should look like .pagination .current */
.pagination button.current,
.pagination button:disabled{
    background: #2f6fed;
    color: #fff;
    border-color: #2f6fed;
    cursor: default;
    opacity: 1; /* prevent greyed-out disabled look */
}

/* ===== Fix similar-name buttons to look exactly like tags ===== */
.tags form{
    display:inline;
    margin:0;
}

/* remove browser default button UI */
.tags button.tag{
    appearance: none;
    -webkit-appearance: none;
    background: #f4f0e8;   /* match your .tag */
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    border: 0;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
}

/* optional hover, close to link feeling */
.tags button.tag:hover{
    filter: brightness(0.97);
}
/* در فایل css/style.css اضافه کنید */
.mobile-box, .m-digit {
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}
input[type="password"] {
    width: 100%; /* این باعث می‌شود هم‌اندازه کانتینر موبایل شود */
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
}
