/* المسار: assets/style.css */
:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #312e81;
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius: 24px;
    --shadow-sm: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 20px 40px -5px rgba(79, 70, 229, 0.15);
    --nav-height: 75px;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0; direction: rtl;
    padding-bottom: calc(var(--nav-height) + 20px);
    overflow-x: hidden; line-height: 1.6;
}

::-webkit-scrollbar { display: none; }

.app-container { max-width: 650px; margin: 0 auto; padding: 25px 20px; }

/* ----------------------------------
   نظام الإشعارات الذكي (Toast)
----------------------------------- */
.toast-container {
    position: fixed; top: 20px; left: 20px; z-index: 999999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.custom-toast {
    background: white; border-radius: 16px; padding: 16px 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 12px;
    font-weight: bold; transform: translateX(-150%); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    min-width: 250px; pointer-events: auto; direction: rtl; border-right: 5px solid var(--primary);
}
.custom-toast.show { transform: translateX(0); }
.custom-toast.success { border-right-color: #10b981; }
.custom-toast.error { border-right-color: #ef4444; }

/* ----------------------------------
   تصميم البطاقات (Cards)
----------------------------------- */
.card {
    background: var(--surface); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease; overflow-wrap: break-word;
}
.wallet-card { 
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); 
    color: white; box-shadow: var(--shadow-md); border:none;
}

/* ----------------------------------
   الأزرار والحقول
----------------------------------- */
.btn {
    padding: 15px 22px; border-radius: 16px; border: none; font-weight: bold; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: 0.3s; font-size: 1.05rem;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4); }
.btn-outline { background: #f1f5f9; color: var(--text-main); border: 2px solid transparent; }
.btn-outline:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #ef4444; }

input, select {
    width: 100%; padding: 16px 20px; border: 2px solid #e2e8f0; border-radius: 16px; font-family: inherit;
    font-size: 1.05rem; background: #f8fafc; transition: 0.3s; color: #1e293b; font-weight: 500;
}
input:focus, select:focus { background: white; border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

/* ----------------------------------
   النوافذ المنبثقة (Modals)
----------------------------------- */
.custom-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); display: none; align-items: center; justify-content: center;
    z-index: 100000; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: 0.3s ease; padding: 20px;
}
.custom-modal.show { opacity: 1; }

.modal-content {
    background: white; padding: 35px 25px; border-radius: 28px; width: 100%; max-width: 380px;
    text-align: center; transform: scale(0.9); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.2);
}
.custom-modal.show .modal-content { transform: scale(1); }

/* ----------------------------------
   الشريط السفلي (Bottom Nav) للمشتركين
----------------------------------- */
.mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    height: var(--nav-height); display: flex; justify-content: space-around; align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05); box-shadow: 0 -15px 40px rgba(0,0,0,0.04); z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-link {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    color: #94a3b8; text-decoration: none; font-size: 0.8rem; font-weight: bold; transition: 0.3s;
}
.nav-link.active { color: var(--primary); transform: translateY(-3px); }
.nav-link svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.nav-link.active svg { filter: drop-shadow(0 4px 8px rgba(79, 70, 229, 0.4)); }

/* إخفاء السايد بار في شاشات العميل */
.desktop-sidebar { display: none; }
@media (min-width: 992px) {
    body { background: #f1f5f9; padding-bottom: 0; }
    .mobile-nav { display: none; }
    .app-container { max-width: 900px; padding: 40px; }
}