/* ==========================================
   GROX.MARKET - Market V2 Styles
   Extends profile-v2 base styles
   ========================================== */

/* User Balance in Header */
.user-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
}

.user-balance svg {
    color: var(--accent-primary);
}

/* Layout override for market */
.market-layout {
    grid-template-columns: 260px 1fr;
}

.market-layout .left-sidebar {
    padding: 12px;
}

/* ==========================================
   FILTERS SIDEBAR
   ========================================== */
.filters-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filters-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.filters-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filters-header-mobile .filters-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filters-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filters-close-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filters-title svg {
    color: var(--accent-primary);
    width: 16px;
    height: 16px;
}

.filter-group {
    margin-bottom: 10px;
}

.filter-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%236b6b73' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 14px;
    height: 14px;
}

.search-input-wrapper .filter-input {
    padding-left: 30px;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-input {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
}

.price-sep {
    color: var(--text-muted);
    font-size: 12px;
}

.filter-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.filter-btn-reset,
.filter-btn-apply {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn-reset svg,
.filter-btn-apply svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.filter-btn-reset {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.filter-btn-reset:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-btn-apply {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-btn-apply:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Stats Card */
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.stats-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.stats-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stats-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ==========================================
   MARKET CONTENT
   ========================================== */
.market-content {
    padding: 20px;
}

.market-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.market-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.market-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.market-title svg {
    color: var(--accent-primary);
}

.market-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.market-actions {
    display: flex;
    gap: 10px;
}

.action-btn-market {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn-market:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.action-btn-market.primary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.action-btn-market.primary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Sort Bar */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 8px;
}

.sort-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sort-btn.active {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.view-options {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Market Product Card */
.market-product-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.market-product-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

/* Карточка от админа */
.market-product-card.admin-seller {
    border: 2px solid var(--accent-primary);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.market-product-card.admin-seller:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.25);
}

.market-product-card.admin-seller::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.market-product-card .admin-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-gradient);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
    animation: adminPulse 2s ease-in-out infinite;
}

@keyframes adminPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4); }
    50% { box-shadow: 0 2px 15px rgba(168, 85, 247, 0.6); }
}

.seller-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.market-product-card .product-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.market-product-card .product-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #229ED9 0%, #1E88E5 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.market-product-card .product-icon svg {
    color: white;
}

.market-product-card .product-main {
    flex: 1;
    min-width: 0;
}

.market-product-card .product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-product-card .product-country {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.market-product-card .product-country img {
    width: 16px;
    height: 12px;
    border-radius: 2px;
}

.market-product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
    text-align: right;
}

/* Product Meta */
.market-product-card .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.product-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-tag.spam-free {
    background: var(--success-bg);
    color: var(--success);
}

.product-tag.spam-temp {
    background: var(--warning-bg);
    color: var(--warning);
}

.product-tag.spam-geo {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.product-tag.spam-banned {
    background: var(--danger-bg);
    color: var(--danger);
}

.product-tag.spam-unknown {
    background: rgba(113, 113, 122, 0.1);
    color: var(--text-muted);
}

.product-tag.resale {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.product-tag.has-2fa {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

/* Tag Icons */
.tag-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.product-tag.spam-free .tag-icon { color: var(--success); }
.product-tag.spam-temp .tag-icon { color: #f59e0b; }
.product-tag.spam-geo .tag-icon { color: #3b82f6; }
.product-tag.spam-banned .tag-icon { color: var(--danger); }
.product-tag.resale .tag-icon { color: var(--accent-primary); }
.product-tag.has-2fa .tag-icon { color: #f59e0b; }

/* Product Seller */
.market-product-card .product-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.market-product-card .product-seller img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.market-product-card .seller-info {
    flex: 1;
}

.market-product-card .seller-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
}

.market-product-card .seller-stats {
    font-size: 11px;
    color: var(--text-muted);
}

.market-product-card .seller-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* Product Actions */
.market-product-card .product-actions {
    display: flex;
    gap: 10px;
}

.market-product-card .product-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.market-product-card .product-btn.buy {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.market-product-card .product-btn.buy:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.market-product-card .product-btn.view {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.market-product-card .product-btn.view:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading-indicator span {
    font-size: 14px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   PURCHASE MODAL STYLES
   ========================================== */
.purchase-info {
    margin-bottom: 24px;
}

.purchase-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.purchase-details {
    flex: 1;
}

.purchase-phone {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.purchase-country {
    font-size: 12px;
    color: var(--text-secondary);
}

.purchase-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
}

.purchase-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.purchase-seller img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.purchase-seller span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 2FA Warning */
.two-fa-warning {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.two-fa-warning .warning-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.two-fa-warning .warning-content {
    flex: 1;
}

.two-fa-warning .warning-title {
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 4px;
}

.two-fa-warning .warning-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Purchase Stages */
.purchase-stage {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.stage-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    flex-shrink: 0;
}

.stage-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stage-text {
    flex: 1;
}

.stage-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stage-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* Phone Result */
.phone-result {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.phone-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.phone-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.phone-value {
    font-size: 18px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ==========================================
   BULK BUY MODAL
   ========================================== */
.bulk-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bulk-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    padding-top: 12px;
    margin-top: 4px;
}

.summary-row.total span {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-row.total strong {
    font-size: 18px;
    color: var(--success);
}

/* ==========================================
   NEWS LINK
   ========================================== */
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.news-link svg {
    color: var(--accent-primary);
}

/* ==========================================
   NOTIFICATION BELL
   ========================================== */
.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-bell:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   NOTIFICATIONS BUBBLE
   ========================================== */
.notifications-bubble {
    width: 380px;
    max-height: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideDown 0.2s ease-out;
}

.notifications-bubble.hiding {
    animation: notifSlideUp 0.15s ease-in forwards;
}

@keyframes notifSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notifSlideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.notif-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-clear-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notif-content-wrapper {
    flex: 1;
    overflow-y: auto;
    max-height: 440px;
}

.notif-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.notif-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.notif-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.notif-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.notif-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border-radius: 10px;
    cursor: default;
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--bg-secondary);
}

.notif-item.unread {
    background: rgba(168, 85, 247, 0.06);
}

.notif-item.unread:hover {
    background: rgba(168, 85, 247, 0.1);
}

.notif-item.read {
    opacity: 0.65;
}

.notif-item.read:hover {
    opacity: 1;
}

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon.sale-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notif-icon.balance-icon {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.notif-icon.warning-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notif-icon.info-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notif-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.notif-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.notif-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-buyer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.notif-buyer-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notif-amount {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 6px;
}

.notif-amount-plus {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.notif-amount-minus {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-empty {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.notif-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.notif-empty-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.notif-empty-desc {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 220px;
    line-height: 1.5;
}

/* ==========================================
   USER DROPDOWN
   ========================================== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 20px;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item svg {
    color: var(--text-muted);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1200px) {
    .market-layout {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 1024px) {
    .market-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        display: none;
        background: var(--bg-secondary);
        padding: 0 16px;
        border-radius: var(--radius-lg);
        margin: 0 12px 12px;
        border: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .filters-sidebar.show {
        display: flex;
        flex-direction: column;
        max-height: none;
        padding: 16px;
        overflow-y: visible;
    }
    
    .filters-sidebar.show .filters-card {
        border: none;
        padding: 0;
        background: transparent;
    }
    
    .filters-close-btn {
        display: flex;
    }
    
    .filters-header-mobile {
        display: flex;
    }
    
    /* Скрываем элементы когда фильтры открыты */
    body.filters-open .market-header,
    body.filters-open .sort-bar {
        display: none;
    }
    
    .market-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .market-actions {
        width: 100%;
    }
    
    .action-btn-market {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .market-content {
        padding: 12px;
    }
    
    .market-title {
        font-size: 20px;
    }
    
    .sort-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .sort-options {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .view-options {
        justify-content: center;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
    }
    
    .market-product-card {
        padding: 16px;
    }
    
    .action-btn-market {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .top-bar-center {
        display: none;
    }
    
    .user-balance {
        display: none;
    }
    
    .market-actions {
        flex-direction: column;
    }
    
    .action-btn-market {
        width: 100%;
    }
    
    .market-product-card .product-header {
        flex-wrap: wrap;
    }
    
    .market-product-card .product-price {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
    
    .market-product-card .product-actions {
        flex-direction: column;
    }
    
    /* Модальное окно массовой покупки на мобильных */
    .modal-lg {
        max-width: 100%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .modal-lg .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .bulk-form .form-row {
        flex-direction: column;
    }
    
    .bulk-form .form-group {
        width: 100%;
    }
    
    .bulk-form .form-input,
    .bulk-form .form-select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .mobile-filter-btn {
        display: flex;
    }
}

/* ==========================================
   BULK PROGRESS MODAL
   ========================================== */
.modal-sm {
    max-width: 400px;
}

.bulk-progress-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.progress-stat .stat-label {
    color: var(--text-secondary);
}

.progress-stat .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-stat.success .stat-value {
    color: #40D979;
}

.progress-stat.error .stat-value {
    color: #ff4757;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-current {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bulk Download Actions */
.bulk-download-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.download-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 10px;
}

.download-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn.session {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.download-btn.session:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.download-btn.tdata {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.download-btn.tdata:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   CUSTOM DROPDOWN (универсальный компонент)
   ========================================== */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-dropdown-selected:hover {
    border-color: var(--accent-primary);
}

.custom-dropdown.open .custom-dropdown-selected {
    border-color: var(--accent-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-dropdown-selected svg:last-child {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.custom-dropdown.open .custom-dropdown-selected svg:last-child {
    transform: rotate(180deg);
}

.custom-dropdown-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-dropdown-icon svg {
    width: 16px;
    height: 16px;
}

.custom-selected-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.custom-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-top: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-dropdown.open .custom-dropdown-list {
    display: block;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-dropdown-item:hover {
    background: var(--bg-secondary);
}

.custom-dropdown-item.selected {
    background: rgba(168, 85, 247, 0.1);
}

.custom-dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.custom-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-item-icon svg {
    width: 16px;
    height: 16px;
}

.custom-item-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.custom-item-text {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Цвета иконок для статусов */
.custom-dropdown-icon.spam-free svg,
.custom-item-icon.spam-free svg {
    color: #22c55e;
}

.custom-dropdown-icon.spam-temp svg,
.custom-item-icon.spam-temp svg {
    color: #f59e0b;
}

.custom-dropdown-icon.spam-geo svg,
.custom-item-icon.spam-geo svg {
    color: #3b82f6;
}

.custom-dropdown-icon.no-2fa svg,
.custom-item-icon.no-2fa svg {
    color: #22c55e;
}

.custom-dropdown-icon.has-2fa svg,
.custom-item-icon.has-2fa svg {
    color: #ef4444;
}

.custom-dropdown-icon.origin-autoreg svg,
.custom-item-icon.origin-autoreg svg {
    color: #8b5cf6;
}

.custom-dropdown-icon.origin-samoreg svg,
.custom-item-icon.origin-samoreg svg {
    color: #22c55e;
}

.custom-dropdown-icon.origin-phishing svg,
.custom-item-icon.origin-phishing svg {
    color: #ef4444;
}

.custom-dropdown-icon.sort-asc svg,
.custom-item-icon.sort-asc svg {
    color: #22c55e;
}

.custom-dropdown-icon.sort-desc svg,
.custom-item-icon.sort-desc svg {
    color: #ef4444;
}

.custom-dropdown-icon.sort-new svg,
.custom-item-icon.sort-new svg {
    color: #3b82f6;
}

/* Флаги стран */
.country-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ==========================================
   SELLER DROPDOWN WITH AVATARS (legacy)
   ========================================== */
.seller-dropdown {
    position: relative;
    width: 100%;
}

.seller-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.seller-dropdown-selected:hover {
    border-color: var(--accent-primary);
}

.seller-dropdown.open .seller-dropdown-selected {
    border-color: var(--accent-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.seller-dropdown-selected svg {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.seller-dropdown.open .seller-dropdown-selected svg {
    transform: rotate(180deg);
}

.seller-dropdown-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seller-selected-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.seller-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-top: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.seller-dropdown.open .seller-dropdown-list {
    display: block;
}

.seller-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.seller-dropdown-item:hover {
    background: var(--bg-secondary);
}

.seller-dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.seller-item-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.seller-item-name {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
