/* ============================================================
 *  assets/css/wallet.css — Ai Wallet Styles (Consolidated)
 * ============================================================ */

/* ============================================================
 *  1) المتغيّرات العامة
 * ============================================================ */
:root {
    /* الألوان الأساسية */
    --primary-color: #e61e25;
    --primary-red:   #e61e25;
    --accent:        #7f0038;
    --danger:        #ef4444;

    /* الخلفيات والأسطح */
    --bg-body: #f8f9fa;
    --surface: #f8fafc;
    --card:    #ffffff;

    /* النصوص */
    --text-dark:    #333333;
    --text-primary: #f8fafc;
    --text-main:    #ffffff;
    --text:         #1e293b;
    --muted:        #64748b;

    /* الأبعاد */
    --header-height: 60px;
    --footer-height: 65px;

    /* الزجاجية */
    --glass-bg:     rgba(30, 41, 59, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass:        rgba(255, 255, 255, 0.08);
    --border:       #e2e8f0;

    /* الأنصاف الأقطار */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-2xl:  1.5rem;
    --radius-full: 9999px;

    /* FiMobile */
    --fimobile-green:  #3ac79b;
    --fimobile-red:    #f73563;
    --fimobile-yellow: #ffbd17;
    --fimobile-blue:   #3c63e2;

    --fimobile-rounded:       15px;
    --fimobile-padding:       15px;
    --fimobile-input-rounded: 10px;

    --fimobile-theme-color:         #092c9f;
    --fimobile-theme-color-2:       #001c77;
    --fimobile-theme-color-light:   #d3ddfd;
    --fimobile-theme-bordercolor:   #dadff6;
    --fimobile-theme-text:          #ffffff;

    --fimobile-header:        transparent;
    --fimobile-header-active: #ffffff;
    --fimobile-header-text:   #000000;
    --fimobile-footer:        #ffffff;
    --fimobile-footer-text:   #999999;
    --fimobile-footer-text-active: var(--fimobile-theme-color);

    --fimobile-sidebar: var(--fimobile-theme-color);
    --fimobile-sidebar-text: #ffffff;
    --fimobile-sidebar-text-active: #ffffff;

    --fimobile-card-color: rgba(255, 255, 255, 0.85);
    --fimobile-card-text:  #000000;
    --fimobile-page-bg-1:  #f1f3f8;
    --fimobile-page-bg-2:  #e5ecfe;
    --fimobile-page-text:  #000000;
    --fimobile-page-link:  var(--fimobile-theme-color);

    /* إعدادات إضافية */
    --bs-primary:       #e61e25;
    --bs-primary-hover: #c41820;
    --item-bg:          #f8f9fa;
    --icon-bg:          #e9ecef;
    --border-color:     #e2e8f0;
}

/* ============================================================
 *  2) الصورة الرمزية (Avatar)
 * ============================================================ */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    text-align: center;
    vertical-align: middle;
    flex-shrink: 0;
    border-radius: 50%;
}

.avatar > i {
    display: inline-block;
    vertical-align: middle;
    margin-top: -3px;
}

.avatar > img,
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: top;
}

.avatar-6  { width: 6px;  height: 6px;  line-height: 6px;  }
.avatar-10 { width: 10px; height: 10px; line-height: 10px; }
.avatar-15 { width: 15px; height: 15px; line-height: 15px; }
.avatar-20 { width: 20px; height: 20px; line-height: 20px; }
.avatar-30 { width: 30px; height: 30px; line-height: 30px; }
.avatar-36 { width: 36px; height: 36px; line-height: 36px; }
.avatar-40 { width: 40px; height: 40px; line-height: 40px; }
.avatar-44 { width: 44px; height: 44px; line-height: 44px; }
.avatar-50 { width: 50px; height: 50px; line-height: 50px; }
.avatar-60 { width: 60px; height: 60px; line-height: 60px; }

/* ============================================================
 *  3) شارة الشبكة (Network Badge)
 * ============================================================ */
.network-badge {
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .16));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.network-badge::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
    transform: translateX(-100%);
    animation: networkShine 3.2s linear infinite;
    pointer-events: none;
}

.network-badge.ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, .20);
}

.network-badge.warn {
    background: linear-gradient(135deg, rgba(245, 158, 11, .18), rgba(234, 88, 12, .16));
    border-color: rgba(253, 186, 116, .28);
}

@keyframes networkShine {
    100% { transform: translateX(100%); }
}

.network-badge-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
    width: 100%;
}

.network-badge-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 21px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.network-badge-text {
    min-width: 0;
    flex: 1;
}

.network-badge-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, .78);
    margin-bottom: 4px;
}

.network-badge-name {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.network-badge-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    margin-top: 2px;
}

.network-badge-id {
    direction: rtl;
    text-align: right;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: min(100%, 290px);
    max-width: 100%;
    margin-top: 10px;
    padding: 9px 15px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .09));
    border: 1px solid rgba(255, 255, 255, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 18px rgba(0, 0, 0, .12);
    white-space: nowrap;
}

.network-badge-id-label {
    font-size: 11px;
    letter-spacing: 0;
    opacity: .84;
    font-weight: 800;
    flex: 0 0 auto;
}

.network-badge-id-value {
    direction: ltr;
    unicode-bidi: embed;
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
    flex: 0 0 auto;
}

/* ============================================================
 *  4) بطاقات الباقات (Card Customs)
 * ============================================================ */
.card-custom {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .03);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.card-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.card-custom:active {
    transform: scale(0.98);
}

.card-custom:focus,
.card-custom:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .35);
}

/* شريط علوي ملوّن */
.card-custom::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* شارة السعر */
.card-custom .price-badge {
    font-weight: 700;
    padding: .35rem .6rem;
    font-size: .8rem;
    border-radius: 999px;
    color: #fff;
}

/* عناصر داخل البطاقة */
.pkgName {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pkgIcon {
    font-size: 1.1rem;
    color: #ffc107;
}

/* ============================================================
 *  5) ألوان البطاقات حسب السعر
 * ============================================================ */

/* --- 100 ر.ي — أخضر (باقة الدخول) --- */
.card-special-100 {
    border-color: #10b981;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 65%);
}
.card-special-100::before      { background: #10b981; }
.card-special-100 .bi-wifi     { color: #10b981; }
.card-special-100 .price-badge { background: #10b981; }

/* --- 250 ر.ي — أزرق (الباقة الشائعة) --- */
.card-special-250 {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 65%);
}
.card-special-250::before      { background: #3b82f6; }
.card-special-250 .bi-wifi     { color: #3b82f6; }
.card-special-250 .price-badge { background: #3b82f6; }

/* --- 500 ر.ي — بنفسجي (الباقة المميزة) --- */
.card-special-500 {
    border-color: #8b5cf6;
    background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 65%);
}
.card-special-500::before      { background: #8b5cf6; }
.card-special-500 .bi-wifi     { color: #8b5cf6; }
.card-special-500 .price-badge { background: #8b5cf6; }

/* --- 1000 ر.ي — ذهبي (VIP) --- */
.card-special-1000 {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 65%);
}
.card-special-1000::before      { background: #f59e0b; }
.card-special-1000 .bi-wifi     { color: #f59e0b; }
.card-special-1000 .price-badge { background: #f59e0b; }

/* --- 1500 ر.ي — أحمر (الباقة النخبة) --- */
.card-special-1500 {
    border-color: #ef4444;
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 65%);
}
.card-special-1500::before      { background: #ef4444; }
.card-special-1500 .bi-wifi     { color: #ef4444; }
.card-special-1500 .price-badge { background: #ef4444; }

/* --- افتراضي --- */
.card-special-default {
    border-color: #6b7280;
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 65%);
}
.card-special-default::before      { background: #6b7280; }
.card-special-default .bi-wifi     { color: #6b7280; }
.card-special-default .price-badge { background: #6b7280; }

/* ============================================================
 *  6) بطاقة المعاملات (cardtrans)
 * ============================================================ */
.cardtrans {
    border-radius: 18px;
    border: 2px solid #e50914;
    background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .16));
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ============================================================
 *  7) بطاقات الخدمات (Service Cards)
 * ============================================================ */
.service-item-cards {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 16px;
    align-items: center;
    text-decoration: none;
    color: #212529;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .02);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, .03);
}

.service-item-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #212529;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .02);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, .03);
}

.service-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
    color: var(--bs-primary);
}

.service-icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: #f1f3f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
    font-size: 1.25rem;
}

.service-card {
    background-color: #f8f9fa;
    transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
    cursor: pointer;
}

.service-card:active {
    transform: scale(0.96);
    background-color: #f1f3f5;
}

/* بطاقة جيب */
.jaib-card {
    background: linear-gradient(135deg, #e31b38 0%, #9e0921 100%);
    border-radius: 15px;
    overflow: hidden;
}

/* السلايدر */
.cardswiper {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
}
.cardswiper .swiper-slide { width: 100% !important; }

/* ============================================================
 *  8) رأس القسم (Section Header)
 * ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.title-wrapper {
    display: flex;
    align-items: center;
}

.line-left {
    height: 35px;
    width: 4px;
    background-color: #e61e25;
    margin-left: 12px;
    border-radius: 2px;
}

.title-content h4 {
    font-weight: 800;
    font-size: 1.15rem;
    background: linear-gradient(90deg, #e61e25, #8e44ad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px !important;
}

.arrow-icon {
    font-size: 1.4rem;
    color: #e61e25;
    transition: 0.3s;
}
.arrow-icon:hover { transform: translateX(-5px); }

/* ============================================================
 *  9) المودال (Modal)
 * ============================================================ */
.custom-modal-content {
    border-radius: 30px !important;
    border: none;
    padding: 20px;
    position: relative;
}

.modal-content-custom {
    border-radius: 24px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    padding: 10px 5px;
}

.modal-icon-wrapper {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.success-icon-wrapper,
.modal-icon-wrapper {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e8f5e9;
    font-size: 2.5rem;
}

.modal-icon-circle .modal-icon-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e8f5e9;
    font-size: 2.5rem;
}

@keyframes popIn {
    0%   { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

.amount-box {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bs-primary);
}

/* Bottom Sheet Modal */
.modal-bottom-sheet .modal-dialog {
    margin: 0 auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 420px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.modal-bottom-sheet.show .modal-dialog { transform: translateY(0); }

.modal-bottom-sheet .modal-content-custom {
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, .1);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background-color: #dee2e6;
    border-radius: 10px;
    margin: 0 auto 10px auto;
}

/* ============================================================
 *  10) تفاصيل المعاملة
 * ============================================================ */
.transaction-details .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.85rem;
}
.transaction-details .detail-label { color: #6c757d; }
.transaction-details .detail-value {
    font-weight: 600;
    color: #212529;
    direction: ltr;
}

/* ============================================================
 *  11) الأزرار والعناصر
 * ============================================================ */
.btn-primary-custom {
    background-color: var(--bs-primary);
    border: none;
    color: #fff;
    font-weight: bold;
}
.btn-primary-custom:hover {
    background-color: var(--bs-primary-hover);
    color: #fff;
}

.icon-btn-box {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 12px;
    color: #d80032;
    cursor: pointer;
    transition: all 0.2s;
}
.icon-btn-box:hover { background-color: #f8f9fa; }

.form-floating > .form-control {
    height: 48px;
    min-height: 48px;
    line-height: 1.25;
    padding-top: 1.25rem;
    padding-bottom: 0.25rem;
    border-radius: 12px;
    border-color: var(--border-color);
}
.form-floating > label {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    color: #8c98a4;
}

.top-badge-icon {
    width: 56px;
    height: 56px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -45px auto 20px auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .03);
    color: #d80032;
}

.action-circle-btn {
    width: 48px;
    height: 48px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
    font-size: 1.25rem;
    text-decoration: none;
    margin: 0 auto 4px auto;
    transition: all 0.2s;
}
.action-circle-btn:hover {
    background-color: #e9ecef;
    color: var(--bs-primary);
}

.btn-close-custom {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ============================================================
 *  12) شاشة التحميل
 * ============================================================ */
.loader-wrap {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.logo-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(13, 110, 253, 0.2);
    filter: blur(20px);
    border-radius: 50%;
    z-index: -1;
}

.loader-cube-animate {
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    0%   { transform: scale(0.95); }
    100% { transform: scale(1.05); }
}

.progress-loader {
    width: 150px;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-loader-bar {
    width: 50%;
    height: 100%;
    background-color: #0d6efd;
    border-radius: 10px;
    position: absolute;
    animation: indeterminate 1.5s infinite linear;
}

@keyframes indeterminate {
    0%   { left: -50%; }
    100% { left: 100%; }
}

.loader-text    { font-weight: 600; color: #333; }
.loader-subtext { color: #6c757d; font-size: 0.9rem; margin-top: 5px; }

/* ============================================================
 *  13) أدوات مساعدة
 * ============================================================ */
.size-12 { font-size: 12px; }

/* ============================================================
 *  14) الوضع الليلي
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    .card-custom {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    .card-custom .bg-light {
        background: #374151 !important;
        color: #f9fafb !important;
    }
}

/* ============================================================
 *  15) التجاوب مع الشاشات الصغيرة
 * ============================================================ */
@media (max-width: 992px) {
    .title-content h4 {
        font-weight: 800;
        font-size: 1rem;
    }
    .subtitle {
        font-size: 0.75rem;
        color: #888;
        margin-top: 2px !important;
    }
}