
/* === BRATKI WALLET REDESIGN === */

.bratkiwallet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 20, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.bratkiwallet-overlay.show .bratkiwallet-modal {
    transform: scale(1);
    opacity: 1;
}

.bratkiwallet-modal.new-design {
    display: flex;
    width: 900px;
    max-width: 95%;
    height: 600px;
    max-height: 90vh;
    background: rgb(30 32 47 / 43%);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative; /* For global close btn */
}

/* === GLOBAL CLOSE BUTTON === */
.wallet-close-btn.global-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #2a2d3d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 9999 !important; /* Force on top */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.wallet-close-btn.global-close .mdi {
    font-size: 24px;
    color: #fff;
}

.wallet-close-btn.global-close:hover {
    background: #363a4d;
    transform: scale(1.05);
}

/* === LEFT SIDEBAR === */
.wallet-sidebar {
    width: 320px;
    background: rgb(36 38 54 / 0%);
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.wallet-header {
    margin-bottom: 24px;
}

.wallet-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.wallet-logo .mdi {
    font-size: 24px;
    color: #fff;
}

.wallet-tabs-wrapper {
    background: #1b1d29;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.wallet-tabs {
    display: flex;
}

.wallet-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #8b949e;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-tab.active {
    background: #4182f9;
    color: #fff;
    box-shadow: 0 4px 12px rgba(65, 130, 249, 0.3);
}

.wallet-tab .mdi {
    font-size: 18px;
    color: currentColor;
}

.wallet-country {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1b1d29;
    border-radius: 12px;
    margin-bottom: 20px;
}

.country-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.country-info img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.country-change {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.country-change:hover {
    opacity: 1;
}

.wallet-methods-scroll {
    flex: 1;
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 10px;
}

.wallet-methods-list {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.wallet-methods-list.active {
    display: flex;
}

.wallet-method-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #1b1d29;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-method-item:hover {
    background: #2a2d3d;
}

.wallet-method-item.active {
    background: #1b1d29;
    border-color: #4182f9;
    box-shadow: 0 0 0 1px #4182f9;
}

.method-icon {
    width: 28px;
    height: 28px;
    background: #242636;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.method-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.method-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.method-name {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.method-bonus-badge {
    background: #4182f9;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
}

.method-limit {
    color: #8b949e;
    font-size: 11px;
    font-weight: 600;
}

.method-arrow {
    color: #4b5563;
}

.method-arrow .mdi {
   font-size: 20px;
   color: currentColor;
}

.wallet-method-item.active .method-arrow {
    color: #4182f9;
}

.wallet-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wallet-history-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #1b1d29;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #8b949e;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-history-btn:hover {
    color: #fff;
    background: #2a2d3d;
}

/* === RIGHT PANEL === */
.wallet-panel {
    flex: 1;
    background: rgb(30 32 47 / 27%);
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.wallet-view {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.wallet-view.active {
    display: flex;
}

.wallet-panel-header {
    margin-bottom: 30px;
}

.wallet-panel-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.wallet-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 480px;
}

.wallet-input-group label {
    display: block;
    color: #8b949e;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.wallet-input-wrapper {
    position: relative;
    background: #13151d;
    border-radius: 14px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: 0.2s;
}

.wallet-input-wrapper:focus-within {
    border-color: #4182f9;
    box-shadow: 0 0 0 3px rgba(65, 130, 249, 0.15);
}

.currency-symbol {
    padding-left: 16px;
    color: #8b949e;
    display: flex;
    align-items: center;
}

.currency-icon {
    width: 18px;
    height: 18px;
}

.wallet-input-wrapper input::placeholder {
    color: #8b949e;
    opacity: 1;
}

.wallet-input-wrapper input,
.wallet-input-wrapper select {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    outline: none;
}

.wallet-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-presets button {
    background: #242636;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-presets button:hover {
    background: #363a4d;
    color: #fff;
}

.wallet-info-box {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.wallet-submit-btn {
    background: #4182f9;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 5px;
    box-shadow: none;
}

.wallet-submit-btn:hover {
    background: #3b76e3;
    transform: translateY(-2px);
}

.wallet-submit-btn.red {
    background: #e91e63;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.wallet-submit-btn.red:hover {
    background: #d81b60;
}

/* History Styles */
.history-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.h-tab {
    padding: 8px 16px;
    background: #242636;
    border-radius: 10px;
    color: #8b949e;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.h-tab.active {
    background: #4182f9;
    color: #fff;
}

.history-list {
    display: none;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    height: 400px;
    padding-right: 6px;
}

.history-list.active {
    display: flex;
}

.history-item {
    background: #242636;
    padding: 14px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.h-date {
    color: #8b949e;
    font-size: 12px;
}

.h-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-sum {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.h-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
    margin-left: auto;
}

.h-status.success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.h-status.wait { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.h-status.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.back-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-right: 10px;
    display: none;
    align-items: center;
    justify-content: center;
}

.back-btn .mdi {
    font-size: 24px;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .bratkiwallet-modal.new-design {
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        transform: none !important;
        background: rgb(30 32 47 / 32%);
        position: relative; /* Ensure context for absolute children */
    }

    /* Make close button sticky/fixed relative to modal */
    .wallet-close-btn.global-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        z-index: 60; /* Ensure above panel */
    }

    .wallet-sidebar {
        width: 100%;
        height: 100%;
        padding: 15px;
        background: rgb(36 38 54 / 89%);
        overflow: hidden; /* Changed from overflow-y: auto to keep header fixed */
        display: flex;
        flex-direction: column;
    }

    /* Reduce Header Size */
    .wallet-header {
        margin-bottom: 15px;
        flex-shrink: 0; /* Ensure header doesn't shrink */
    }
    .wallet-logo {
        font-size: 18px;
    }

    /* Method Items Compact */
    .wallet-method-item {
        padding: 8px 12px;
        border-radius: 12px;
    }
    .method-icon {
        width: 32px;
        height: 32px;
        padding: 5px;
    }
    .method-name {
        font-size: 13px;
    }
    .method-limit {
        font-size: 11px;
    }

    /* Mobile Panel (Overlay/Slide-in) */
    .wallet-panel {
        position: absolute;
        top: 60px; /* Start below the header */
        left: 0;
        right: 0;
        bottom: 0;
        height: auto;
        z-index: 50;
        
        /* GPU & Visibility Logic */
        transform: translate3d(100%, 0, 0);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        
        transition: 
            transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), 
            opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
            visibility 0s 0.3s;
            
        padding: 15px;
        padding-top: 10px;
        background: rgb(34 36 52);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        
        /* Performance Optimizations */
        will-change: transform, opacity;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        contain: paint;
    }

    .wallet-panel.mobile-active {
        transform: translate3d(0, 0, 0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        
        transition: 
            transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), 
            opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
            visibility 0s 0s;
    }

    /* Disable inner animations on mobile for performance */
    .wallet-view {
        animation: none !important;
    }

    /* Show back button in panel header */
    .back-btn {
        display: block;
        margin-bottom: 0;
    }
    
    .wallet-panel-header {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .wallet-panel-header h3 {
        font-size: 18px;
    }

    /* Inputs adjustments */
    .wallet-form {
        gap: 15px;
    }
    
    .wallet-input-wrapper input {
        font-size: 16px;
        padding: 12px;
    }
    
    .currency-symbol {
        padding-left: 12px;
    }

    .currency-icon {
        width: 20px;
        height: 20px;
    }

    .wallet-presets button {
        padding: 8px 12px;
        font-size: 13px;
        background: #4283f9;
    }

    .wallet-submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}