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

/* 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: 1040;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

/* Sidebar scrollbar styling */
.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);
}

.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: .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: .7rem;
}

.search-bar input::placeholder {
    color: rgba(156, 156, 156, 1);
    font-size: 14px;
    padding: .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;
}

.tree-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem;
    text-align: right;
    padding-right: 1rem;
}

.tree-card {
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tree-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background-color: rgba(39, 58, 65, 0.1);
}

.all-trees-section .tree-card img {
    aspect-ratio: 16 / 9;
}

.card-footer {
    background-color: white;
    text-align: right;
    font-weight: 500;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

/* Ensure table cells don't wrap unnecessarily */
.table th,
.table td {
    white-space: nowrap;
}

.table td,
.table th {
    padding: 1.2rem;
}

.table th {
    color: rgba(63, 63, 63, 1);
    font-size: 15px;
}

.table {
    border-radius: 12px !important;
}


.btn i {
    font-size: 1.2rem;
}


@media (max-width: 767.98px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .programmes-table {
        font-size: 14px;
    }

    .pagination-controls select {
        width: 80px;
    }
}

/* 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: .5rem;
    }

    .custom-container {
        padding: 0;
    }

    .search-bar {
        width: 100%;
    }
}

/* تخصيص إشعارات Toastify */
.toast-success {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2E7D32;
}

.toast-error {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #C62828;
}

.toastify {
    border-radius: 4px;
    padding: 12px 20px;
}

.toastify-avatar {
    width: 24px;
    height: 24px;
    margin-left: 10px;
}

#tableContainer {
    position: relative;
}

/* تغطية شفافة على الجدول أثناء التحميل */
.loading-overlay {
    display: none;
    /* مخفي افتراضياً */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* دائرة التحميل */
.loading-spinner {
    display: none;
    /* مخفي افتراضياً */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
}

/* Filter Header Styles */
.filter-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.filter-header:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

/* Filter Toggle Button */
.filter-toggle-btn {
    background: linear-gradient(135deg, #b7924f 0%, #d4af37 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(183, 146, 79, 0.3);
    position: relative;
}

.filter-toggle-btn:hover {
    background: linear-gradient(135deg, #a0823f 0%, #c19b2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 146, 79, 0.4);
    color: white;
}

.filter-toggle-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.filter-count {
    background: rgba(255, 255, 255, 0.9);
    color: #b7924f;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
    animation: bounceIn 0.3s ease;
}

/* Filter Modal Styles */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1050;
    animation: fadeIn 0.3s ease;
}

.filter-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.filter-modal-header {
    background: linear-gradient(135deg, #b7924f 0%, #d4af37 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.filter-modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.filter-modal-body {
    padding: 2rem;
    max-height: 50vh;
    overflow-y: auto;
}

.filter-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.filter-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.filter-label i {
    color: #b7924f;
}

.filter-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.filter-select:focus {
    border-color: #b7924f;
    box-shadow: 0 0 0 0.2rem rgba(183, 146, 79, 0.25);
    background-color: #fff;
}

.filter-select:hover {
    border-color: #b7924f;
    background-color: #fefefe;
}

/* Filter Tags */
.filter-tag {
    background: linear-gradient(135deg, #b7924f 0%, #d4af37 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 2px 8px rgba(183, 146, 79, 0.3);
}

.filter-tag .remove-filter {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag .remove-filter:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Enhanced Buttons */
.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #b7924f 0%, #d4af37 100%);
    border: none;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a0823f 0%, #c19b2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 146, 79, 0.4);
}

/* Results Counter */
#resultsCount {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

/* Filter Spinner */
#filterSpinner {
    width: 1.5rem;
    height: 1.5rem;
}

/* Custom Date Range */
#customDateRange input[type="date"] {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

#customDateRange input[type="date"]:focus {
    border-color: #b7924f;
    box-shadow: 0 0 0 0.2rem rgba(183, 146, 79, 0.25);
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(183, 146, 79, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(183, 146, 79, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(183, 146, 79, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Enhanced Form Labels */
.form-label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label i {
    color: #b7924f;
}

/* Responsive Enhancements */
@media (max-width: 991.98px) {
    .filter-header {
        padding: 1rem !important;
    }

    .filter-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .filter-modal-body {
        padding: 1.5rem;
    }

    .filter-toggle-btn {
        padding: 0.6rem 1.2rem;
        font-size: 14px;
    }

    .btn-sm {
        font-size: 12px;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 767.98px) {
    .filter-header .d-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    .filter-header .d-flex:first-child {
        flex-direction: row;
        align-items: center !important;
    }

    .filter-modal-content {
        width: 98%;
        margin: 1rem;
        max-height: 90vh;
    }

    .filter-modal-body {
        padding: 1rem;
        max-height: 60vh;
    }

    .filter-modal-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .filter-modal-footer .btn {
        width: 100%;
    }

    .filter-toggle-btn {
        padding: 0.5rem 1rem;
        font-size: 13px;
    }

    .filter-count {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

    #activeFilters {
        margin-top: 1rem !important;
    }

    .filter-tag {
        font-size: 11px;
        padding: 0.3rem 0.6rem;
    }

    #resultsCount {
        font-size: 12px;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .filter-modal-header {
        padding: 1rem;
    }

    .filter-modal-header h5 {
        font-size: 1rem;
    }

    .btn-close-modal {
        width: 30px;
        height: 30px;
    }

    .filter-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .filter-select {
        font-size: 13px;
        padding: 0.6rem 0.8rem;
    }
}