﻿body {
    background: linear-gradient(to bottom, #e8f5e9, #ffffff);
    font-family: 'Cairo', sans-serif;
}

header {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-toggler {
    display: none !important;
}

.sidebar {
    background: linear-gradient(rgba(46, 125, 50, 0.9), rgba(27, 94, 32, 0.4));
    background-size: 100% 100%;
    background-position: top center; /* تم التعديل هنا */
    background-repeat: no-repeat;
    background-attachment: scroll;
    min-height: 100vh;
    box-shadow: inset -1px 0 5px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    transition: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

    .sidebar .nav-link {
        transition: background 0.3s ease, transform 0.2s ease;
        border-radius: 8px;
        font-weight: 600;
    }

        .sidebar .nav-link:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(-5px);
        }

.btn-light:hover {
    background-color: #c8e6c9;
}

/* صورة المستخدم على يسار النص في الشريط الجانبي */
.sidebar .user-box {
    text-align: left;
}

    .sidebar .user-box img {
        float: left;
        margin-left: 10px;
    }

/* تأثير Fade-in عند تحميل الصفحة */
body.fade-in {
    animation: fadeIn 1s ease-in;
}

.extinguisher-img {
    width: 130px;
    height: auto;
    display: block;
    margin: 20px auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* إخفاء الهامبرغر على الشاشات الكبيرة */
.hamburger {
    position: fixed;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    z-index: 1100;
    color: #2e7d32;
}

/* الشريط الجانبي: الوضع العادي */
#sidebar {
    transition: transform 0.3s ease;
}

/* الشريط الجانبي للشاشات الصغيرة لحد 991px */

@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 250px;
        height: 100%;
        background: linear-gradient(rgba(46, 125, 50, 0.9), rgba(27, 94, 32, 0.95)) );
        background-size: cover;
        background-position: top center; /* تم التعديل هنا */
        background-repeat: no-repeat;
        background-attachment: fixed;
        z-index: 1050;
        transform: translateX(105%);
        box-shadow: none;
    }


        #sidebar.show {
            transform: translateX(0);
        }

    body.overflow-hidden {
        overflow: hidden;
    }

    .content {
        padding-top: 70px;
    }

    .header-box {
        display: none !important;
    }

    .content > .d-flex {
        flex-direction: column;
        align-items: flex-end;
        height: auto !important;
        padding: 10px 15px;
    }

    .card {
        max-width: 100% !important;
        margin-bottom: 15px;
    }
}

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(110%);
    }

        #sidebar.show {
            transform: translateX(0);
        }

    .content {
        padding-top: 70px;
    }
}

.sidebar .nav-link {
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}

    .sidebar .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(-5px);
        color: white;
    }

.sidebar .logout-btn {
    background: none;
    border: none;
    color: white;
    width: 100%;
    text-align: right;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
}

    .sidebar .logout-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        transform: translateX(-5px);
    }

/* روابط الناف بار الجانبية */
.sidebar .nav-link,
.sidebar .logout-btn {
    color: white !important;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%;
    text-align: right;
    background: none;
    border: none;
}

    .sidebar .nav-link:hover,
    .sidebar .logout-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(-5px);
        color: white !important;
    }

.card {
    background-color: #ffffff;
    border: 2px solid #28a745;
    color: #276c29;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .header-box {
        display: none !important;
    }

    .content > .d-flex {
        flex-direction: column;
        align-items: flex-end;
        height: auto !important;
        padding: 10px 15px;
    }

    .card {
        max-width: 100% !important;
        margin-bottom: 15px;
    }
}

/* ========== User Info Card Styles ========== */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.user-card {
    background: linear-gradient(#ffffff, #ffffff);
    border: 2px solid #28a745;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.15);
    transition: all 0.3s ease;
    min-width: 280px;
    max-width: 320px;
}

    .user-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(46, 125, 50, 0.25);
        border-color: #1b5e20;
    }

.user-info-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid #28a745;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.3);
    transition: all 0.3s ease;
}

.user-card:hover .user-avatar {
    transform: scale(1.1);
    border-color: #1b5e20;
}

.user-info-content .text-end {
    flex: 1;
    text-align: right;
}

.user-info-content .fw-bold {
    font-size: 1.1rem;
    color: #1b5e20;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.user-info-content .text-muted {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

    .user-info-content .text-muted i {
        font-size: 0.85rem;
    }

/* Header Box (Logo and Title) */
.main-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

.vertical-line {
    width: 3px;
    height: 70px;
    background: linear-gradient(to bottom, #28a745, #1b5e20);
    border-radius: 2px;
}

.main-heading {
    text-align: right;
}

    .main-heading h2 {
        font-size: 1.4rem;
        font-weight: 700;
        color: #1b5e20;
        margin: 0 0 5px 0;
    }

    .main-heading h3 {
        font-size: 1rem;
        font-weight: 600;
        color: #28a745;
        margin: 3px 0;
    }

/* Responsive Design */
@media (max-width: 991.98px) {
    .header-container {
        flex-direction: column;
        align-items: flex-end;
        gap: 15px;
    }

    .user-card {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        margin-top: 10px;
    }

    .header-box {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .user-card {
        padding: 12px 15px;
        border-radius: 12px;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
    }

    .user-info-content .fw-bold {
        font-size: 1rem;
    }

    .user-info-content .text-muted {
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .user-card {
        padding: 10px 12px;
    }

    .user-avatar {
        width: 45px;
        height: 45px;
    }

    .user-info-content .fw-bold {
        font-size: 0.95rem;
    }

    .user-info-content .text-muted {
        font-size: 0.8rem;
    }
}

/* Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-card {
    animation: slideInRight 0.5s ease;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .user-card {
        background: linear-gradient(161deg, #ffffff, #f3f3f3);
        border-color: #28a745;
    }

    .user-info-content .fw-bold {
        color: #a5d6a7;
    }

    .user-info-content .text-muted {
        color: #81c784;
    }
}
#header,#header1 {
    margin-bottom: .5rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--bs-heading-color);
}
