/* ============================================
   MOBILE ADAPTATION STYLES
   ============================================ */

/* Mobile Bottom Navigation Panel */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.98), rgba(15, 20, 30, 0.98));
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 8px 16px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-width: 60px;
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.mobile-nav-item.active {
    background: rgba(255, 153, 51, 0.1);
    color: var(--primary);
}

.mobile-nav-item.active svg {
    transform: scale(1.1);
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item.profile .mobile-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.mobile-nav-item.profile.not-logged {
    gap: 6px;
}

.mobile-nav-item.profile.not-logged svg {
    width: 20px;
    height: 20px;
}

/* Mobile Top Bar */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.98), rgba(15, 20, 30, 0.98));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mobile-logo {
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.mobile-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.1), rgba(255, 102, 51, 0.05));
    border: 1px solid rgba(255, 153, 51, 0.3);
    border-radius: 8px;
}

.mobile-balance-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.mobile-balance-amount {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.mobile-balance-add-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    margin-left: 2px;
    flex-shrink: 0;
}

.mobile-balance-add-btn:active {
    transform: scale(0.9);
}

.mobile-balance-add-btn svg {
    width: 14px;
    height: 14px;
}

.mobile-online-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-online-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px var(--green);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Mobile Notifications */
@media (max-width: 768px) {
    .notifications-container {
        top: 70px !important;
        right: 12px !important;
        left: auto !important;
        bottom: auto !important;
        max-width: calc(100vw - 24px);
    }
    
    .notification {
        min-width: 280px;
        max-width: 100%;
        padding: 12px 16px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
    
    /* Swipe to dismiss */
    .notification.swiping {
        transition: transform 0.1s linear;
    }
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    /* Show mobile navigation */
    .mobile-bottom-nav {
        display: block;
    }
    
    .mobile-top-bar {
        display: block;
    }
    
    /* Hide desktop elements */
    .top-nav,
    .sidebar,
    .weapon-bar {
        display: none !important;
    }
    
    /* Adjust main content for mobile bars */
    body {
        padding-top: 60px;
        padding-bottom: 80px;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 16px !important;
        min-height: calc(100vh - 140px);
    }
    
    .container {
        min-height: auto;
    }
    
    /* Mobile Balance Bar in Header - hide on mobile */
    .balance-bar {
        display: none !important;
    }
}

/* Profile Mobile Adaptations */
@media (max-width: 768px) {
    .profile-container {
        padding: 12px;
    }
    
    .profile-banner {
        height: 120px;
    }
    
    .profile-main {
        padding: 60px 20px 24px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        top: -70px;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Trade Link Input with Tooltip */
    .trade-link-group {
        position: relative;
    }
    
    .trade-link-tooltip {
        position: absolute;
        right: 12px;
        top: 12px;
        width: 24px;
        height: 24px;
        background: rgba(255, 153, 51, 0.1);
        border: 1px solid rgba(255, 153, 51, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        z-index: 10;
    }
    
    .trade-link-tooltip:hover {
        background: rgba(255, 153, 51, 0.2);
    }
    
    .tooltip-popup {
        position: absolute;
        bottom: 100%;
        right: 0;
        margin-bottom: 8px;
        padding: 12px;
        background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(20, 20, 35, 0.98));
        border: 1px solid rgba(255, 153, 51, 0.3);
        border-radius: 8px;
        width: 280px;
        font-size: 12px;
        line-height: 1.5;
        color: var(--text-secondary);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        z-index: 100;
    }
    
    .tooltip-popup.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .tooltip-popup::after {
        content: '';
        position: absolute;
        top: 100%;
        right: 8px;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid rgba(26, 26, 46, 0.98);
    }
    
    /* Inventory Grid Mobile */
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .inventory-item {
        padding: 12px;
    }
    
    .inventory-item img,
    .inventory-item svg {
        height: 100px;
    }
    
    .item-name {
        font-size: 12px;
    }
    
    .item-price {
        font-size: 14px;
    }
    
    /* Status Icons */
    .item-status-icon {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        z-index: 10;
    }
    
    .item-status-icon.sold {
        background: rgba(76, 175, 80, 0.2);
        color: var(--green);
    }
    
    .item-status-icon.withdrawn {
        background: rgba(33, 150, 243, 0.2);
        color: #2196f3;
    }
    
    .item-status-icon.withdrawing {
        background: rgba(255, 193, 7, 0.2);
        color: var(--yellow);
        animation: rotate 2s linear infinite;
    }
    
    .item-status-icon.used {
        background: rgba(168, 85, 247, 0.2);
        color: var(--purple);
    }

    .item-status-icon.lost {
        background: rgba(239, 68, 68, 0.18);
        color: #ef4444;
    }
    
    @keyframes rotate {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    /* Mobile Tabs */
    .profile-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .profile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Inventory Status Filters */
    .inventory-status-filters {
        display: flex;
        gap: 8px;
        margin-bottom: 16px;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    
    .inventory-status-filters::-webkit-scrollbar {
        display: none;
    }
    
    .status-filter-btn {
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .status-filter-btn.active {
        background: linear-gradient(135deg, var(--primary), var(--yellow));
        border-color: var(--primary);
        color: white;
    }
    
    .status-filter-btn:active {
        transform: scale(0.95);
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .mobile-top-bar {
        padding: 10px 12px;
    }
    
    .mobile-logo {
        font-size: 18px;
    }
    
    .mobile-balance-display {
        padding: 6px 10px;
    }
    
    .mobile-balance-amount {
        font-size: 12px;
    }
    
    .mobile-online-counter {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .mobile-bottom-nav {
        padding: 8px 4px 12px;
    }
    
    .mobile-nav-item {
        font-size: 10px;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .notification {
        padding: 10px 14px;
        min-width: 260px;
    }
}

/* Landscape Mobile */
@media (max-width: 926px) and (orientation: landscape) {
    .mobile-bottom-nav {
        padding: 8px 8px 8px;
    }
    
    .mobile-nav-item {
        padding: 6px 10px;
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* Tablet Adaptations */
@media (min-width: 769px) and (max-width: 1024px) {
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* PWA Safe Areas for notch devices */
@supports (padding: max(0px)) {
    .mobile-top-bar {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    .mobile-bottom-nav {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }
}

/* Click item to open case modal on mobile */
.inventory-item-clickable {
    cursor: pointer;
    position: relative;
}

.inventory-item-clickable::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkmark button for save */
.btn-save-check {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #059669);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-save-check:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-save-check:active {
    transform: scale(0.95);
}

.btn-save-check svg {
    width: 24px;
    height: 24px;
}
