:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --sidebar-width: 240px;
    --main-bg-color: #f3f3f9;
    --main-text-color: #1a237e;
    --second-text-color: #424242;
    --second-bg-color: #ffffff;
    --accent-color: #ff4081;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --tech-primary: #2196F3;
    --tech-secondary: #607D8B;
    --tech-success: #4CAF50;
    --tech-info: #00BCD4;
    --tech-warning: #FFC107;
    --tech-danger: #F44336;
    --tech-light: #ECEFF1;
    --tech-dark: #263238;
    --tech-gradient: linear-gradient(135deg, var(--tech-primary), var(--tech-info));
}

/* Global Styles */
body {
    font-family: 'Rubik', sans-serif;
    background: var(--tech-light);
    min-height: 100vh;
}

/* Sidebar Styles */
#sidebar-wrapper {
    min-height: 100vh;
    margin-right: calc(-1 * var(--sidebar-width));
    transition: margin 0.25s ease-out;
    background: #ffffff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    width: var(--sidebar-width);
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.2rem 1.5rem;
    font-size: 1.3rem;
    background: var(--tech-gradient);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#wrapper.toggled #sidebar-wrapper {
    margin-right: 0;
}

/* Menu Items */
.menu-item {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

/* Module-specific colors */
.menu-item[data-module="sales"] .main-menu-item {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

.menu-item[data-module="inventory"] .main-menu-item {
    background: linear-gradient(45deg, #4CAF50, #388E3C);
}

.menu-item[data-module="logistics"] .main-menu-item {
    background: linear-gradient(45deg, #FF9800, #F57C00);
}

.menu-item[data-module="omni"] .main-menu-item {
    background: linear-gradient(45deg, #9C27B0, #7B1FA2);
}

.menu-item[data-module="system"] .main-menu-item {
    background: linear-gradient(45deg, #607D8B, #455A64);
}

.menu-item[data-module="reports"] .main-menu-item {
    background: linear-gradient(45deg, #FF5722, #E64A19);
}

.list-group-item.main-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    border: none;
    color: var(--tech-dark);
    background: transparent;
    transition: all 0.3s ease;
    gap: 12px;
    font-weight: 500;
    border-right: 4px solid transparent;
}

.list-group-item.main-menu-item:hover,
.list-group-item.main-menu-item.active {
    background: rgba(33, 150, 243, 0.1);
    color: var(--tech-primary);
    border-right-color: var(--tech-primary);
}

.list-group-item.main-menu-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.list-group-item.main-menu-item span {
    font-size: 0.95rem;
}

.list-group-item.submenu-item {
    padding: 0.75rem 2rem;
    background: transparent;
    border: none;
    color: var(--second-text-color);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-group-item.submenu-item:hover {
    background: rgba(33, 150, 243, 0.05);
    color: var(--tech-primary);
    padding-right: 2.5rem;
}

.list-group-item.submenu-item i {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
}

/* Dashboard item special styling */
.menu-item:first-child .main-menu-item {
    background: var(--tech-gradient);
}

.menu-item:first-child .main-menu-item:hover::before {
    opacity: 1;
}

/* Submenu Layer */
.submenu-layer {
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.submenu-layer.show {
    transform: translateX(0);
}

.submenu-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--tech-gradient);
    color: white;
}

.submenu-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.close-submenu {
    cursor: pointer;
    padding: 8px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.close-submenu:hover {
    color: white;
    transform: scale(1.1);
}

.submenu-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
    border-right: 3px solid transparent;
    opacity: 0;
    transform: translateX(20px);
}

.submenu-item.show {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.submenu-item i {
    width: 20px;
    text-align: center;
    font-size: 0.8em;
    color: #6c757d;
}

.submenu-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    border-right-color: #0d6efd;
}

.submenu-item:hover i {
    color: #0d6efd;
}

/* Overlay */
.submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1040;
}

.submenu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Animation for submenu items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.submenu-item {
    animation: slideIn 0.3s ease forwards;
    animation-delay: calc(var(--item-index) * 0.05s);
}

/* Hidden Layer Styles */
.submenu-layer {
    position: fixed;
    top: 0;
    right: 280px; /* Adjust based on your sidebar width */
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.submenu-layer.show {
    transform: translateX(0);
}

.submenu-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.close-submenu {
    cursor: pointer;
    padding: 8px;
    color: #6c757d;
    transition: color 0.3s ease;
}

.close-submenu:hover {
    color: #dc3545;
}

.submenu-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.submenu-item i {
    width: 24px;
    text-align: center;
    margin-left: 12px;
    color: #6c757d;
}

.submenu-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    border-right-color: #0d6efd;
}

.submenu-item:hover i {
    color: #0d6efd;
}

/* Overlay when submenu is open */
.submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.submenu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Animation for submenu items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.submenu-item {
    animation: slideIn 0.3s ease forwards;
    animation-delay: calc(var(--item-index) * 0.05s);
}

.menu-module {
    position: relative;
}

.submenu-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f8f9fa;
}

.submenu-container.show {
    max-height: 500px;
}

.module-options {
    position: absolute;
    right: calc(100% - 10px);
    top: 0;
    width: 220px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: none;
    z-index: 1000;
    padding: 0.5rem 0;
}

.module-options:before {
    content: '';
    position: absolute;
    left: -6px;
    top: 15px;
    width: 12px;
    height: 12px;
    background: white;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    transform: rotate(-45deg);
}

.module-options.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.module-options .option-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.module-options .option-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
}

.module-options .option-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Notifications */
.notifications {
    position: relative;
    cursor: pointer;
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    padding: 4px 6px;
}

.notifications i {
    color: var(--tech-dark);
    transition: all 0.3s ease;
}

.notifications i:hover {
    color: var(--tech-primary);
    transform: scale(1.1);
}

/* Floating Chat & Status */
.floating-chat {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.chat-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-panel {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: none;
}

.chat-panel.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

/* Status Bar Styles */
.employee-status-bar {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.status-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-controls select {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    background: var(--tech-light);
    color: var(--tech-dark);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 150px;
}

.status-controls select:hover {
    border-color: var(--tech-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-controls select:focus {
    outline: none;
    border-color: var(--tech-primary);
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.1);
}

.status-indicator i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.status-indicator span {
    font-weight: 500;
    color: var(--tech-dark);
}

.status-indicator.online i {
    color: var(--tech-success);
}

.status-indicator.break i {
    color: var(--tech-warning);
}

.status-indicator.busy i {
    color: var(--tech-danger);
}

.status-indicator.offline i {
    color: var(--tech-secondary);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.data-table th {
    background: var(--tech-light);
    border: none;
    font-weight: 500;
    color: var(--tech-dark);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.warning {
    background: #fff3e0;
    color: #ef6c00;
}

.status-badge.danger {
    background: #ffebee;
    color: #c62828;
}

.status-badge.info {
    background: #e3f2fd;
    color: #1565c0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Table Adjustments */
.data-table th:first-child,
.data-table td:first-child {
    padding-right: 1.5rem;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-left: 1.5rem;
}

/* Media Queries */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-right: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-right: -15rem;
    }
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.agent-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 1rem;
}

.agent-info {
    flex: 1;
}

.agent-info h6 {
    margin: 0;
    font-weight: 600;
}

.agent-info p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.875rem;
}

.agent-info small {
    display: block;
    color: #6c757d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Extensions Map */
.extensions-map {
    padding: 1rem;
}

.extension-group {
    margin-bottom: 1.5rem;
}

.extension-group h6 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.extension-group ul li {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.extension-group ul li i {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

/* Channel Statistics */
.channels-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.channel-item i {
    font-size: 1rem;
}

/* Dashboard Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    border: none;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Charts Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }

    .channels-legend {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* RTL Specific Adjustments */
.nav-tabs .nav-link {
    margin-right: 0;
    margin-left: 0.5rem;
}

.agent-avatar {
    margin-right: 0;
    margin-left: 1rem;
}

.channel-item i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Tech Theme Styles */
.btn-primary {
    background: var(--tech-gradient);
    border: none;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33,150,243,0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-right: calc(-1 * var(--sidebar-width));
    }
    
    #wrapper.toggled #sidebar-wrapper {
        margin-right: 0;
    }

    #page-content-wrapper {
        margin-right: 0;
    }

    .employee-status-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .status-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .status-indicator {
        width: 100%;
        justify-content: center;
    }

    .list-group-item {
        margin: 0.3rem 0.5rem;
        padding: 0.8rem 1rem;
    }
}

/* Add smooth transitions */
#wrapper {
    transition: all 0.3s ease;
}

#page-content-wrapper {
    transition: margin 0.3s ease;
}

/* Menu Toggle Button */
#menu-toggle {
    background: var(--tech-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
