/* --- Global Theme Fix --- */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* This creates that deep "space" depth from your screenshot */
    background-color: #0d1117 !important;
    background-image: radial-gradient(circle at top right, #161b22, #0d1117) !important;
    background-attachment: fixed;
    color: #c9d1d9;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* This targets the "Accessing Pioneer Marketplace..." text specifically */
.loading-text,
.text-muted.mt-3.fw-light {
    color: #ffffff !important; /* Pure white for high contrast */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    opacity: 0.9;
}

/* Specific fix for the report-input textarea */
.report-input {
    background-color: #0d1117 !important; /* Matches your dark space theme */
    color: #ffffff !important; /* Pure white text */
    border: 1px solid #30363d !important; /* Subtle border to define the box */
}

    /* Ensure the placeholder text is also visible but slightly translucent */
    .report-input::placeholder {
        color: rgba(255, 255, 255, 0.4) !important;
        font-style: italic;
    }

    /* Add a tactical green glow when the user clicks into it */
    .report-input:focus {
        background-color: #161b22 !important;
        color: #ffffff !important;
        border-color: #3fb950 !important;
        box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2) !important;
        outline: none;
    }

/* Global override for 'text-muted' to make it readable on dark backgrounds */
.text-muted {
    color: #acbac7 !important; /* Brighter silver/gray instead of dark gray */
}

@media (max-width: 640.98px) {
    /* Hide the default Bootstrap mobile menu button */
    .navbar-toggler {
        display: none !important;
    }

    /* Prevent the sidebar from collapsing into the 'burger' menu */
    .collapse {
        display: block !important;
    }

    /* Make the sidebar a slim icon-only bar on mobile */
    .sidebar {
        width: 70px !important;
        height: 100vh;
        position: fixed;
        z-index: 1000;
    }

    /* Hide text labels in the nav, show only icons */
    .nav-item .nav-link span:not(.bi),
    .navbar-brand {
        display: none !important;
    }

    /* Shift the main content so it doesn't hide behind the fixed sidebar */
    main {
        margin-left: 70px !important;
    }
}

@media (max-width: 480px) {
    /* Force cards to be full width or half width */
    .item-card {
        margin-bottom: 10px !important;
    }

    /* Shrink the text slightly so it fits on one line */
    .price-container div {
        font-size: 0.75rem !important;
    }
}

/* --- ARC Raiders Style Sidebar --- */
.sidebar {
    background-color: #0d1117 !important;
    background-image: none !important; /* Flat dark for that sleek look */
    border-right: 1px solid #21262d;
    width: 280px;
}

.custom-nav-header {
    padding: 1.5rem !important;
    border-bottom: 1px solid #21262d;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.9rem !important;
}

.nav-item {
    padding: 0 12px !important;
}

    .nav-item .nav-link {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem !important;
        color: #8b949e !important;
        font-size: 0.85rem;
        font-weight: 500;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        transition: all 0.1s ease-in-out;
        border-radius: 4px;
        position: relative;
        margin-bottom: 4px;
    }

        /* The "Indicator Bar" on the left of active links */
        .nav-item .nav-link.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 20%;
            height: 60%;
            width: 3px;
            background-color: #3fb950;
            border-radius: 0 2px 2px 0;
            box-shadow: 0 0 10px rgba(63, 185, 80, 0.5);
        }

        .nav-item .nav-link:hover {
            background-color: rgba(139, 148, 158, 0.05) !important;
            color: #f0f6fc !important;
        }

        .nav-item .nav-link.active {
            background-color: rgba(63, 185, 80, 0.08) !important; /* Very subtle green tint */
            color: #3fb950 !important;
        }

        /* Icon alignment fix */
        .nav-item .nav-link i,
        .nav-item .nav-link span.bi {
            font-size: 1.2rem !important;
            width: 32px; /* Fixed width centers icons regardless of shape */
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
        }

        .nav-item .nav-link.active i {
            filter: drop-shadow(0 0 5px rgba(63, 185, 80, 0.4));
        }

/* --- Refined Tactical Inventory --- */

/* Give the search bar a more "HUD" look */
.input-group-text {
    background-color: #0d1117 !important;
    border-color: #30363d !important;
    border-right: none !important;
}

input.form-control {
    border-left: none !important;
    background-color: #0d1117 !important;
    color: white !important;
}

/* Enhanced Card HUD Effect */
.item-card {
    background: linear-gradient(145deg, #161b22, #0d1117) !important;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    border: 1px solid #30363d !important;
}

    .item-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4) !important;
        background: #1c2128 !important;
        border-color: #2ea043 !important; /* Green glow on hover */
    }

/* Make the price/credits more legible */
.price-container div {
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    font-family: 'Courier New', Courier, monospace;
}

/* Glowing text for the Total Value */
.text-warning {
    color: #e3b341 !important;
    text-shadow: 0 0 8px rgba(227, 179, 65, 0.3);
}

/* Badge Tweaks: Modern small pill */
.badge.bg-success {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    background-color: rgba(46, 160, 67, 0.15) !important;
    color: #3fb950 !important;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

/* --- HUD Visibility Fixes --- */

/* Fix for "Stash Value" label visibility */
.text-muted.small {
    color: #8b949e !important; /* Brighter gray for tactical labels */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* Force Search Placeholder to be visible */
input.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
    font-size: 0.85rem;
}

/* Fallback for different browsers */
input.form-control::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

input.form-control::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Enhanced Stash Value Number (The Gold) */
.text-warning {
    color: #e3b341 !important;
    text-shadow: 0 0 10px rgba(227, 179, 65, 0.4);
    font-size: 1rem;
}

/* Fix for the Search Bar focus state */
input.form-control:focus {
    background-color: #161b22 !important;
    box-shadow: 0 0 0 2px rgba(46, 160, 67, 0.4) !important;
    color: #fff !important;
}

/* --- Sidebar Footer Credits Fix --- */
.small-extra {
    font-size: 0.65rem; /* Slightly larger */
    letter-spacing: 1.5px;
    color: #c9d1d9 !important; /* Brighter silver for visibility */
    opacity: 0.8;
    font-family: 'Courier New', Courier, monospace; /* More tactical font */
}

.nav-footer .fw-bold {
    color: #ffffff !important;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2); /* Soft glow */
    letter-spacing: 0.5px;
}

.nav-footer {
    background: rgba(0, 0, 0, 0.4); /* Darker background to pop the text */
    border-top: 1px solid #30363d !important; /* Sharper separator line */
}

/* Darker, more serious red for abandoning matches */
.btn-abandon {
    background-color: #8b0000 !important;
    border-color: #5a0000 !important;
    color: white !important;
}

    .btn-abandon:hover {
        background-color: #a50000 !important;
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.4);
    }
/* Solid cyan glow for when the match is ready */
.status-found {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
    border: 1px solid #0dcaf0;
    box-shadow: 0 0 12px rgba(13, 202, 240, 0.4);
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Keeps the searching pulse active only while searching */
.status-active {
    background: rgba(255, 77, 0, 0.1);
    color: #ff4d00;
    border: 1px solid #ff4d00;
    animation: pulse 2s infinite;
}

/* When not authorized, remove the sidebar spacing */
.auth-layout main {
    margin-left: 0 !important;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Hide the default Blazor sidebar width if it's empty */
.auth-layout .sidebar {
    display: none;
}