/* Dashboard Styles */

/* Sidebar Styles */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 280px;
    background-color: #ffffff;
    color: #333;
    position: fixed;
    height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #f0f0f0;
}

.sidebar-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    text-align: center;
    margin-bottom: 10px;
}

.sidebar-header h5 {
    font-weight: 700;
    color: #0d6efd;
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Sidebar toggle button inside header */
.sidebar-toggle-inner {
    cursor: pointer;
    color: #0d6efd;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    position: relative;
    z-index: 1050;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-inner:hover {
    background-color: rgba(13, 110, 253, 0.1);
    transform: scale(1.05);
}

.sidebar-menu {
    padding: 10px 0;
}

/* Icon styling for menu items */
.menu-section-header i:first-child,
.menu-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s;
}

.menu-section-header:hover i:first-child,
.menu-link:hover i,
.menu-link.active i {
    opacity: 1;
    color: #0d6efd;
}

html[dir="rtl"] .menu-section-header i:first-child,
html[dir="rtl"] .menu-link i {
    margin-right: 0;
    margin-left: 10px;
}

.menu-section-header {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eaeaea;
    font-weight: 600;
    transition: all 0.3s;
    align-items: center;
    justify-content: space-between;
    color: #495057;
    border-left: 4px solid transparent;
}

.menu-section-header:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    border-left: 4px solid #0d6efd;
}

.menu-section-items {
    background-color: #f8f9fa;
    padding: 5px 0;
    transition: all 0.3s ease;
}

/* Animation for menu items */
.menu-section-items .menu-link {
    transform: translateX(0);
    transition: transform 0.3s ease, background-color 0.3s, color 0.3s, border-left 0.3s;
}

html[dir="rtl"] .menu-section-items .menu-link {
    transform: translateX(0);
    transition: transform 0.3s ease, background-color 0.3s, color 0.3s, border-right 0.3s;
}

/* Smooth collapse animation */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.menu-link {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    font-size: 0.95rem;
    margin: 2px 0;
}

.menu-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border-left: 4px solid #0d6efd;
}

.menu-link.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    border-left: 4px solid #0d6efd;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.1);
}

.menu-item .menu-link {
    padding: 14px 20px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #eaeaea;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: #fff;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    background-color: #fff;
    padding: 1rem;
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

.card-header.bg-primary, .card-header.bg-success, .card-header.bg-info, 
.card-header.bg-warning, .card-header.bg-danger, .card-header.bg-secondary {
    color: #fff;
}

.card-body {
    padding: 1.25rem;
}

/* Dashboard Widgets */
.stat-card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-card .icon {
    font-size: 2.5rem;
    opacity: 0.8;
}


/* Show sidebar button - visible when sidebar is hidden */
.sidebar-show {
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1100;
    cursor: pointer;
    background-color: #ffffff;
    color: #0d6efd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
}

.sidebar-show:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
}

/* Show the button when sidebar is hidden */
.sidebar.active ~ .sidebar-show,
.sidebar.active + .main-content .sidebar-show {
    display: flex;
}

/* Default styles for desktop view */
.sidebar {
    margin-left: 0;
}

.sidebar.active {
    margin-left: -280px;
}

.main-content {
    margin-left: 280px;
}

.main-content.active {
    margin-left: 0;
}

/* Responsive styles for mobile view */
@media (max-width: 992px) {
    .sidebar {
        margin-left: -280px;
    }

    .sidebar.active {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.active {
        margin-left: 280px;
    }
}

/* RTL Adjustments */
html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
    margin-right: 0;
}

html[dir="rtl"] .sidebar.active {
    margin-right: -280px;
}

html[dir="rtl"] .main-content {
    margin-right: 280px;
    margin-left: 0;
}

html[dir="rtl"] .main-content.active {
    margin-right: 0;
}

/* RTL support for show sidebar button */
html[dir="rtl"] .sidebar-show {
    right: 10px;
    left: auto;
}

html[dir="rtl"] .menu-link {
    padding: 10px 40px 10px 20px;
    border-left: none;
    border-right: 4px solid transparent;
}

html[dir="rtl"] .menu-link:hover {
    border-left: none;
    border-right: 4px solid #0d6efd;
}

html[dir="rtl"] .menu-link.active {
    border-left: none;
    border-right: 4px solid #0d6efd;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.1);
}

html[dir="rtl"] .menu-section-header {
    border-left: none;
    border-right: 4px solid transparent;
}

html[dir="rtl"] .menu-section-header:hover {
    border-left: none;
    border-right: 4px solid #0d6efd;
}

html[dir="rtl"] .menu-item .menu-link {
    padding: 14px 20px;
}

/* RTL Responsive styles for mobile view */
@media (max-width: 992px) {
    html[dir="rtl"] .sidebar {
        margin-right: -280px;
        margin-left: 0;
    }

    html[dir="rtl"] .sidebar.active {
        margin-right: 0;
    }

    html[dir="rtl"] .main-content {
        margin-right: 0;
    }

    html[dir="rtl"] .main-content.active {
        margin-right: 280px;
        margin-left: 0;
    }
}
