﻿/* پایه صفحه و تنظیم ساختار کلی */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    font-family: 'Vazir', sans-serif;
    background-color: #f9f9f9;
    line-height: 1.8;
    color: #333;
}

/* تیترها */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    /*color: #222;*/
}

/* لینک‌ها */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

    a:hover,
    a:focus {
        color: #0056b3;
        text-decoration: underline;
    }

/* دکمه‌ها */
.btn {
    font-family: vazir;
    border-radius: 0.5rem;
}

/* ساختار اصلی صفحه برای چسباندن فوتر پایین */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* محتوای اصلی با فضای منعطف */
.body-content {
    margin-top: 80px;
    flex: 1;
}

/* فوتر همیشه پایین و یکپارچه */
.footer {
    background-color: #212529;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/*
 * اصلاحات Navbar برای ریسپانسیو بودن بهتر
 * در موبایل، دکمه‌های ورود/خروج و منو در یک خط قرار می‌گیرند و لوگو نمایش داده می‌شود.
 */
.navbar .container-fluid {
    display: flex;
    flex-direction: row-reverse; /* برای RTL */
    justify-content: space-between;
    align-items: center;
}

/* مخفی کردن نام برند در دسکتاپ و نمایش در موبایل */
.navbar-brand {
    display: block;
}

/* دکمه‌های ورود/خروج در موبایل کوچک‌تر می‌شوند */
@media (max-width: 991.98px) {
    .d-flex.align-items-center.gap-2 {
        gap: 0.5rem;
    }

    .btn.btn-sm {
        padding: .25rem .5rem;
        font-size: .875rem;
    }

    .d-none.d-lg-block {
        display: none !important;
    }
}

/* از عرض lg به بالا (دسکتاپ)، آیتم‌های منو به صورت ردیفی در می‌آیند */
@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row;
        gap: 0.75rem;
    }

    .navbar-brand {
        display: none;
    }

    .d-none.d-lg-block {
        display: block !important;
    }
}

/* فونت‌ها */
@font-face {
    font-family: 'vazir';
    src: url('../fonts/vazir.woff2') format('woff2');
    src: url('../fonts/vazir.ttf') format('truetype');
}

@font-face {
    font-family: 'amiriquran-regular';
    src: url('../fonts/amiriquran-regular.ttf') format('truetype');
}

.quran-container {
    direction: rtl;
    text-align: center;
    margin: 2rem auto;
    max-width: 800px;
    font-family: "Vazirmatn", sans-serif;
}

.search-input {
    width: 70%;
    padding: 8px;
    margin-bottom: 1rem;
}

.quran-page {
    margin-top: 1rem;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.translation {
    color: #555;
    margin-top: 1rem;
    font-style: italic;
}

.quran-text {
    font-family: 'amiriquran-regular', serif;
    font-size: 1.8rem;
    line-height: 2.5rem;
    text-align: right;
    direction: rtl;
    color: #2c3e50;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ddd;
}

.translation-text {
    font-size: 1rem;
    line-height: 1.6rem;
    text-align: justify;
    direction: rtl;
    color: #555;
    margin-top: 0.5rem;
}

.list-group-item.active-result {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.blazor-error-ui {
    display: none !important;
}

.connection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .connection-modal .modal-content {
        background-color: #222;
        color: white;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        box-shadow: 0 0 10px black;
    }

/* بهینه‌سازی جدول برای نمایش موبایل */
table tr {
    max-height: 32px;
    height: 32px;
}

table td, table th {
    padding: 4px 8px;
    line-height: 1.2;
}

.table-responsive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/*----------------- ربات ------------------------*/

.chat-container {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.chat-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    background-color: #f8f9fa;
    padding: 1rem;
}

.chat-bubble {
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    max-width: 80%;
    animation: fadeIn 0.4s ease-in-out;
    position: relative;
}

.bot-bubble {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    margin-right: auto;
}

.user-bubble {
    background-color: #007bff;
    color: white;
    margin-left: auto;
}

.bubble-content {
    word-wrap: break-word;
}

.bubble-time {
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: left;
    margin-top: 0.3rem;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

    .chat-input input {
        flex: 1;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-controls {
    border-top: 1px solid #dee2e6;
}

.quick-edit {
    border: 1px solid #dee2e6;
}

.success-message {
    padding: 2rem;
    background-color: #f8f9fa;
}

@media (max-width: 576px) {
    .chat-messages {
        height: 300px;
    }

    .chat-bubble {
        max-width: 90%;
    }
}

/*------------------ پایان ربات ----------------------*/

/*------------------- لاگین --------------------*/
.auth-card {
    max-width: 420px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.form-section.hidden {
    transform: translateX(100%);
    opacity: 0;
    position: absolute;
    width: 100%;
}

.form-section.active {
    transform: translateX(0);
    opacity: 1;
    position: relative;
}

/*------------------- پایان لاگین --------------------*/

/*---------------- بخش کاربری ------------------------*/
.admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-access {
    text-align: center;
    padding: 40px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.table-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .table-card:hover {
        border-color: #3b82f6;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.table-icon {
    font-size: 24px;
    margin-left: 12px;
}

.table-info {
    flex: 1;
}

.table-name {
    font-weight: 600;
    margin: 0;
    color: #374151;
}

.table-desc {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #6b7280;
}

.table-arrow {
    color: #9ca3af;
    font-size: 18px;
}

/*---------------- پایان بخش کاربری -------------------*/

/*اسکرول توضیحات و متن های طولانی*/
.scrollable-description {
    max-height: 200px; /* ارتفاع دلخواه */
    line-height: 1.8;
    overflow-y: auto;
    white-space: normal;
    text-align: justify; /* ترازبندی متن */
}


/* جلوگیری از نمایش outline فوکوس روی تیترهای غیرتعاملی */
h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus {
    outline: none !important;
}

@font-face {
    font-family: 'nastaliq';
    src: url('../fonts/mehr_nastaliq_web v. 2.0.ttf') format('truetype'), url('../fonts/mehr_nastaliq_web v.2.0.woff') format('woff');
}




/************************ نوار بالایی ثابت *****************************/

.top-alert-bar.bg-warning {
    background-color: #fff3cd; /* زرد ملایم هشدار (مثل بوت‌استرپ) */
    border-radius: 12px; /* گوشه‌های گرد – این مقدار رو می‌تونی تغییر بدی */
    padding: 12px 16px; /* کمی فاصله داخلی بهتر */
    margin: 1px 0; /* فاصله از بالا و پایین (اختیاری) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* متن سمت راست */
.alert-text {
    text-align: right;
}

/* دکمه‌ها سمت چپ */
.alert-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .alert-actions a {
        text-decoration: none;
        font-size: 18px;
        transition: transform .2s ease;
    }

        .alert-actions a:hover {
            transform: scale(1.1);
        }

/* فقط navbar ثابت بماند */
.navbar.fixed-top {
    top: 0;
}

/* فاصله محتوا فقط بر اساس navbar */
.body-content {
    margin-top: 80px !important;
}

/* موبایل */
@media (max-width: 576px) {

    .top-alert-bar {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .alert-text {
        text-align: center;
    }
}


/****************************************/


/* =============================================
   حل مشکل منو در موبایل
   ============================================= */

/* تنظیمات اصلی منو */
.navbar-collapse {
    transition: all 0.3s ease;
}

/* محدود کردن ارتفاع منو در موبایل و فعال کردن اسکرول */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #212529;
        border-radius: 0 0 12px 12px;
        padding: 10px 15px;
        margin-top: 5px;
        direction: rtl;
        text-align: right;
    }

        /* اسکرول‌بار زیبا برای منو */
        .navbar-collapse::-webkit-scrollbar {
            width: 6px;
        }

        .navbar-collapse::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
        }

        .navbar-collapse::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.3);
            border-radius: 10px;
        }

            .navbar-collapse::-webkit-scrollbar-thumb:hover {
                background: rgba(255,255,255,0.5);
            }

    /* استایل آیتم‌های منو */
    .navbar-nav .nav-item {
        padding: 2px 0;
    }

    .navbar-nav .nav-link {
        padding: 8px 15px;
        border-radius: 8px;
        color: rgba(255,255,255,0.85) !important;
        font-size: 0.95rem;
    }

        .navbar-nav .nav-link:hover {
            background: rgba(255,255,255,0.1);
            color: #fff !important;
        }

    /* منوی dropdown در موبایل */
    .dropdown-menu {
        position: static !important;
        background: rgba(255,255,255,0.05);
        border: none;
        padding: 0;
        margin: 5px 10px 10px 10px;
        transform: none !important;
        width: auto;
        box-shadow: none;
        border-radius: 8px;
    }

        .dropdown-menu .dropdown-item {
            color: rgba(255,255,255,0.8);
            padding: 8px 20px;
            border-radius: 6px;
            font-size: 0.9rem;
        }

            .dropdown-menu .dropdown-item:hover {
                background: rgba(255,255,255,0.1);
                color: #fff;
            }

    /* نشانگر dropdown در موبایل */
    .dropdown-toggle::after {
        float: left;
        margin-top: 10px;
        margin-left: 5px;
    }

    /* تنظیم ترتیب در موبایل */
    .navbar .container-fluid {
        flex-wrap: wrap;
    }

    .order-1 {
        order: 1;
    }

    .order-2 {
        order: 2;
    }

    .order-3 {
        order: 3;
    }
}

/* دکمه همبرگر */
.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
    }

/* زیبایی منو در دسکتاپ */
@media (min-width: 992px) {
    .navbar-nav {
        gap: 2px;
    }

    .dropdown-menu {
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        border: none;
        padding: 8px;
    }

        .dropdown-menu .dropdown-item {
            border-radius: 6px;
            padding: 8px 16px;
        }

            .dropdown-menu .dropdown-item:hover {
                background: #f0f4f8;
            }
}

/* نمایش دکمه‌های ادمین در موبایل */
@media (max-width: 991.98px) {
    .d-lg-flex {
        display: none !important;
    }
}

/* برای صفحه‌های خیلی کوچک */
@media (max-width: 576px) {
    .navbar .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

        .navbar .btn-sm i {
            font-size: 0.8rem;
        }

    .navbar-collapse {
        max-height: 60vh;
        padding: 8px 10px;
    }
}

/* استایل کارت‌ها */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.bg-orange {
    background-color: #fd7e14;
    color: white;
}


.access-denied {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

