/* Profile Specific Styles */
html {
    overflow-y: scroll;
    /* Force scrollbar to prevent layout shifts */
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    border-bottom: 2px solid transparent !important;
    transition: all 0.3s;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    border-bottom: 2px solid #ffc107 !important;
    color: #ffc107 !important;
    background-color: transparent !important;
}

.merchant-row:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.modal-content {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.border-dashed {
    border-style: dashed !important;
}

.profile-pic-container:hover .profile-pic-overlay {
    opacity: 1 !important;
}

.transition-all {
    transition: all 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

/* Embark/Minimalist Layout Styles (Moved from index.css) */
.embark-layout {
    min-height: calc(100vh - 100px);
    margin-top: 100px;
    background-color: #0c0c0c;
}

.embark-sidebar {
    width: 280px;
    padding: 40px 0;
    margin-right: 30px;
}

.embark-content {
    flex: 1;
    padding: 60px 0;
}

/* Tablet/Mobile Layout: Horizontal Pill Menu */
@media (max-width: 991.98px) {
    .embark-layout {
        margin-top: 70px;
    }

    .embark-sidebar {
        width: 100%;
        margin-right: 0;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 60px;
        background: #0c0c0c;
        z-index: 10;
        overflow-x: visible;
        white-space: normal;
    }

    /* Hide Scrollbar */
    .embark-sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row !important;
        gap: 6px;
        padding: 0 15px;
        flex-wrap: wrap;
        /* Wrap to new line */
        justify-content: flex-start;
        width: 100%;
    }

    .sidebar-nav-item {
        padding: 6px 14px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 50px;
        font-size: 0.85rem;
        margin-bottom: 2px;
        width: auto !important;
        display: inline-block;
    }

    .sidebar-nav-item.active {
        background: rgba(255, 193, 7, 0.15);
        border-color: rgba(255, 193, 7, 0.3);
        color: #ffc107;
    }

    .sidebar-divider {
        display: none;
    }

    .embark-content {
        padding: 20px 0;
    }

    /* Small Mobile Specifics */
    @media (max-width: 576px) {
        .sidebar-nav-item {
            padding: 5px 10px;
            font-size: 0.75rem;
        }
    }
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    padding: 8px 0;
    margin-bottom: 0;
    font-weight: 500;
    font-size: 1.1rem;
    color: #e0e0e0;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.sidebar-nav-item.active {
    color: #ff3e3e;
    font-weight: 700;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 15px 0;
}

.detail-item {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-label {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 1.25rem;
    color: #b0b0b0;
}

.edit-link {
    color: #ff3e3e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.edit-link:hover {
    opacity: 0.8;
    color: #ff3e3e;
}

.preference-check {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    color: #b0b0b0;
    font-size: 1.15rem;
}

.preference-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #ff3e3e;
}

/* Legend/Rarity Cards Summary */
.credit-card-summary {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(20, 20, 20, 0.4) 100%);
    border-left: 4px solid #ffc107 !important;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.credit-card-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.profile-section-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.profile-section-card:hover {
    border-color: rgba(255, 193, 7, 0.2);
}

.profile-header-premium {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #1a1a1a;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.avatar-status-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    background: #44b700;
    border: 3px solid #1a1a1a;
    border-radius: 50%;
    z-index: 3;
}

.profile-pic-overlay {
    transition: all 0.3s ease;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
}

.avatar-wrapper:hover .profile-pic-overlay {
    opacity: 1 !important;
}

.verified-badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.profile-field-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
}

.merchant-cta-card {
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.8) 0%, rgba(40, 40, 40, 0.4) 100%);
    border: 1px dashed rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Modern Modal styles */
.custom-modal-compact {
    max-width: 580px !important;
}

.x-small {
    font-size: 0.65rem;
    letter-spacing: 2px;
    font-weight: 800;
}

.modal-content.rounded-4 {
    border-radius: 20px !important;
}

.btn.rounded-3 {
    border-radius: 10px !important;
}

.rounded-end-3 {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.rounded-start-3 {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

.form-control-sm,
.input-group-sm>.form-control {
    font-size: 0.85rem;
}


/* Inventory Grid System */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    /* Force 10 columns */
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    min-height: 60vh;
    /* Ensure grid takes up substantial space */
    align-content: start;
    /* Prevent rows from stretching to fill height */
}

.drag-over {
    background: rgba(255, 193, 7, 0.2) !important;
    border: 2px dashed #ffc107 !important;
    transform: scale(1.05);
}

.inventory-slot[draggable="true"] {
    cursor: grab;
}

.inventory-slot[draggable="true"]:active {
    cursor: grabbing;
}

@media (max-width: 1200px) {
    .inventory-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 992px) {
    .inventory-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 576px) {
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Standardized Profile Headers */
.profile-tab-header {
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
}

.profile-tab-subtitle {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75) !important;
    margin-top: 5px;
}

.inventory-slot {
    width: 100%;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Force 1:1 Aspect Ratio even if empty or unsupported browser */
.inventory-slot::before {
    content: "";
    display: block;
    padding-top: 100%;
    /* Force height to match width */
}

/* Ensure content is centered absolutely to not break flow */
.inventory-slot img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}


.inventory-slot.has-item:hover::after {
    content: "";
    position: absolute;
    inset: -5px;
    width: 150%;
    height: 6px;
    background: linear-gradient(90deg,
            transparent 0%,
            #fff 25%,
            #00c0ff 50%,
            #8a2be2 75%,
            transparent 100%);
    /* Using round 12px for a balance of smoothness and original look */
    offset-path: rect(0% 100% 100% 0% round 12px);
    offset-rotate: auto;
    animation: border-run 2s linear infinite;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 0 15px rgba(0, 192, 255, 0.9)) contrast(1.4);
}

.inventory-slot.has-item:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 25px rgba(0, 192, 255, 0.2);
    transform: translateY(-2px);
}

@keyframes border-run {
    from {
        offset-distance: 0%;
    }

    to {
        offset-distance: 100%;
    }
}

.inventory-slot.active {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}


/* Higher specificity to override index.css grid */
.inventory-slot.bg-blueprint-grid {
    background-color: #0d47a1 !important;
    background-image: url('../images/blueprint-bg.png') !important;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: repeat !important;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Premium Tooltip */
.inv-tooltip {
    position: fixed;
    z-index: 9999;
    width: 320px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Top Glow Effect */
.inv-tooltip::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 192, 255, 0.15) 0%, rgba(0, 192, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.inv-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.inv-tooltip-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.inv-tooltip-icon-container {
    width: 60px;
    height: 60px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Auto-Generated Ad Template (Shared with Market) */
.default-ad-template {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #111 0%, #0a0a0a 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 0 40px;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

.inv-tooltip-title {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.inv-tooltip-rarity {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: #fff;
    opacity: 0.8;
}

.inv-tooltip-body {
    padding: 10px 16px;
}

.inv-tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.inv-tooltip-label {
    color: #888;
    font-weight: 500;
}

.inv-tooltip-value {
    color: #fff;
    font-weight: 500;
}

/* Specific Accent Colors from Image */
.text-item-cyan {
    color: #00c0ff !important;
}

.text-item-green {
    color: #28a745 !important;
}

.text-item-gray {
    color: #888 !important;
}

.inv-tooltip-desc {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.inv-tooltip-footer {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.8rem;
    color: #555;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Maintain uniform rarity text colors and borders */
.inv-tooltip-rarity {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.7);
}

.inv-tooltip.rarity-legendary .inv-tooltip-rarity,
.inv-tooltip.rarity-epic .inv-tooltip-rarity,
.inv-tooltip.rarity-rare .inv-tooltip-rarity,
.inv-tooltip.rarity-uncommon .inv-tooltip-rarity {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 10px;
        gap: 8px;
    }

    .inv-tooltip {
        width: 280px;
    }

    /* Social Connect Tab Styles */
    .hover-bg-opacity-10:hover {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.15) !important;
    }

    .social-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 1.5rem;
    }
}

/* Pink Bundle Background for Inventory/Picker */
.bg-bundle-pink,
.item-picker-card.bg-bundle-pink,
.inventory-slot.bg-bundle-pink {
    background: linear-gradient(rgba(214, 51, 132, 0.2), rgba(121, 40, 202, 0.3)),
        radial-gradient(circle at center, rgba(255, 0, 128, 0.1) 0%, transparent 70%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.15) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.15) 20px),
        #2a0a18 !important;
    background-size: cover, cover, 20px 20px, 20px 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

/* Legendary Background for Inventory/Picker */
.bg-legendary,
.item-picker-card.bg-legendary,
.inventory-slot.bg-legendary {
    background: linear-gradient(rgba(255, 193, 7, 0.2), rgba(255, 140, 0, 0.3)),
        radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.1) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.1) 20px),
        #2a1a05 !important;
    background-size: cover, cover, 20px 20px, 20px 20px !important;
    border: 1px solid rgba(255, 193, 7, 0.5) !important;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

.bg-bundle-pink .item-picker-rarity {
    color: #fff !important;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Hide standard number input spinners for perfect centering */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* --- Nexus Bar Core Styles --- */
.nexus-bar {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50px !important;
    padding: 4px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    /* Force single line for the slider logic */
    position: relative !important;
    width: 100% !important;
    max-width: 600px !important;
    /* Adjusted for 7 icons (Coins added) */
    margin: 0 auto 25px auto !important;
    user-select: none !important;
    z-index: 5 !important;
}

.nexus-mode-indicator {
    position: absolute !important;
    top: 4px !important;
    left: 4px;
    height: calc(100% - 8px) !important;
    width: 0;
    /* JS will set width dynamically */
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50px !important;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
    z-index: 1 !important;
}

.nexus-btn {
    flex: 1 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.4) !important;
    padding: 12px 0 !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    z-index: 2 !important;
    transition: all 0.3s !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nexus-btn:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.25rem !important;
    /* Slight zoom on hover */
}

.nexus-btn.active {
    color: #fff !important;
}

/* Mode Specific States - Using sibling selector for indicator */
.nexus-btn[data-mode="trade"].active~.nexus-mode-indicator {
    background: #ffc107 !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.5) !important;
}

.nexus-btn[data-mode="sell"].active~.nexus-mode-indicator {
    background: #198754 !important;
    box-shadow: 0 0 15px rgba(25, 135, 84, 0.5) !important;
}

.nexus-btn[data-mode="buy"].active~.nexus-mode-indicator {
    background: #0dcaf0 !important;
    box-shadow: 0 0 15px rgba(13, 202, 240, 0.5) !important;
}

.nexus-btn[data-mode="bundle_trade"].active~.nexus-mode-indicator {
    background: #fd7e14 !important;
    box-shadow: 0 0 15px rgba(253, 126, 20, 0.5) !important;
}

.nexus-btn[data-mode="bundle_sell"].active~.nexus-mode-indicator {
    background: #d63384 !important;
    box-shadow: 0 0 15px rgba(214, 51, 132, 0.5) !important;
}

.nexus-btn[data-mode="bundle_buy"].active~.nexus-mode-indicator {
    background: #6f42c1 !important;
    box-shadow: 0 0 15px rgba(111, 66, 193, 0.5) !important;
}

.nexus-btn[data-mode="coins"].active~.nexus-mode-indicator {
    background: #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
}

.nexus-mode-label {
    text-align: center !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin-bottom: 12px !important;
    transition: all 0.3s ease !important;
    display: block !important;
}

#priceInput,
#editPriceInput {
    text-align: center !important;
    font-size: 1rem !important;
    padding-right: 40px !important;
    /* Offset the ฿ symbol width to truly center the number */
}

/* Hide spin buttons for price input */
#priceInput::-webkit-outer-spin-button,
#priceInput::-webkit-inner-spin-button,
#editPriceInput::-webkit-outer-spin-button,
#editPriceInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#priceInput {
    -moz-appearance: textfield;
    appearance: none;
}

#editPriceInput {
    -moz-appearance: textfield;
    appearance: none;
}