/* ============================================ */
/* GOLD WALLET - CORE STYLES (همیشه لود می‌شود) */
/* ============================================ */

/* ===== ریست و پایه ===== */
:root {
    --gw-font-family: 'IRANSans', Tahoma, Arial, sans-serif;
    --gw-radius-sm: 10px;
    --gw-radius-md: 14px;
    --gw-radius-lg: 20px;
    --gw-radius-xl: 24px;
    --gw-transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    
    --gw-bg-primary: #1a1a2e;
    --gw-bg-secondary: #12121f;
    --gw-bg-card: rgba(255, 255, 255, 0.03);
    --gw-border-color: rgba(212, 175, 55, 0.12);
    --gw-text-primary: #f5e6a3;
    --gw-text-secondary: #b8a87e;
    --gw-text-muted: #6a5f4a;
    --gw-gold: #d4af37;
    --gw-gold-light: #fbbf24;
    --gw-gold-dark: #c49b2a;
    --gw-success: #34d399;
    --gw-danger: #f87171;
    --gw-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== کلاس‌های عمومی ===== */
.gw-box,
.gw-form-card,
.gw-history-modern,
.gw-card-manager,
.gw-deposit-box,
.gw-withdraw-box,
.gw-balance-card,
.gw-gift-box,
.gw-theme-settings-box {
    background: linear-gradient(180deg, var(--gw-bg-primary) 0%, var(--gw-bg-secondary) 100%) !important;
    border: 1px solid var(--gw-border-color) !important;
    border-radius: var(--gw-radius-lg) !important;
    padding: clamp(16px, 2.5vw, 28px) clamp(14px, 2vw, 26px) !important;
    margin: clamp(10px, 1.5vw, 16px) 0 !important;
    box-shadow: var(--gw-shadow) !important;
    direction: rtl !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    color: var(--gw-text-primary) !important;
}

/* ===== افکت نور طلایی ===== */
.gw-box::before,
.gw-form-card::before,
.gw-history-modern::before,
.gw-card-manager::before,
.gw-deposit-box::before,
.gw-withdraw-box::before,
.gw-balance-card::before,
.gw-gift-box::before,
.gw-theme-settings-box::before {
    content: '' !important;
    position: absolute !important;
    top: -60px !important;
    right: -60px !important;
    width: 180px !important;
    height: 180px !important;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.04), transparent 70%) !important;
    pointer-events: none !important;
    border-radius: 50% !important;
}

/* ===== هدر فرم‌ها ===== */
.gw-form-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: clamp(10px, 1.5vw, 16px) !important;
    padding-bottom: clamp(8px, 1vw, 12px) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08) !important;
    position: relative;
    z-index: 1;
}

.gw-form-head h3 {
    margin: 0 !important;
    font-size: clamp(16px, 1.8vw, 20px) !important;
    font-weight: 800 !important;
    color: var(--gw-text-primary) !important;
}

.gw-form-icon {
    font-size: clamp(20px, 2vw, 26px) !important;
    color: var(--gw-gold) !important;
}

/* ===== فیلدها ===== */
.gw-field {
    margin-bottom: 6px !important;
    position: relative;
    z-index: 1;
}

.gw-field label {
    display: block !important;
    margin-bottom: 1px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--gw-text-secondary) !important;
}

.gw-field input,
.gw-field select {
    width: 100% !important;
    height: 38px !important;
    border: 1px solid rgba(212, 175, 55, 0.12) !important;
    border-radius: 10px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    color: var(--gw-text-primary) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    box-sizing: border-box !important;
    transition: all var(--gw-transition) !important;
}

.gw-field input:focus,
.gw-field select:focus {
    border-color: var(--gw-gold) !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.06) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    outline: none !important;
}

.gw-field input::placeholder {
    color: rgba(255, 255, 255, 0.15) !important;
}

.gw-field small {
    color: var(--gw-text-muted) !important;
    font-size: clamp(10px, 0.8vw, 12px) !important;
}

/* ===== دکمه‌ها ===== */
.gw-btn {
    width: 100% !important;
    border: none !important;
    border-radius: var(--gw-radius-md) !important;
    padding: clamp(12px, 1.5vw, 16px) clamp(16px, 2vw, 24px) !important;
    font-weight: 700 !important;
    font-size: clamp(14px, 1.1vw, 16px) !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, var(--gw-gold), var(--gw-gold-dark)) !important;
    color: #1a1a2e !important;
    transition: all var(--gw-transition) !important;
    position: relative !important;
    overflow: hidden !important;
    font-family: inherit !important;
}

.gw-btn .gw-btn-text {
    color: #1a1a2e !important;
    font-weight: 700 !important;
}

.gw-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.25) !important;
    background: linear-gradient(135deg, #e0c04a, var(--gw-gold)) !important;
}

.gw-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ===== بج‌ها ===== */
.gw-tx-badge {
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: clamp(10px, 0.8vw, 12px) !important;
    font-weight: 700 !important;
    display: inline-block !important;
}

.gw-badge-buy { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; }
.gw-badge-sell { background: rgba(245, 158, 11, 0.15) !important; color: #fbbf24 !important; }
.gw-badge-transfer { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; }
.gw-badge-plus { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; }
.gw-badge-minus { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }
.gw-badge-neutral { background: rgba(255, 255, 255, 0.03) !important; color: #9a8b6e !important; }
.gw-badge-referral { background: rgba(212, 175, 55, 0.12) !important; color: #d4af37 !important; }

/* ===== خلاصه ===== */
.gw-actions-summary {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(212, 175, 55, 0.06) !important;
    border-radius: var(--gw-radius-md) !important;
    padding: clamp(12px, 1.5vw, 16px) !important;
    margin: clamp(8px, 1vw, 12px) 0 !important;
    position: relative;
    z-index: 1;
}

.gw-summary-row {
    display: flex !important;
    justify-content: space-between !important;
    padding: clamp(4px, 0.5vw, 6px) 0 !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.04) !important;
    font-size: clamp(12px, 0.9vw, 14px) !important;
    color: var(--gw-text-secondary) !important;
}

.gw-summary-row:last-child {
    border-bottom: none !important;
}

.gw-summary-row strong {
    color: var(--gw-text-primary) !important;
}

.gw-summary-total {
    color: var(--gw-gold) !important;
}

.gw-summary-fee {
    color: #f59e0b !important;
}

/* ===== قیمت لحظه‌ای ===== */
.gw-live-price {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(212, 175, 55, 0.06) !important;
    border-radius: var(--gw-radius-md) !important;
    padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 16px) !important;
    margin: clamp(6px, 0.8vw, 10px) 0 !important;
    font-size: clamp(12px, 0.9vw, 14px) !important;
    color: var(--gw-text-secondary) !important;
    position: relative;
    z-index: 1;
}

.gw-live-price strong {
    color: var(--gw-gold) !important;
}

.gw-cost-note {
    color: #9a8b6e !important;
    font-size: clamp(12px, 0.9vw, 13px) !important;
    padding: clamp(4px, 0.5vw, 6px) 0 !important;
    position: relative;
    z-index: 1;
}

.gw-cost-note.gw-error {
    border-color: rgba(239, 68, 68, 0.2) !important;
    background: rgba(239, 68, 68, 0.05) !important;
    color: #ef4444 !important;
}

/* ===== انیمیشن‌ها ===== */
@keyframes gwFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gwSpin {
    to { transform: rotate(360deg); }
}

.gw-fade-in {
    animation: gwFadeIn 0.3s ease both;
}

/* ===== ابزارها ===== */
.gw-text-center { text-align: center !important; }
.gw-text-gold { color: var(--gw-gold) !important; }
.gw-text-success { color: var(--gw-success) !important; }
.gw-text-danger { color: var(--gw-danger) !important; }
.gw-text-muted { color: var(--gw-text-muted) !important; }
.gw-mt-1 { margin-top: 8px !important; }
.gw-mt-2 { margin-top: 16px !important; }
.gw-mb-1 { margin-bottom: 8px !important; }
.gw-mb-2 { margin-bottom: 16px !important; }
.gw-gap-1 { gap: 8px !important; }
.gw-gap-2 { gap: 16px !important; }

/* ===== اسکرول ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* ============================================================
   ===== حذف تاری پس‌زمینه مودال‌ها =====
   ============================================================ */

#gwDetailModal,
#gwFactModal,
#gwPreviewModal,
#gwTransferCodeModal,
#gwConfirmModal,
.gw-confirm-overlay,
.gw-custom-modal,
.gw-modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* ============================================================
   ===== خط رنگی کنار موجودی کاربر =====
   ============================================================ */

.gw-balance-highlight {
    border-right: 3px solid #34d399 !important;
    border-left: 3px solid #34d399 !important;
    border-radius: 8px !important;
    background: rgba(52, 211, 153, 0.04) !important;
    padding: 6px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-bottom: 12px !important;
}

.gw-balance-highlight .gw-balance-label {
    font-size: 13px !important;
    color: var(--gw-text-secondary, #b8a87e) !important;
    font-weight: 500 !important;
}

.gw-balance-highlight .gw-balance-value {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #34d399 !important;
}

/* ===== برای فروش (نارنجی) ===== */
.gw-balance-highlight.sell {
    border-right-color: #f59e0b !important;
    border-left-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.04) !important;
}

.gw-balance-highlight.sell .gw-balance-value {
    color: #fbbf24 !important;
}

/* ===== برای انتقال (آبی) ===== */
.gw-balance-highlight.transfer {
    border-right-color: #3b82f6 !important;
    border-left-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.04) !important;
}

.gw-balance-highlight.transfer .gw-balance-value {
    color: #60a5fa !important;
}
/* ============================================================
   ===== استایل خطا برای فیلدها =====
   ============================================================ */

.gw-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: gwShake 0.4s ease !important;
}

.gw-input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

@keyframes gwShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ===== استایل خطا برای لیبل ===== */
.gw-field.has-error label {
    color: #ef4444 !important;
}

/* ===== پیام خطا ===== */
.gw-field-error {
    font-size: 12px !important;
    color: #ef4444 !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
    display: none !important;
}

.gw-field-error.show {
    display: block !important;
}
/* ============================================================
   ===== استایل خطا برای فیلدها (کامل) =====
   ============================================================ */

.gw-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: gwShake 0.4s ease !important;
}

.gw-input-error:focus,
.gw-input-error:focus-visible {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25) !important;
    outline: 2px solid #ef4444 !important;
    outline-offset: 1px !important;
}

/* ===== تم شب ===== */
body.gw-theme-dark .gw-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

body.gw-theme-dark .gw-input-error:focus,
body.gw-theme-dark .gw-input-error:focus-visible {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
    outline: 2px solid #ef4444 !important;
}

/* ===== تم روز ===== */
body.gw-theme-light .gw-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

body.gw-theme-light .gw-input-error:focus,
body.gw-theme-light .gw-input-error:focus-visible {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25) !important;
    outline: 2px solid #dc2626 !important;
}

@keyframes gwShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ===== استایل خطا برای لیبل ===== */
.gw-field.has-error label {
    color: #ef4444 !important;
}

body.gw-theme-light .gw-field.has-error label {
    color: #dc2626 !important;
}

/* ===== پیام خطا ===== */
.gw-field-error {
    font-size: 12px !important;
    color: #ef4444 !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
    display: none !important;
}

.gw-field-error.show {
    display: block !important;
}

body.gw-theme-light .gw-field-error {
    color: #dc2626 !important;
}
/* ============================================================
   ===== استایل‌های جدید برای بررسی گیرنده =====
   ============================================================ */

.gw-input-success {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.gw-input-success:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.20) !important;
}

.gw-input-loading {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15) !important;
}

.gw-recipient-name.gw-msg {
    animation: gwFadeIn 0.3s ease !important;
}

.gw-recipient-name.gw-err {
    animation: gwShake 0.4s ease !important;
}

.gw-recipient-name.gw-loading {
    color: #fbbf24 !important;
}

.gw-recipient-name.gw-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid rgba(251, 191, 36, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: gwSpin 0.8s linear infinite;
}

@keyframes gwSpin {
    to { transform: rotate(360deg); }
}

@keyframes gwShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes gwFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}