/* Shared Dashboard Styles */
*,
::after,
::before {
    box-sizing: border-box;
}

body {
    overflow: auto;
    background-color: rgba(248, 247, 247, 1);
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b7924f, #d4af37);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #b7924f);
}

/* Navbar Utilities */
.mw-95 {
    max-width: 95%;
}

/* Sidebar Logo - Always Visible */
.sidebar .logo {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #fff;
    box-shadow: 0px 14px 10px rgba(8, 15, 52, 0.06);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10000;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.sidebar .logo img {
    max-width: 152px;
    height: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 0.8rem;
}

.sidebar ul li a {
    color: rgba(39, 58, 65, 1);
    text-decoration: none;
    font-size: 16px;
    padding: 0.7rem;
}

.sidebar ul li.active a {
    color: #b7924f !important;
    font-weight: bold;
}

.sidebar ul li a:hover {
    color: #b7924f;
}

.sidebar .nav-link.active {
    color: #b7924f;
}

.sidebar .icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease-in-out;
}

.sidebar ul li.active .icon,
.sidebar ul li:hover .icon {
    filter: brightness(0) saturate(100%) invert(64%) sepia(29%) saturate(343%) hue-rotate(8deg) brightness(95%) contrast(90%);
    transform: scale(1.05);
}

.sidebar .nav-item:hover {
    background-color: rgba(249, 248, 244, 1);
    border-radius: 8px;
}

.sidebar .nav-item.active {
    background-color: rgba(249, 248, 244, 1);
    border-radius: 8px;
}

/* Close Button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 2%;
    left: 0;
    font-size: 2rem;
    color: black;
}

/* custom container */

.custom-container {
    padding: 0 20rem 0 0;
}

/* navbar */
.search-bar {
    padding-right: 1rem;
    width: 100%;
}

.search-bar input {
    background-color: rgba(39, 58, 65, 0.05);
    border: none;
    padding: 0.7rem;
}

.search-bar input::placeholder {
    color: rgba(156, 156, 156, 1);
    font-size: 14px;
    padding: 0.5rem;
}

.search-bar input {
    background-color: #f7f7f7;
    border: none;
    padding-right: 2.5rem;
}

.search-bar input:focus {
    box-shadow: none;
    background-color: #f7f7f7;
}

.search-bar i {
    color: rgba(158, 158, 158, 1);
    font-size: 16px;
}

/* Content */
.content {
    margin-right: 270px;
    padding: 1rem 3rem;
    transition: margin-left 0.3s ease-in-out;
}

.btn-custom {
    background-color: rgba(211, 171, 85, 1);
    color: rgba(248, 247, 247, 1);
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    width: fit-content;
    max-width: 100%;
}

.btn-custom:hover {
    background-color: rgb(211, 160, 51);
    color: rgba(248, 247, 247, 1);
}

.btn-outline-custom {
    background-color: rgba(248, 247, 247, 1);
    color: rgba(211, 171, 85, 1);
    border: rgba(211, 171, 85, 1) 1px solid;
    padding: 15px 22px;
    border-radius: 50px;
}

.btn-outline-custom:hover {
    background-color: rgba(211, 171, 85, 1);
    color: rgba(248, 247, 247, 1);
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0%);
    }

    .sidebar-close {
        display: block;
    }

    .content {
        margin-right: 0 !important;
        padding: 0.5rem;
    }

    .custom-container {
        padding: 0;
    }

    .search-bar {
        width: 100%;
    }

    .btn-custom {
        width: 50%;
    }
}

/* تخصيص شكل الباجينيشن */
.custom-pagination .page-link {
    border: none;
    border-radius: 50px;
    padding: 10px 5;
    text-align: center;
    margin: auto 1rem;
    color: black;
    background-color: transparent;
    transition: all 0.3s ease;
}

.custom-pagination .page-link:hover {
    background-color: rgba(211, 171, 85, 1);
    color: white;
}

.custom-pagination .page-item.active .page-link {
    background-color: rgba(211, 171, 85, 1);
    color: white;
    font-weight: bold;
}

.custom-pagination .page-item.disabled .page-link {
    background-color: transparent;
    color: #aaa;
    border: none;
    cursor: default;
}

.modal-body input::placeholder {
    color: rgba(123, 123, 123, 0.5);
    font-size: 16px;
    font-weight: 400;
    text-align: right;
}

.modal-body input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
textarea,
select {
    padding: 1rem;
    border-radius: 10px;
}

.modal-body label {
    margin-bottom: 1rem;
}

.custom-select {
    background-position: left 0.75rem center;
    background-size: 16px 16px;
    padding: 1rem;
    border-radius: 10px;
}

[dir="rtl"] .custom-select {
    background-position: left 1rem center;
    padding-right: 2.5rem;
}

#loadingIndicator {
    width: 100%;
    padding: 20px;
    color: #b7924f;
    font-weight: bold;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* أنماط بسيطة لـ spinner الحفظ */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* =========================
   News cards (improved UI)
   ========================= */

.news-card {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(8, 15, 52, 0.06);
    box-shadow: 0 10px 20px rgba(8, 15, 52, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(8, 15, 52, 0.10);
}

.news-thumb {
    flex: 0 0 160px;
    background: rgba(39, 58, 65, 0.04);
}

.news-thumb img {
    display: block;
    width: 160px;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
}

.news-body {
    flex: 1 1 auto;
    padding: 16px 16px 14px;
    min-width: 0;
}

.news-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.news-title-wrap {
    min-width: 0;
}

.news-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #111;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-date {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(39, 58, 65, 0.6);
    white-space: nowrap;
}

.news-actions-trigger {
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(39, 58, 65, 0.05);
    border: 1px solid rgba(39, 58, 65, 0.08);
}

.news-actions-trigger:hover {
    background: rgba(39, 58, 65, 0.08);
}

.news-actions .dropdown-menu {
    border-radius: 14px;
    padding: 6px;
    min-width: 180px;
}

.news-actions .dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
}

.news-actions .dropdown-item:active {
    background: rgba(211, 171, 85, 0.12);
    color: #111;
}

.news-excerpt {
    margin: 12px 0 14px;
    color: rgba(39, 58, 65, 0.75);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.news-bottom {
    display: flex;
    justify-content: flex-start;
}

.news-card .btn-outline-custom {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 999px;
}

@media (max-width: 576px) {
    .news-card {
        flex-direction: column;
        gap: 0;
    }

    .news-thumb,
    .news-thumb img {
        width: 100%;
        flex-basis: auto;
    }

    .news-thumb img {
        height: 190px;
        min-height: 190px;
    }

    .news-title {
        white-space: normal;
    }
}

/* =========================
   Modal image preview
   ========================= */

.news-image-preview {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(39, 58, 65, 0.12);
    background: rgba(39, 58, 65, 0.03);
}

.news-image-preview img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.news-image-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    /* RTL: top-left feels natural for close */
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
}

.news-image-remove:hover {
    background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 576px) {
    .news-image-preview img {
        height: 180px;
    }
}