/* ── Sidebar collapsible groups (Bootstrap 4 collapse) ───── */
.sidebar-menu .sidebar-collapse-wrap {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu .sidebar-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    /* room for chevron on the left; icon sits in-flow on the right */
    padding: 10px 14px 10px 36px;
    font-size: 15px;
    color: #0099ff;
    font-weight: 700;
    position: relative;
    text-decoration: none !important;
    border-top: 1px solid rgba(0, 153, 255, 0.12);
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-menu .sidebar-collapse-toggle:hover {
    background: #eaf6ff;
    color: #0077cc;
}

.sidebar-menu .sidebar-collapse-toggle .sidebar-icon {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.sidebar-menu .sidebar-collapse-title {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.sidebar-menu .sidebar-collapse-chevron {
    position: absolute;
    left: 12px;
    right: auto;
    font-size: 16px;
    color: #91a8b0;
    transition: transform 0.25s ease;
}

/* Collapsed: point left in RTL (toward content), not right */
.sidebar-menu .sidebar-collapse-toggle.collapsed .sidebar-collapse-chevron {
    transform: rotate(90deg);
}

.sidebar-menu .sidebar-collapse-toggle:not(.collapsed) .sidebar-collapse-chevron {
    transform: rotate(0deg);
}

.sidebar-menu .sidebar-collapse-list {
    list-style: none;
    margin: 0;
    padding: 0 0 6px 0;
    background: #f7fcff;
}

.sidebar-menu .sidebar-collapse-list > li.dropdown > a.dropdown-toggle {
    font-size: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-top: none;
}

.sidebar-menu .sidebar-collapse-list > li.dropdown:first-child > a.dropdown-toggle {
    box-shadow: inset 0 1px 0 rgba(0, 153, 255, 0.08);
}

/*
 * Theme positions .fa absolutely on the left (LTR).
 * In RTL the icon must sit on the right with enough padding so text never overlaps it.
 */
[dir="rtl"] .sidebar-menu > ul > li > a.dropdown-toggle,
[dir="rtl"] .sidebar-menu .sidebar-collapse-list > li > a.dropdown-toggle {
    padding: 10px 48px 10px 36px !important;
    text-align: right;
}

[dir="rtl"] .sidebar-menu .dropdown-toggle:after {
    right: auto !important;
    left: 14px !important;
}

[dir="rtl"] .sidebar-menu .dropdown-toggle .fa,
[dir="rtl"] .sidebar-menu .dropdown-toggle .sidebar-icon {
    position: absolute !important;
    left: auto !important;
    right: 14px !important;
    top: 13px !important;
    margin: 0 !important;
    width: 22px;
    text-align: center;
}

[dir="rtl"] .sidebar-menu .submenu li a {
    padding: 8px 48px 8px 16px !important;
    text-align: right;
}

[dir="rtl"] .sidebar-menu .submenu li a .fa,
[dir="rtl"] .sidebar-menu .submenu li a .sidebar-icon {
    position: absolute !important;
    left: auto !important;
    right: 14px !important;
    top: 11px !important;
}

/* ── Sidebar group labels (legacy) ─────────────────────────── */
.sidebar-menu .sidebar-group-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    padding: 1rem 1.1rem 0.3rem;
    margin-top: 0.25rem;
    pointer-events: none;
    cursor: default;
    list-style: none;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-menu ul > li:first-child.sidebar-group-label,
.sidebar-menu ul > li.sidebar-group-label:first-child {
    border-top: none;
    margin-top: 0;
}

/* Highlighted workspace link */
.sidebar-menu .sidebar-highlight {
    color: #ffd6e0 !important;
    font-weight: 600 !important;
}
.sidebar-menu .sidebar-highlight:hover {
    color: #fff !important;
}

/* Sidebar icon spacing */
.sidebar-icon {
    width: 18px;
    text-align: center;
    opacity: 0.75;
}

/* ── End sidebar styles ───────────────────────────────────── */

#problemList .problem-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.problem-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.problem-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    flex-shrink: 0;
}

    .problem-meta img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border: 1px solid #ccc;
        border-radius: 6px;
    }

    .problem-meta .btn-group {
        margin-top: 0.5rem;
    }

        .problem-meta .btn-group .btn {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            white-space: nowrap;
        }

.problem-content {
    flex-grow: 1;
}

.problem-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

    .problem-title-row a {
        font-size: 1.1rem;
        font-weight: 600;
        color: #0074cc;
        text-decoration: none;
    }

.bg-tag {
    background-color: #dedede !important;
}

@media (max-width: 576px) {
    .problem-body {
        flex-direction: row;
        align-items: flex-start;
    }

    .problem-meta {
        width: 60px;
    }

        .problem-meta img {
            width: 50px;
            height: 50px;
        }

        .problem-meta .btn-group {
            flex-wrap: wrap;
            justify-content: center;
        }
}


body {
    background-color: white;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 20px;
}

.clamp-text {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show max 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 6em;
    white-space: normal;
}

.modal-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 30px;
}

#typeTable {
    width: 100% !important;
}

.bootstrap-table .fixed-table-container {
    border-radius: 0.25rem;
    overflow-x: auto;
}

.bootstrap-table .search {
    display: none;
}

.custom-label {
    font-family: 'Tajawal', sans-serif;
    font-size: 20px;
}


/* Better touch targets on mobile */
.form-control,
.btn {
    min-height: 42px;
}


/* Select2 Custom Styling to Match Enhanced Forms */

/* Container */
.select2-container {
    direction: rtl;
    width: 100% !important;
}

/* Single Select Styling */
.select2-container--default .select2-selection--single {
    height: auto !important;
    min-height: 45px;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

    /* Selection Text */
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: #374151;
        line-height: 28px;
        padding-left: 0;
        padding-right: 30px;
        font-weight: 500;
    }

    /* Placeholder */
    .select2-container--default .select2-selection--single .select2-selection__placeholder {
        color: #9ca3af;
    }

    /* Arrow */
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 28px;
        right: auto;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

        .select2-container--default .select2-selection--single .select2-selection__arrow b {
            border-color: #6b7280 transparent transparent transparent;
            border-style: solid;
            border-width: 6px 5px 0 5px;
            height: 0;
            left: 50%;
            margin-left: -5px;
            margin-top: -3px;
            position: absolute;
            top: 50%;
            width: 0;
        }

/* Focus State */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Dropdown */
.select2-dropdown {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    overflow: hidden;
}

.select2-container--default .select2-dropdown {
    direction: rtl;
}

/* Search Box */
.select2-search--dropdown {
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

    .select2-search--dropdown .select2-search__field {
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 0.9rem;
        width: 100%;
        direction: rtl;
        background: white;
    }

        .select2-search--dropdown .select2-search__field:focus {
            border-color: #3b82f6;
            outline: none;
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        }

/* Results */
.select2-results {
    direction: rtl;
}

.select2-results__options {
    max-height: 200px;
    overflow-y: auto;
}

.select2-results__option {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

    .select2-results__option:last-child {
        border-bottom: none;
    }

/* Highlighted Option */
.select2-results__option--highlighted {
    background-color: #3b82f6;
    color: white;
}

/* Selected Option */
.select2-results__option--selected {
    background-color: #f0f9ff;
    color: #1e40af;
    font-weight: 600;
}

    .select2-results__option--selected.select2-results__option--highlighted {
        background-color: #2563eb;
        color: white;
    }

/* No Results */
.select2-results__option[aria-live="polite"] {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Clear Button */
.select2-selection__clear {
    color: #6b7280;
    cursor: pointer;
    float: left;
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
    margin-left: 0;
    position: relative;
    top: 1px;
}

    .select2-selection__clear:hover {
        color: #ef4444;
    }

/* Multiple Select Styling (if needed) */
.select2-container--default .select2-selection--multiple {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    cursor: text;
    min-height: 45px;
    padding: 4px 8px;
}

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: #3b82f6;
        border: 1px solid #2563eb;
        border-radius: 6px;
        color: white;
        font-size: 0.8rem;
        margin: 4px 4px 0 0;
        padding: 2px 8px;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        color: white;
        cursor: pointer;
        display: inline-block;
        font-weight: bold;
        margin-left: 4px;
        margin-right: 0;
    }

        .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
            color: #fca5a5;
        }

/* Disabled State */
.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #f3f4f6;
    cursor: default;
    color: #9ca3af;
    border-color: #d1d5db;
}

/* Loading State */
.select2-selection__rendered .select2-selection__spinner {
    float: left;
    margin-left: 10px;
    margin-right: 0;
}

/* Error State (for validation) */
.has-error .select2-container--default .select2-selection--single,
.error .select2-container--default .select2-selection--single {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Success State */
.has-success .select2-container--default .select2-selection--single,
.success .select2-container--default .select2-selection--single {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .select2-container--default .select2-selection--single {
        min-height: 40px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .select2-results__option {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .select2-search--dropdown {
        padding: 8px;
    }
}