﻿/* =============================================
   Glassmorphism Theme for Dash Light
   (Final Fix – No Stacking Context on Rows)
   ============================================= */

/* ---------- پس‌زمینه روشن و شیشه‌ای ---------- */
body.nk-body {
    background: radial-gradient(ellipse at 20% 50%, rgba(203, 213, 225, 0.3) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(226, 232, 240, 0.25) 0%, transparent 55%), linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    background-attachment: fixed;
    position: relative;
    color: #0f172a;
}

    /* انیمیشن ملایم */
    body.nk-body::before {
        content: "";
        position: fixed;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle at 30% 50%, rgba(203, 213, 225, 0.1) 0%, transparent 50%), radial-gradient(circle at 70% 30%, rgba(226, 232, 240, 0.08) 0%, transparent 50%);
        z-index: 0;
        animation: auroraMove 20s ease-in-out infinite alternate;
        pointer-events: none;
    }

@keyframes auroraMove {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-1%, 1%) scale(1.02);
    }

    100% {
        transform: translate(1%, -1%) scale(1);
    }
}

/* ---------- هدر ---------- */
.nk-header {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    z-index: 1030;
    color: #0f172a;
}

/* ---------- سایدبار ---------- */
.nk-sidebar {
    background: linear-gradient(135deg, #0f172a, #312e81) !important; /* سرمه‌ای تیره → بنفش عمیق */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1020;
}

    .nk-sidebar .nk-menu-link {
        color: rgba(255, 255, 255, 0.95) !important;
        font-weight: 500;
    }

        .nk-sidebar .nk-menu-link:hover,
        .nk-sidebar .nk-menu-item.active > .nk-menu-link,
        .nk-sidebar .nk-menu-item.current-menu > .nk-menu-link {
            background: rgba(255, 255, 255, 0.2) !important;
            color: #fff !important;
            border-radius: 8px;
        }

    .nk-sidebar .nk-menu-heading {
        color: rgba(255, 255, 255, 0.7) !important;
        font-weight: 600;
    }

    .nk-sidebar .nk-menu-icon {
        color: rgba(255, 255, 255, 0.8) !important;
    }

/* ---------- کارت‌ها (شیشه‌ای بدون ایجاد Stacking Context) ---------- */
.card,
.card-bordered {
    position: relative;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 18px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
    color: #0f172a;
    overflow: visible !important;
    z-index: auto; /* مهم: z-index خودکار تا Stacking Context اضافه نسازد */
}

    /* لایه شیشه‌ای پشت کارت */
    .card::before,
    .card-bordered::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: inherit;
        background: inherit;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        z-index: -1; /* پشت محتوا، ولی در همان Stacking Context */
    }

.card-header,
.card-footer {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

/* ---------- جداول (ردیف‌ها بدون Stacking Context) ---------- */
/* هدر جدول */
.nk-tb-list .nk-tb-head {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* ردیف‌های جدول – فقط رنگ، بدون هیچ position یا z-index */
.nk-tb-list .nk-tb-item {
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    /* مطلقاً هیچ position یا z-index اضافه نشود */
}

    .nk-tb-list .nk-tb-item:hover {
        background: rgba(255, 255, 255, 0.85);
    }

/* استایل وضعیت‌ها */
.tb-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

    .tb-status.text-info {
        color: #0284c7 !important;
        background: rgba(2, 132, 199, 0.15);
    }

    .tb-status.text-warning {
        color: #a16207 !important;
        background: rgba(245, 158, 11, 0.15);
    }

    .tb-status.text-danger {
        color: #b91c1c !important;
        background: rgba(220, 38, 38, 0.15);
    }

    .tb-status.text-success {
        color: #15803d !important;
        background: rgba(22, 163, 74, 0.15);
    }

/* ---------- دراپ‌داون (همیشه قابل مشاهده) ---------- */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.1);
    border-radius: 16px !important;
    z-index: 9999 !important; /* بالاترین اولویت */
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    color: #0f172a !important;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.15s;
}

    .dropdown-item:hover {
        background: rgba(102, 126, 234, 0.1) !important;
        color: #3730a3 !important;
    }

/* ---------- فرم‌ها ---------- */
.form-control,
.form-select,
.custom-select {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
    border-radius: 10px;
}

    .form-control:focus,
    .form-select:focus {
        background: rgba(255, 255, 255, 1) !important;
        border-color: rgba(55, 48, 163, 0.5) !important;
        box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.15) !important;
    }

.form-label {
    color: #1e293b !important;
    font-weight: 500;
}

/* ---------- دکمه‌ها ---------- */
.btn-primary {
    background: linear-gradient(135deg, #3730a3, #5b21b6) !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(55, 48, 163, 0.5);
    color: #fff !important;
    transition: all 0.3s;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(55, 48, 163, 0.7);
    }

.btn-light, .dual-listbox .dual-listbox__button {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

    .btn-outline-light:hover {
        background: rgba(0, 0, 0, 0.03);
    }

.btn-dim.btn-outline-light,
.btn-white {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

/* ---------- مودال‌ها ---------- */
.modal-content {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ---------- سایر ---------- */
.alert {
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

.badge {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.progress {
    background: rgba(0, 0, 0, 0.05) !important;
}

.pagination .page-link {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #3730a3, #5b21b6) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(0, 0, 0, 0.05);
}

/* z-index محتوا */
.nk-content {
    position: relative;
    z-index: 1;
}

/* رنگ‌های تیره برای متن */
.nk-block-title, .card-title, h4, h5, h6 {
    color: #0f172a !important;
}

.text-soft {
    color: #475569 !important;
}

/* رفع overflow در کارت‌های حاوی جدول */
.card-stretch,
.card-inner.p-0,
.card-inner-group {
    overflow: visible !important;
}


