/**
 * Deposit Popup Isolated Styles
 * Complete style isolation to prevent hallapp conflicts
 * All styles are scoped to #depositPopup with !important
 */

/* High-priority z-index to ensure popup is always on top */
#depositPopup.modal {
    z-index: 2147483640 !important;
}

#depositPopup .modal-dialog {
    z-index: 2147483641 !important;
}

/* Reset box model for all elements */
#depositPopup *,
#depositPopup *::before,
#depositPopup *::after {
    box-sizing: border-box !important;
}

/* Modal Dialog */
#depositPopup .deposit-modal-dialog {
    max-width: 700px !important;
    margin: 1rem !important;
}

#depositPopup .deposit-modal-content {
    background: #1a1a2e !important;
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

/* Close button */
#depositPopup .btn-close-white {
    opacity: 1 !important;
    filter: none !important;
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem !important;
    padding: 0 !important;
    color: white !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

#depositPopup .btn-close-white:before {
    content: '×' !important;
    color: white !important;
    font-size: 2rem !important;
    font-weight: 300 !important;
    line-height: 1 !important;
}

/* Header */
#depositPopup .deposit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 1.25rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#depositPopup .deposit-title {
    color: #fff !important;
    margin: 0 !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Body */
#depositPopup .deposit-body {
    padding: 1.5rem !important;
    background: #1a1a2e !important;
}

/* Step Header */
#depositPopup .step-header {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2) !important;
}

#depositPopup .step-number {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #2a2a3e !important;
    color: #666 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
}

#depositPopup .step-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
}

/* Happy Hour Notice */
#depositPopup .happy-hour-notice {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15)) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #ffc107 !important;
}

/* Amount Input */
#depositPopup .amount-input-wrapper {
    display: flex !important;
    align-items: center !important;
    background: #2a2a3e !important;
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
}

#depositPopup .amount-input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    flex: 1 !important;
    outline: none !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* Quick Amounts */
#depositPopup .quick-amounts {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
}

#depositPopup .quick-amount-btn {
    padding: 0.625rem !important;
    background: #2a2a3e !important;
    color: #aaa !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

#depositPopup .quick-amount-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* Payment Tabs */
#depositPopup .payment-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1.25rem !important;
}

#depositPopup .payment-tab {
    padding: 0.75rem 0.5rem !important;
    background: #2a2a3e !important;
    color: #aaa !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

#depositPopup .payment-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* Payment Methods Grid */
#depositPopup .payment-methods-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
}

#depositPopup .payment-method-card {
    position: relative !important;
    padding: 0.75rem !important;
    border-radius: 10px !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: #2a2a3e !important;
    overflow: visible !important;  /* Changed from hidden to visible */
    z-index: 5 !important;
    min-height: 65px !important;
}

#depositPopup .payment-method-card:hover {
    transform: translateY(-2px) !important;
    border-color: #667eea !important;
}

#depositPopup .payment-method-card.selected {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Payment Method Icons - COMPACT SIZE */
#depositPopup .method-icon {
    min-width: 60px !important;
    height: 45px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
    padding: 3px !important;
}

#depositPopup .method-icon img {
    width: auto !important;
    height: 100% !important;
    max-width: 80px !important;
    max-height: 40px !important;
    object-fit: contain !important;
}

#depositPopup .method-details {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

#depositPopup .method-name {
    display: block !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

#depositPopup .method-desc {
    display: block !important;
    color: #888 !important;
    font-size: 0.7rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
}

#depositPopup .instant-badge {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    background: linear-gradient(135deg, #4caf50, #45a049) !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    z-index: 10 !important;
    white-space: nowrap !important; /* Prevent text wrapping */
}

/* Ensure method details don't overlap with badge on desktop */
#depositPopup .payment-method-card:has(.instant-badge) .method-details {
    max-width: calc(100% - 60px) !important;
}

/* Tablet adjustments */
@media (max-width: 768px) {
    #depositPopup .payment-method-card {
        position: relative !important;
    }

    #depositPopup .instant-badge {
        font-size: 0.55rem !important;
        padding: 2px 6px !important;
    }

    #depositPopup .method-details {
        padding-right: 50px !important; /* Space for badge */
    }

    #depositPopup .method-name {
        font-size: 0.85rem !important;
    }

    #depositPopup .method-desc {
        font-size: 0.7rem !important;
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    #depositPopup .deposit-modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    #depositPopup .deposit-modal-content {
        border-radius: 15px !important;
    }

    #depositPopup .deposit-header {
        padding: 1rem !important;
    }

    #depositPopup .deposit-body {
        padding: 1rem !important;
    }

    #depositPopup .quick-amounts {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    #depositPopup .payment-tabs {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #depositPopup .payment-methods-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    /* Mobile Icon Sizes - Compact */
    #depositPopup .method-icon {
        min-width: 50px !important;
        height: 40px !important;
        margin-right: 0.25rem !important;
        padding: 2px !important;
    }

    #depositPopup .method-icon img {
        width: auto !important;
        height: 100% !important;
        max-width: 65px !important;
        max-height: 35px !important;
    }

    #depositPopup .payment-method-card {
        padding: 0.625rem !important;
        min-height: 55px !important;
    }

    #depositPopup .instant-badge {
        /* Move badge to top-right corner on mobile to avoid overlap */
        position: absolute !important;
        top: 2px !important;
        right: 2px !important;
        transform: none !important;
        padding: 2px 5px !important;
        font-size: 0.45rem !important;
        border-radius: 3px !important;
        line-height: 1 !important;
        background: linear-gradient(135deg, #4caf50, #45a049) !important;
    }

    /* Adjust method details to avoid overlap with badge */
    #depositPopup .method-details {
        padding-right: 45px !important; /* Give space for the badge */
    }
}

/* Voucher Input */
#depositPopup .voucher-input-wrapper {
    display: flex !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
}

#depositPopup .voucher-input {
    flex: 1 !important;
    padding: 0.75rem 1rem !important;
    background: #2a2a3e !important;
    color: #fff !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

/* Summary */
#depositPopup .deposit-summary {
    background: rgba(102, 126, 234, 0.1) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    margin-top: 1rem !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    position: relative !important;
    z-index: 5 !important;
}

#depositPopup .btn-proceed {
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 10 !important;
}

#depositPopup #proceedPayment {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
    color: white !important;
}

/* Override any external styles */
#depositPopup input,
#depositPopup button,
#depositPopup .payment-method-card {
    pointer-events: auto !important;
}

/* Ensure proper layering */
#depositPopup {
    isolation: isolate !important;
}