@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #a2a3b7;
    --sidebar-hover: #2b2b40;
    --success: #2ec4b6;
    --danger: #ef233c;
    --warning: #ffb703;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    direction: rtl; /* Right to Left for Arabic */
    overflow-x: hidden;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    right: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h3 {
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

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

.menu-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: 0.2s;
    border-radius: 8px;
    margin: 4px 15px;
}

.menu-item:hover, .menu-item.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-item i {
    margin-left: 15px;
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px; /* Same as sidebar width */
    padding: 30px;
    transition: all 0.3s;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.main-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

@media (max-width: 992px) {
    .main-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Grid System */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive */
.mobile-only {
    display: none;
}

/* Responsive Enhancements */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-header h3, .menu-item span {
        display: none;
    }
    .main-content {
        margin-right: 80px;
    }
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    .sidebar {
        width: 220px !important; /* عرض أنيق */
        right: -220px !important;
        position: fixed;
        height: 100vh;
        z-index: 10000 !important;
        box-shadow: -5px 0 20px rgba(0,0,0,0.4);
        display: block !important;
    }
    .sidebar.active {
        right: 0 !important;
    }
    .sidebar.active .menu-item span {
        display: inline-block !important;
        color: #ffffff !important;
        font-size: 0.9rem;
        margin-right: 10px; /* مسافة بسيطة من الأيقونة */
    }
    .sidebar.active .sidebar-header h3 {
        display: block !important;
        color: #ffffff !important;
        font-size: 1.1rem;
    }
    .menu-item {
        padding: 12px 15px !important;
        margin: 4px 8px !important;
        justify-content: flex-start;
    }
    .main-content {
        margin-right: 0 !important;
        width: 100%;
        padding: 10px;
    }
    .header {
        margin-bottom: 15px;
        padding: 10px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
