/* Profile Page Styles */

/* Steam Login Button */
.btn-steam {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
    border: 2px solid rgba(102, 192, 244, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(27, 40, 56, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-steam::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 192, 244, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-steam:hover::before {
    opacity: 1;
}

.btn-steam:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 192, 244, 0.6);
    box-shadow: 0 8px 24px rgba(27, 40, 56, 0.7), 0 0 20px rgba(102, 192, 244, 0.3);
}

.btn-steam:active {
    transform: translateY(0);
}

.btn-steam svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* User Profile (for authenticated users) */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    background: linear-gradient(135deg, var(--surface), var(--surface-light));
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-profile:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(255, 153, 51, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile svg {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.user-profile:hover svg {
    transform: rotate(180deg);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: linear-gradient(135deg, var(--surface), var(--surface-light));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 153, 51, 0.1);
    color: var(--primary);
}

.dropdown-item svg {
    color: var(--text-secondary);
    transition: color 0.3s;
}

.dropdown-item:hover svg {
    color: var(--primary);
}

.profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Profile Header */
.profile-header {
    position: relative;
    margin-bottom: 32px;
}

.profile-banner {
    height: 200px;
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.2), rgba(255, 193, 7, 0.2));
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.profile-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.05) 70%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.05) 70%, transparent 70%);
    background-size: 60px 60px;
}

.profile-main {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(20, 20, 35, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 16px 16px;
    padding: 80px 40px 32px;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 32px;
    align-items: center;
}

.profile-avatar-section {
    position: relative;
    min-width: 150px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--bg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 153, 51, 0.3);
    position: absolute;
    top: -140px;
    left: 0;
    object-fit: cover;
    z-index: 1;
}

.profile-status {
    position: absolute;
    top: -50px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 4px solid var(--bg);
    z-index: 1;
}

.profile-status.online {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.profile-status.offline {
    background: var(--text-muted);
}

.profile-info {
    padding-top: 20px;
    position: relative;
    z-index: 2;
}

.profile-name {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-steam-id {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.profile-steam-id svg {
    opacity: 0.6;
}

.profile-registered {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-bio {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
    max-width: 600px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
}

/* Stats Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(20, 20, 35, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 153, 51, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 153, 51, 0.5);
    box-shadow: 0 12px 32px rgba(255, 153, 51, 0.25);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.cases {
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.25), rgba(255, 193, 7, 0.15));
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(255, 153, 51, 0.2);
}

.stat-icon.contracts {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25), rgba(33, 150, 243, 0.15));
    color: #2196f3;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.2);
}

.stat-icon.upgrades {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.15));
    color: var(--green);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.stat-icon.best-drop {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 193, 7, 0.2));
    color: #ffd700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 24px rgba(255, 215, 0, 0.5);
    }
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
}

.stat-value.best-drop-value {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.4;
}

/* Edit Form */
.profile-edit-form {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(20, 20, 35, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label svg {
    color: var(--primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
}

/* Tabs */
.profile-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(255, 153, 51, 0.3);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Inventory Actions */
.inventory-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.inventory-item {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(20, 20, 35, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.5;
}

.inventory-item.rarity-common::before { background: #94A3B8; }
.inventory-item.rarity-rare::before { background: #3B82F6; }
.inventory-item.rarity-epic::before { background: #A855F7; }
.inventory-item.rarity-legendary::before { background: #F59E0B; }

.inventory-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(255, 153, 51, 0.2);
}

.inventory-item img,
.inventory-item svg {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 12px;
}

.item-info {
    margin-bottom: 12px;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

@media (max-width: 480px) {
    .item-actions { top: 8px; right: 8px; }
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon-sell {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    color: var(--green);
}

.btn-icon-sell:hover {
    background: var(--green);
    color: white;
    transform: scale(1.1);
}

.btn-icon-withdraw {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1));
    color: #2196f3;
}

.btn-icon-withdraw:hover {
    background: #2196f3;
    color: white;
    transform: scale(1.1);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(20, 20, 35, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.history-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-icon svg {
    width: 28px;
    height: 28px;
}

.history-icon.rarity-common { background: rgba(148, 163, 184, 0.2); color: #94A3B8; }
.history-icon.rarity-rare { background: rgba(59, 130, 246, 0.2); color: #3B82F6; }
.history-icon.rarity-epic { background: rgba(168, 85, 247, 0.2); color: #A855F7; }
.history-icon.rarity-legendary { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }

.history-content {
    flex: 1;
}

.history-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-meta {
    text-align: right;
}

.history-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* Steam Button - tablet */
    .btn-steam {
        padding: 10px 24px;
        font-size: 13px;
    }
    
    /* User Profile - tablet */
    .user-name {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    /* Steam Button - mobile */
    .btn-steam {
        padding: 10px 20px;
        font-size: 12px;
        gap: 8px;
        white-space: nowrap;
    }
    
    .btn-steam svg {
        width: 18px;
        height: 18px;
    }
    
    /* User Profile - mobile */
    .user-profile {
        padding: 6px 12px 6px 6px;
        gap: 8px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-name {
        font-size: 12px;
        max-width: 80px;
    }
    
    .user-profile svg {
        width: 14px;
        height: 14px;
    }
    
    /* Profile Dropdown - mobile */
    .profile-dropdown {
        min-width: 200px;
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .profile-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .dropdown-item svg {
        width: 16px;
        height: 16px;
    }
    
    /* Profile Page - mobile */
    .profile-main {
        grid-template-columns: 1fr;
        padding-top: 100px;
        text-align: center;
    }
    
    .profile-avatar-section {
        margin: 0 auto;
    }
    
    .profile-avatar {
        position: relative;
        top: -80px;
        margin-bottom: -80px;
        width: 120px;
        height: 120px;
    }
    
    .profile-status {
        top: 5px;
        width: 24px;
        height: 24px;
    }
    
    .profile-info {
        padding-top: 0;
    }
    
    .profile-bio {
        margin-left: auto;
        margin-right: auto;
    }
    
    .profile-actions {
        justify-content: center;
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
    
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .profile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        flex-shrink: 0;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .btn-steam {
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .user-name {
        display: none;
    }
    
    .profile-dropdown {
        min-width: 180px;
    }
}

/* Profile pagination */
.sp-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}
.sp-pagination__list {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}
.sp-pagination__item a,
.sp-pagination__item span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 700;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.sp-pagination__item a:hover {
    transform: translateY(-1px);
    border-color: rgba(255,153,51,0.35);
    background: rgba(255,153,51,0.10);
}
.sp-pagination__item.sp-active span {
    border-color: rgba(255,153,51,0.55);
    background: rgba(255,153,51,0.18);
    color: #fff;
}
.sp-pagination__item.sp-disabled span {
    opacity: .45;
}
.sp-pagination__item.sp-sep span {
    opacity: .55;
    min-width: 26px;
    padding: 0 8px;
}

@media (max-width: 480px) {
    .sp-pagination__item a,
    .sp-pagination__item span {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        border-radius: 9px;
    }
}


/* Status icons on inventory items */
.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);
}

.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;
}
