/* Universal Custom Selectors CSS - BitFlow Theme */
/* Объединенные стили для всех типов селекторов в проекте */

/* Base Custom Selector Styles */
.custom-selector-wrapper {
    position: relative;
    width: 100%;
}

.custom-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.75rem;
    background: var(--oneinch-input-bg);
    border: 1px solid var(--oneinch-border);
    border-radius: 8px;
    color: var(--oneinch-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    min-height: 42px;
    backdrop-filter: blur(10px);
    width: 100%;
    line-height: 1.5;
}

.custom-selector:hover {
    border-color: var(--oneinch-blue);
    box-shadow: 0 0 0 2px rgba(44, 94, 255, 0.1);
    background: var(--oneinch-input-bg);
}

.custom-selector:focus,
.custom-selector.focused {
    border-color: var(--oneinch-blue);
    box-shadow: 0 0 0 3px rgba(44, 94, 255, 0.2);
    outline: none;
    background: var(--oneinch-input-bg);
}

.custom-selector.open {
    border-color: var(--oneinch-border);
    border-radius: 8px 8px 0 0;
    box-shadow: none;
}

.custom-selector-text {
    flex: 1;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-selector-placeholder {
    color: var(--oneinch-text-secondary);
    opacity: 0.7;
}

.custom-selector-value {
    color: var(--oneinch-text-primary);
    font-weight: 500;
}

.custom-selector-icon {
    margin-left: 12px;
    transition: transform 0.3s ease;
    color: var(--oneinch-text-secondary);
    font-size: 14px;
    display: inline-block;
}

/* Для базовой иконки без Font Awesome */
.custom-selector-icon:not(.fas) {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--oneinch-text-secondary);
    font-size: 0;
}

.custom-selector-icon:not(.fas)::before {
    display: none;
}

/* Для Font Awesome иконки */
.custom-selector-icon.fas {
    width: auto !important;
    height: auto !important;
    border: none !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.custom-selector-icon.fas::before {
    content: "\f078" !important; /* fa-chevron-down */
    display: inline-block !important;
}

.custom-selector-icon.fa-chevron-down {
    width: auto !important;
    height: auto !important;
    border: none !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.custom-selector-icon.fa-chevron-down::before {
    content: "\f078" !important; /* fa-chevron-down */
    display: inline-block !important;
}

.custom-selector.open .custom-selector-icon {
    transform: rotate(180deg);
}

/* Token/Currency Selector Specific Styles */
.custom-selector.token-selector {
    min-width: 140px;
    padding: 0.75rem 1rem;
}

.custom-selector.token-selector .custom-selector-text {
    gap: 0.75rem;
}
/* 
.token-icon-wrapper {
    width: 36px;
    height: auto;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--oneinch-card-bg);
    flex-shrink: 0;
}

.token-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

.token-symbol {
    font-weight: 600;
    color: var(--oneinch-text-primary);
}

/* Form Control Compatibility */
.custom-selector.form-control-style {
    background: var(--oneinch-input-bg);
    border: 1px solid var(--oneinch-border);
    color: var(--oneinch-text-primary);
}

.custom-selector.form-control-style:focus {
    border-color: var(--oneinch-blue);
    box-shadow: 0 0 0 3px rgba(44, 94, 255, 0.2);
}

/* Dropdown Styles */
.custom-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--oneinch-card-bg);
    border: 1px solid var(--oneinch-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 2001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    display: none;
}

.custom-selector-dropdown.show {
    display: block;
}

.custom-selector-search {
    padding: 12px;
    border-bottom: 1px solid var(--oneinch-border);
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 2002;
}

.custom-selector-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--oneinch-input-bg);
    border: 1px solid var(--oneinch-border);
    border-radius: 6px;
    color: var(--oneinch-text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.custom-selector-search input:focus {
    border-color: var(--oneinch-blue);
    box-shadow: 0 0 0 2px rgba(44, 94, 255, 0.2);
}

.custom-selector-search input::placeholder {
    color: var(--oneinch-text-secondary);
    opacity: 0.7;
}

.custom-selector-options {
    padding: 4px 0;
}

.custom-selector-option {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--oneinch-text-primary);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-selector-option:last-child {
    border-bottom: none;
}

.custom-selector-option:hover {
    background: var(--oneinch-blue);
    color: white;
    transform: translateX(2px);
}

.custom-selector-option.selected {
    background: var(--oneinch-blue);
    color: white;
    font-weight: 500;
}

.custom-selector-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.custom-selector-option.hidden {
    display: none;
}

.custom-selector-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Token/Currency Option Styles */
.custom-selector-option.token-option {
    padding: 10px 16px;
}

.custom-selector-option.token-option .token-icon-wrapper {
    width: 24px;
    height: 24px;
}

.custom-selector-option.token-option .token-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.custom-selector-option.token-option .token-symbol {
    font-weight: 600;
    font-size: 0.9rem;
}

.custom-selector-option.token-option .token-name {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Country Option Styles */
.custom-selector-option.country-option {
    padding: 10px 16px;
}

.custom-selector-option.country-option .country-flag {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.custom-selector-option.country-option .country-name {
    font-size: 0.9rem;
}

/* Scrollbar Styles - СКРЫТЫЕ СКРОЛЛБАРЫ */
.custom-selector-dropdown::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.custom-selector-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.custom-selector-dropdown::-webkit-scrollbar-thumb {
    background: transparent;
}

.custom-selector-dropdown::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* Для Firefox */
.custom-selector-dropdown {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Animation for opening/closing */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-selector-dropdown.show {
    animation: slideDown 0.3s ease;
}

/* Error State */
.custom-selector-wrapper.error .custom-selector {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Disabled State */
.custom-selector.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--oneinch-disabled-bg, #f3f4f6);
}

.custom-selector.disabled:hover {
    border-color: var(--oneinch-border);
    box-shadow: none;
}

/* Loading state */
.custom-selector.loading {
    position: relative;
    overflow: hidden;
}

.custom-selector.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 94, 255, 0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .custom-selector-dropdown {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .custom-selector-option {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-selector {
        padding: 0.75rem 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .custom-selector-dropdown {
        max-height: 200px;
    }
    
    .custom-selector-option {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .custom-selector.token-selector {
        min-width: 120px;
        padding: 0.625rem 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-selector {
        border-width: 2px;
    }
    
    .custom-selector:focus {
        box-shadow: 0 0 0 3px rgba(44, 94, 255, 0.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .custom-selector,
    .custom-selector-icon,
    .custom-selector-option {
        transition: none;
    }
    
    .custom-selector-dropdown.show {
        animation: none;
    }
}

/* Focus visible for keyboard navigation */
.custom-selector:focus-visible {
    outline: 2px solid var(--oneinch-blue);
    outline-offset: 2px;
}

.custom-selector-option:focus-visible {
    outline: 2px solid var(--oneinch-blue);
    outline-offset: -2px;
}

/* Network Selector Specific Styles */
.network-selector-container {
    margin-bottom: 1.5rem;
    padding: 0 1.75rem;
    position: relative;
    z-index: 2000 !important;
}

.network-selector-header {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--oneinch-text-primary);
    font-size: 0.9rem;
}

.network-selector-container .custom-selector {
    width: 100%;
    position: relative;
    /* max-width: 300px; */
}

/* Trigger Content Layout */
.selector-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.trigger-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

/* Network Icons Stack */
.network-icons-stack {
    position: relative;
    display: flex;
    align-items: center;
    width: 75px;
    height: 28px;
}

.network-icons-stack.small {
    width: 50px;
    height: 24px;
}

.stack-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--oneinch-card-bg);
    background: var(--oneinch-card-bg);
    object-fit: cover;
    transition: transform 0.2s ease;
}

.network-icons-stack.small .stack-icon {
    width: 20px;
    height: 20px;
    border-width: 1.5px;
}

.stack-icon.icon-1 {
    left: 0;
    z-index: 3;
}

.stack-icon.icon-2 {
    left: 14px;
    z-index: 2;
}

.stack-icon.icon-3 {
    left: 28px;
    z-index: 1;
}

.network-icons-stack.small .stack-icon.icon-2 {
    left: 10px;
}

.network-icons-stack.small .stack-icon.icon-3 {
    left: 20px;
}

.stack-count {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--oneinch-blue);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 40px;
    text-align: right;
    border: 1px solid var(--oneinch-card-bg);
}

.network-icons-stack.small .stack-count {
    left: 30px;
    font-size: 9px;
    padding: 1px 4px;
    min-width: 18px;
}

/* Option Content Layout */
.option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

/* Single Network Icon */
.single-network-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.network-selector-container .selector-dropdown {
    width: 100%;
    /* max-width: 300px; */
}

.network-selector-container .selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--oneinch-card-bg);
    border: 1px solid var(--oneinch-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2001;
    max-height: 240px;
    overflow: hidden;
    display: none;
    backdrop-filter: blur(20px);
}

.selector-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--oneinch-border);
    position: relative;
}

.selector-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--oneinch-border);
    border-radius: 6px;
    background: var(--oneinch-input-bg);
    color: var(--oneinch-text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.selector-search input:focus {
    border-color: var(--oneinch-blue);
    box-shadow: 0 0 0 2px rgba(44, 94, 255, 0.1);
}

.selector-search i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--oneinch-text-secondary);
    font-size: 0.9rem;
}

.selector-options {
    max-height: 180px;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.selector-option {
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--oneinch-text-primary);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.selector-option:hover {
    background: var(--oneinch-hover-bg);
}

.selector-option.active {
    background: var(--oneinch-blue);
    color: white;
}

.selector-option .option-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.network-selector-container .option-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    /* margin-right: 0.5rem; */
}

/* Popular Tokens Container */
.popular-tokens-container {
    margin-bottom: 1.5rem;
}

.popular-tokens-header {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--oneinch-text-primary);
    font-size: 0.9rem;
}

.popular-tokens-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 1.75rem;
}

.popular-token-tab {
    /* Inherit all styles from network-tab class */
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--oneinch-card-bg);
    border: 1px solid var(--oneinch-border);
    border-radius: 8px;
    color: var(--oneinch-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.popular-token-tab:hover {
    background: var(--oneinch-blue);
    color: white;
    border-color: var(--oneinch-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 94, 255, 0.3);
}

.popular-token-tab.active {
    background: var(--oneinch-blue);
    color: white;
    border-color: var(--oneinch-blue);
    box-shadow: 0 2px 8px rgba(44, 94, 255, 0.3);
}

.popular-token-tab .network-tab-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Compatibility with existing classes */
.filter-select.custom-selector {
    min-height: auto;
}

/* Hide original select elements when customized */
select[data-customized="true"] {
    display: none !important;
}

/* Token Display Styles */
.tokens-display-section {
    margin-top: 1.5rem;
}

.tokens-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .5rem;
    padding: 0 1.75rem 1.5rem;
}

/* Token Item Styles (inspired by 1inch) */
.token-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--oneinch-card-bg, #1a1a1a);
    border: 1px solid var(--oneinch-border, #333);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.token-item:hover {
    background: var(--oneinch-card-hover-bg, #252525);
    border-color: var(--oneinch-blue, #2c5eff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 94, 255, 0.15);
}

.token-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.3);
}

.token-item__icon-wrap {
    position: relative;
    margin-right: 12px;
}

.token-item__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.token-item__network-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--oneinch-card-bg, #1a1a1a);
    /* border: 2px solid var(--oneinch-card-bg, #1a1a1a); */
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--oneinch-text-primary, #fff);
}

.token-item__network-icon span {
    background: var(--oneinch-blue, #2c5eff);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.token-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.token-item__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--oneinch-text-primary, #fff);
    margin-bottom: 4px;
}

.token-item__subtitle {
    font-size: 14px;
    color: var(--oneinch-text-secondary, #999);
    display: flex;
    align-items: center;
    gap: 4px;
}

.token-item__usd-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--oneinch-text-primary, #fff);
    text-align: right;
}

/* Token Networks Expansion */
.token-networks-expand {
    padding-top: 8px;
    margin-bottom: .5rem;
    border-top: 1px solid var(--oneinch-border-light);
    animation: expandIn 0.3s ease-out;
}

.token-balances {
    display: grid;
    grid-gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
}

.network-balance-item {
    transition-property: opacity, transform;
    transition-duration: 0.3s;
    transition-timing-function: ease-in-out;
    opacity: 0;
    transform: translateY(10px);
    margin-left: 0;
    width: 100%;
    min-width: 0; /* важен для grid-детей, чтобы могли сжиматься */
}

.network-balance-item-animated {
    opacity: 1;
    transform: translateY(0);
}

.network-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--oneinch-input-bg, #2a2a2a);
    border: 1px solid var(--oneinch-border, #333);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 20px;
    color: var(--oneinch-text-primary);
    min-width: 0;          
    gap: 8px;               
    overflow: hidden;       
    width: 100%;  
}

.network-item .network-name {
    flex: 1 1 0%;          
    min-width: 0;          
    width: 0;              
    max-width: 100%;
    overflow: hidden;      
    text-overflow: ellipsis;
    white-space: nowrap;   
}

/* Правая часть (иконка/тег/кнопка) — фиксированная */
.network-item .network-right {
    flex: 0 0 auto;
    margin-left: 8px;
}

.network-item:hover {
    background: var(--oneinch-bg-tertiary);
    transform: translateY(-1px);
}

.network-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--oneinch-text-primary, #fff);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* важно для обрезки текста в flex */
}

.network-item .network-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    flex: 0 0 24px;        /* фиксированная ширина, не растягивается */
    object-fit: cover;
    border-radius: 50%;
}

/* .network-name {
    font-weight: 500;
    color: var(--oneinch-text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
} */

.network-icon {
    width: 30px;
    height: auto;
    border-radius: 50%;
    flex-shrink: 0;
}

.token-item.expanded {
    background: var(--oneinch-bg-hover);
    border-radius: 12px;
    padding: 8px;
    margin: 4px 0;
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .token-balances {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .token-balances {
        grid-template-columns: 1fr;
    }
}

/* Token Networks Modal */
.token-networks-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--oneinch-card-bg, #1a1a1a);
    border: 1px solid var(--oneinch-border, #333);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    z-index: 10001;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--oneinch-border, #333);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--oneinch-text-primary, #fff);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--oneinch-text-secondary, #999);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--oneinch-border, #333);
    color: var(--oneinch-text-primary, #fff);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.networks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tokens-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .networks-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation classes */
.token-balances-expand {
    animation: expandAnimation 0.3s ease-out;
}

@keyframes expandAnimation {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Network balance item animation with staggered delay */
.network-balance-item {
    animation: networkItemFadeIn 0.3s ease-out;
    animation-fill-mode: both;
}

@keyframes networkItemFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Popular Token Network Modal Styles */
.popular-token-network-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: modalFadeIn 0.3s ease-out;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.popular-network-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.popular-network-modal-content {
    position: relative;
    background: var(--oneinch-modal-bg, #1a1d29);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 400px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.popular-network-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--oneinch-border, #2d3748);
    flex-shrink: 0;
}

.popular-network-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--oneinch-text-primary, #ffffff);
    font-size: 18px;
    font-weight: 600;
}

.modal-token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.popular-network-modal-close {
    background: none;
    border: none;
    color: var(--oneinch-text-secondary, #a0aec0);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 50px;
}

.popular-network-modal-close:hover {
    background: var(--oneinch-input-bg, #2d3748);
    color: var(--oneinch-text-primary, #ffffff);
}

.popular-network-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Scrollbar styles unified in bitflow/css/modal.css */

.popular-network-subtitle {
    color: var(--oneinch-text-secondary, #a0aec0);
    font-size: 14px;
    margin-bottom: 16px;
}

.popular-network-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px; /* Небольшой отступ для скроллбара */
}

.popular-network-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--oneinch-input-bg, #2d3748);
    border: 1px solid var(--oneinch-border, #4a5568);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.network-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.network-option-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.network-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.network-option-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--oneinch-text-primary, #ffffff);
}

.popular-network-option:hover .network-option-name,
.popular-network-option:focus .network-option-name {
    color: white;
}

.network-option-key {
    font-size: 12px;
    color: var(--oneinch-text-secondary, #a0aec0);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .popular-network-modal-content {
        min-width: 90vw;
        max-width: 90vw;
        margin: 20px;
    }
    
    .popular-network-modal-header,
    .popular-network-modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .popular-network-option {
        padding: 12px;
    }
}

/* Popular Token Networks Styles */
.popular-token-networks {
    background: var(--oneinch-input-bg);
    border: 1px solid var(--oneinch-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin: 0 0 8px 0;
    padding: 8px;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popular-network-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.popular-network-item:last-child {
    margin-bottom: 0;
}

.popular-network-item:hover {
    background: var(--oneinch-blue);
    color: white;
}

.popular-network-item .network-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popular-network-item .network-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.popular-network-item .network-name {
    font-size: 14px;
    font-weight: 500;
}

.popular-token-card.active {
    background: var(--oneinch-input-bg);
    border-color: var(--oneinch-blue);
    border-radius: 8px 8px 0 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
