/* Admin Dashboard Premium Styles */

/* Dashboard Layout */
.admin-dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    min-height: calc(100vh - 150px);
    direction: rtl !important;
}

/* Sidebar Navigation */
.admin-sidebar {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px 20px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
    height: fit-content;
    box-shadow: var(--shadow-md);

    /* Force constant direction */
    direction: rtl !important;
    text-align: right !important;
}

.sidebar-header {
    margin-bottom: 30px;
    padding: 0 10px;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    direction: rtl !important;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-weight: 600;
    border: 1px solid transparent;
}

.sidebar-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-item:hover {
    background: rgba(var(--primary-rgb, 255, 107, 53), 0.1);
    color: var(--primary-color);
    transform: translateX(-5px);
}

.sidebar-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb, 255, 107, 53), 0.3);
}

/* Main Content Area */
.admin-main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Dashboard Header */
.dashboard-page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 24px;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.dashboard-page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-content h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.header-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.header-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.header-actions .btn:hover {
    background: white;
    color: var(--primary-color);
}

/* Stat Cards Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.admin-stat-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.admin-stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h4 {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.stat-info .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Management Sections */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.mgmt-card {
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    cursor: pointer;
}

.mgmt-card:hover {
    box-shadow: var(--shadow-md);
}

.mgmt-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mgmt-card-header i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.mgmt-card-header h3 {
    font-size: 1.3rem;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .admin-dashboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .admin-sidebar {
        position: sticky;
        top: 85px;
        z-index: 100;
        margin-bottom: 5px;
        padding: 10px;
        border-radius: 18px;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-menu {
        flex-direction: row !important;
        overflow-x: auto;
        padding: 5px;
        gap: 8px;

        /* Hide scrollbars - Cross-browser Support */
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox and Chrome 121+ */
    }

    /* Hide scrollbar for Chrome, Safari, Opera, and Samsung Internet */
    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }

    .sidebar-item {
        flex: 0 0 auto;
        padding: 10px 18px;
        flex-direction: column;
        gap: 5px;
        font-size: 0.75rem;
        min-width: 90px;
        text-align: center;
        background: rgba(var(--primary-rgb, 255, 107, 53), 0.05);
    }

    .sidebar-item i {
        font-size: 1.2rem;
        margin: 0;
    }

    .sidebar-item:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 600px) {
    .dashboard-page-header {
        padding: 30px 18px;
        text-align: center;
        border-radius: 20px;
    }

    .header-content h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .header-content p {
        font-size: 0.9rem;
        opacity: 0.95;
        line-height: 1.5;
    }

    .header-actions {
        justify-content: center;
        margin-top: 20px;
        gap: 10px;
    }

    .header-actions .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 12px;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .admin-stat-card {
        padding: 18px 16px;
        flex-direction: row;
        align-items: center;
        text-align: right;
        border-radius: 18px;
        gap: 12px;
    }

    .admin-stat-card:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .stat-icon-box {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    .stat-info {
        flex: 1;
    }

    .stat-info h4 {
        font-size: 0.88rem;
        margin-bottom: 4px;
    }

    .stat-info .stat-value {
        font-size: 1.6rem;
        font-weight: 700;
    }

    .management-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mgmt-card {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .mgmt-card-header {
        gap: 12px;
    }

    .mgmt-card-header i {
        font-size: 1.5rem;
    }

    .mgmt-card-header h3 {
        font-size: 1.15rem;
    }

    /* تحسين الأزرار في البطاقات */
    .mgmt-card .btn {
        width: 100%;
        min-height: 44px;
        font-size: 0.9rem;
        padding: 12px 18px;
    }

    /* تحسين الجداول على الجوال */
    .glass-card {
        padding: 16px 12px;
        border-radius: 18px;
    }

    .glass-card h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
}

/* Color Themes for Cards */
.bg-primary-soft {
    background: rgba(var(--primary-rgb, 255, 107, 53), 0.1);
    color: var(--primary-color);
}

.bg-success-soft {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.bg-info-soft {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* UI Config Special Styles */
.ui-config-header {
    background: linear-gradient(135deg, #7209B7 0%, #3A0CA3 100%) !important;
}

.seller-header {
    background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%) !important;
}

.delivery-header {
    background: linear-gradient(135deg, #FF6B35 0%, #E85A2A 100%) !important;
}

.preview-card {
    text-align: right;
    border: 1px solid var(--glass-border);
}