/* public/style.css */
@font-face {
    font-family: 'MinecraftRegular';
    src: url('./MinecraftRegular-Bmg3.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'IBM Plex Sans Arabic', sans-serif; 
}

body { 
    background-color: #f4f6fc; 
    color: #1d1d1f; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden; 
}

body.popup-open, body.menu-open { overflow: hidden; }

.material-symbols-rounded { 
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24; 
    font-size: 22px; 
    vertical-align: middle; 
    display: inline-block; 
}

/* الـ Loader */
#loader { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: #f4f6fc; 
    z-index: 9999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    transition: opacity 0.5s ease, visibility 0.5s; 
}

.spinner { 
    width: 40px; 
    height: 40px; 
    border: 3.5px solid rgba(0, 0, 0, 0.06); 
    border-top-color: #1d1d1f; 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite; 
}

@keyframes spin { to { transform: rotate(360deg); } }
body.loaded #loader { opacity: 0; visibility: hidden; }

.user-username { font-family: 'MinecraftRegular', sans-serif; }

/* التنبيهات الجانبية (Toast Notification) */
.toast-container {
    position: fixed;
    top: 24px;
    right: -350px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(24px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.4rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    width: 310px;
    transition: right 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.toast-container.show {
    right: 24px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.toast-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.toast-container.success .toast-icon { background: rgba(52, 199, 89, 0.12); color: #34c759; }
.toast-container.error .toast-icon { background: rgba(255, 59, 48, 0.12); color: #ff3b30; }
.toast-container.info .toast-icon { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.toast-content h5 { font-size: 0.95rem; font-weight: 700; color: #000; }
.toast-content p { font-size: 0.82rem; color: #6e6e73; margin-top: 2px; font-weight: 500; }


/* السكرول بار */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #ffffff; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #1d1d1f; border-radius: 10px; border: 2px solid #ffffff; }
::-webkit-scrollbar-thumb:hover { background: #000000; }

/* البوب أب (Popup Setup) */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); z-index: 1000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s; }
.popup-overlay.active { opacity: 1; visibility: visible; }
.popup-box { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(30px) saturate(190%); border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); width: 90%; max-width: 420px; padding: 2.5rem 2rem; border-radius: 28px; position: relative; transform: scale(0.92) translateY(10px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.popup-overlay.active .popup-box { transform: scale(1) translateY(0); }
.close-popup { position: absolute; top: 1.2rem; left: 1.2rem; background: rgba(0,0,0,0.04); color: #1d1d1f; border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.close-popup:hover { background: rgba(0,0,0,0.08); transform: rotate(90deg); }
.popup-box h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.8rem; text-align: center; color: #000; }

.input-group { display: flex; flex-direction: column; margin-bottom: 1.4rem; }
.input-group label { font-size: 0.9rem; font-weight: 600; color: #515154; margin-bottom: 0.5rem; padding-right: 4px; }
.input-group input { background: rgba(0, 0, 0, 0.03); border: 1.5px solid transparent; padding: 0.85rem 1rem; font-size: 0.95rem; font-weight: 500; border-radius: 14px; outline: none; transition: all 0.25s ease; color: #1d1d1f; text-align: right; }
.input-group input:focus { background: #fff; border-color: #1d1d1f; box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03); }
.btn-submit-login { width: 100%; background: #1d1d1f; color: #fff; border: none; padding: 0.9rem; font-size: 1rem; font-weight: 600; border-radius: 14px; cursor: pointer; margin-top: 0.6rem; transition: all 0.2s ease; }
.btn-submit-login:hover { background: #000; transform: translateY(-1px); }

/* كروت الغلاس ميرفيزم الفخمة */
.glass-card { background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%); border: 1px solid rgba(255, 255, 255, 0.5); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.02); border-radius: 24px; }

main { max-width: 1200px; width: 90%; margin: 2rem auto 6rem auto; flex: 1; }

/* واجهة البطل والأزرار */
.hero-section { text-align: center; padding: 8rem 1rem 4.5rem 1rem;  }
.hero-section h1 { font-size: 3.2rem; font-weight: 700; color: #000; letter-spacing: -1px; margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero-section p { font-size: 1.25rem; color: #86868b; max-width: 650px; margin: 0 auto 2.5rem auto; line-height: 1.6; }

.hero-buttons { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.btn-gate { border: none; padding: 1rem 2.2rem; font-size: 1.05rem; font-weight: 600; border-radius: 50px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); text-decoration: none; }
.btn-gate.primary { background: #1d1d1f; color: #fff; }
.btn-gate.primary:hover { background: #000; transform: scale(1.03); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.btn-gate.secondary { background: rgba(0,0,0,0.04); color: #1d1d1f; }
.btn-gate.secondary:hover { background: rgba(0,0,0,0.07); transform: scale(1.03); }

/* الـ Grid الأساسي وتنسيق الكروت للمحتوى */
.main-layout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.right-column { display: flex; flex-direction: column; gap: 1.2rem; }
.left-column { display: flex; flex-direction: column; gap: 2.5rem; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.2rem; color: #000; display: flex; align-items: center; gap: 8px; }

/* (جديد) حل مشكلة ظهور كروت المتاجر وضمان توافقها التام */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-top: 1rem;
}

/* 🛍️ نافذة الشراء والدفع الاحترافية */
.checkout-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.checkout-popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.checkout-window {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    padding: 1.8rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checkout-popup-overlay.active .checkout-window {
    transform: scale(1);
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

.checkout-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-close {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.checkout-close:hover { background: rgba(0, 0, 0, 0.08); }

/* 🧾 تصميم الفاتورة المصغرة */
.invoice-box {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}

.invoice-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-qty-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d1d1f;
}

.invoice-label {
    font-size: 0.78rem;
    color: #86868b;
}

.invoice-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-blue);
}

/* 💳 شبكة طرق الدعم */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

@media (max-width: 400px) {
    .payment-methods-grid { grid-template-columns: 1fr; }
}

.method-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #444446;
    transition: all 0.2s ease;
}

.method-btn span.icon {
    font-size: 18px;
    color: #86868b;
}

.method-btn:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

/* حالة اختيار طريقة الدفع */
.method-btn.selected {
    border-color: #000000;
    background: #1d1d1f;
    color: #ffffff;
}
.method-btn.selected span.icon {
    color: #ffffff;
}

/* 🔔 التنبيهات والأزرار */
.payment-notice {
    font-size: 0.82rem;
    color: #86868b;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: center;
}

.news-card { padding: 1.8rem; border-radius: 22px; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease; }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.04); }
.news-meta { font-size: 0.85rem; color: #86868b; margin-bottom: 0.6rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.news-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.6rem; color: #000; }
.news-card p { color: #6e6e73; font-size: 0.95rem; line-height: 1.6; }

/* الأسئلة الشائعة */
.faq-item { border-bottom: 1px solid rgba(0,0,0,0.05); padding: 1.2rem 0; cursor: pointer; }
.faq-item:last-child { border: none; }
.faq-question { font-size: 1.05rem; font-weight: 600; color: #1d1d1f; display: flex; justify-content: space-between; align-items: center; user-select: none; transition: color 0.2s; }
.faq-item:hover .faq-question { color: #ffee00; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), margin 0.35s; color: #6e6e73; font-size: 0.95rem; line-height: 1.6; }
.faq-item .icon { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); color: #86868b; }
.faq-item.active .faq-answer { max-height: 150px; margin-top: 0.8rem; }
.faq-item.active .icon { transform: rotate(180deg); color: #000; }

/* قوائم اللاعبين */
.honor-list-container { display: flex; flex-direction: column; gap: 1rem; }
.player-row-head { padding: 1.1rem 1.3rem; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s; }
.player-row-head:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.03); }
.player-head-meta { display: flex; align-items: center; gap: 1rem; }
.skin-head-img { width: 50px; height: 50px; border-radius: 12px; background: rgba(0,0,0,0.03); box-shadow: 0 4px 10px rgba(0,0,0,0.04); transition: transform 0.2s; }
.player-row-head:hover .skin-head-img { transform: scale(1.05); }
.player-head-meta h4 { font-size: 1.1rem; font-weight: 700; color: #1d1d1f; }
.player-head-meta p { font-size: 0.85rem; color: #6e6e73; font-weight: 500; }

.honor-badge { font-size: 0.9rem; font-weight: 700; background: rgba(0,0,0,0.04); padding: 6px 14px; border-radius: 50px; transition: all 0.2s; }
.honor-badge.blue-tag { color: #007aff; background: rgba(0,122,255,0.06); }
.honor-badge.gold-tag { color: #ff9500; background: rgba(255,149,0,0.06); }
.player-row-head:hover .honor-badge.blue-tag { background: #007aff; color: #fff; }
.player-row-head:hover .honor-badge.gold-tag { background: #ff9500; color: #fff; }

/* حالة السيرفر */
.server-status { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid transparent; gap: 8px; margin-bottom: 15px; }
.status-online { background-color: rgba(85, 255, 85, 0.15); color: #2ea42e; border: 1px solid rgba(85, 255, 85, 0.3); }
.status-online .status-dot { background-color: #34c759; box-shadow: 0 0 10px #34c759; }
.status-offline { background-color: rgba(255, 85, 85, 0.15); color: #dc3545; border: 1px solid rgba(255, 85, 85, 0.3); }
.status-offline .status-dot { background-color: #ff3b30; box-shadow: 0 0 10px #ff3b30; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

footer { text-align: center; padding: 3rem 0; color: #86868b; font-size: 0.9rem; border-top: 1px solid rgba(0,0,0,0.04); margin-top: auto; }

/* (معدل بالكامل) التجاوب للهواتف والأجهزة اللوحية ودعم الـ Flex/Grid */
@media (max-width: 900px) {
    /* تفعيل قائمة الهامبرغر بدلاً من الحجب الكامل */
    .nav-links.active { 
        display: flex; 
        flex-direction: column; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: rgba(255, 255, 255, 0.95); 
        backdrop-filter: blur(20px);
        padding: 1.5rem; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }
    
    .nav-links { display: none; }
    .header-actions #openLoginBtn { display: none; } 
    .burger-menu { display: block; cursor: pointer; } 
    
    /* تحويل الجريد لعمود واحد مرن وسلس على الجوال */
    .main-layout-grid { 
        grid-template-columns: 1fr; 
        gap: 2rem; 
    }
    
    .hero-section { padding: 2.5rem 0.5rem; }
    .hero-section h1 { font-size: 2.2rem; flex-direction: column; gap: 8px; }
    .hero-section p { font-size: 1.1rem; margin-bottom: 2rem; }
    
    .btn-gate { width: 100%; justify-content: center; }
    
    .toast-container { width: calc(100% - 48px); right: -100%; left: 24px; }
    .toast-container.show { right: 24px; left: 24px; }
    
    /* جعل المتاجر تتطابق عمودياً على شاشات الجوال الضيقة */
    .stores-grid {
        grid-template-columns: 1fr;
    }
}