/* ============================================================
   Main Law Quick Chips Bar — v2
   Legal Assistant Platform © 2026
   ============================================================ */

.main-law-chips-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 8px 12px 10px;
    background: var(--primary);
    border-top: 1px solid rgba(255,255,255,0.08);
    overflow: visible;
    position: relative;
}

.mlc-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

    .mlc-label i {
        color: var(--accent-light);
    }

.mlc-chips {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    /* تلاشي تدريجي على الطرف الأيمن قبل زر المزيد — RTL */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 60px);
    mask-image: linear-gradient(to right, transparent 0%, black 60px);
}

    .mlc-chips::-webkit-scrollbar {
        display: none;
    }

.mlc-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
    line-height: 1.5;
}

    .mlc-chip:hover {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.3);
        color: #fff;
    }

    .mlc-chip.active {
        background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
        border-color: transparent;
        color: #fff;
        box-shadow: 0 2px 8px rgba(200,134,10,0.4);
    }

    .mlc-chip.mlc-all {
        background: rgba(255,255,255,0.12);
        border-color: rgba(255,255,255,0.22);
    }

        .mlc-chip.mlc-all.active {
            background: rgba(255,255,255,0.22);
            border-color: rgba(255,255,255,0.35);
            box-shadow: none;
            color: #fff;
        }

.mlc-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px dashed rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .18s;
}

    .mlc-more-btn:hover,
    .mlc-more-btn.open {
        border-color: var(--accent-light);
        color: var(--accent-light);
    }

/* Dropdown مثبّت في الـ body عبر JS لتجنب overflow قطع */
.mlc-dropdown {
    position: fixed;
    z-index: 1200;
    background: #fff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(26,58,92,0.18);
    width: 420px;
    max-width: calc(100vw - 24px);
    max-height: 340px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mlcDropIn .15s ease;
}

@keyframes mlcDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mlc-dropdown-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mlc-dropdown-title {
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

.mlc-dropdown-search {
    /*flex: 1;*/
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 4px 9px;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    min-width: 0;
}

    .mlc-dropdown-search::placeholder {
        color: rgba(255,255,255,0.45);
    }

    .mlc-dropdown-search:focus {
        border-color: var(--accent-light);
        background: rgba(255,255,255,0.18);
    }

.mlc-dropdown-reset {
    background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    color: var(--primary);
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: 'Tajawal', sans-serif;
}

    .mlc-dropdown-reset:hover {
        background: rgba(255,255,255,0.22);
        color: #fff;
    }

.mlc-dropdown-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.mlc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
    transition: background .1s;
    font-family: 'Tajawal', sans-serif;
}

    .mlc-dropdown-item:last-child {
        border-bottom: none;
    }

    .mlc-dropdown-item:hover {
        background: var(--bg-elevated);
        color: var(--primary-light);
    }

    .mlc-dropdown-item.active {
        background: rgba(37,99,168,0.07);
        color: var(--primary);
        font-weight: 700;
    }

.mlc-inline-list .mlc-dropdown-item {
    position: relative;
    padding-right: 26px;
}

    .mlc-inline-list .mlc-dropdown-item::before {
        content: '';
        position: absolute;
        right: 7px;
        top: 50%;
        transform: translateY(-50%);
        width: 14px;
        height: 14px;
        border: 1.5px solid var(--border);
        border-radius: 4px;
        background: #fff;
        transition: background .15s, border-color .15s;
    }

    .mlc-inline-list .mlc-dropdown-item.active {
        border-color: var(--primary-light);
        background: rgba(37,99,168,0.1);
    }

        .mlc-inline-list .mlc-dropdown-item.active::before {
            background: var(--accent);
            border-color: var(--accent);
        }

        .mlc-inline-list .mlc-dropdown-item.active::after {
            content: '';
            position: absolute;
            right: 11px;
            top: 50%;
            width: 4px;
            height: 8px;
            border: solid #fff;
            border-width: 0 1.5px 1.5px 0;
            transform: translateY(-60%) rotate(45deg);
        }

.mlc-item-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background .15s;
}

.mlc-dropdown-item.active .mlc-item-dot {
    background: var(--accent);
}

.mlc-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right:20px;
}
.mlc-inline-panel {
    width: 100%;
    background: #fff;
    border-top: 2px solid var(--primary-light);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mlcDropIn .15s ease;
}

.mlc-inline-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    max-height: 200px;
    overflow-y: auto;
    padding: 6px 8px;
    gap: 4px;
}

    .mlc-inline-list .mlc-dropdown-item {
        border: 1px solid var(--border-light);
        border-radius: 5px;
        padding: 5px 8px;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        width: 100%;
    }

    .mlc-inline-list .mlc-item-dot {
        display: none;
    }

@media (max-width: 767px) {
    .mlc-label {
        display: none;
    }

    .mlc-dropdown {
        width: calc(100vw - 20px);
    }
}

@media (max-width: 399px) {
    .main-law-chips-bar {
        padding: 6px 8px;
        gap: 4px;
    }

    .mlc-chip {
        padding: 3px 8px;
        font-size: 11px;
    }
}
