body {
    background-color: #050606;
    font-family: 'Inter', sans-serif;
    color: #cbd5e1;
}

/* Ambient Live Background */
#ambient-bg {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-image: url('./assets/bg1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -3;
    /* Убрана тяжелая анимация для оптимизации производительности на телефонах */
}

#ambient-vignette {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Soft dimming gradient + intense vignette at edges */
    background: radial-gradient(circle at center, transparent 10%, rgba(10, 11, 12, 0.98) 100%),
                linear-gradient(rgba(18, 19, 20, 0.65), rgba(18, 19, 20, 0.85));
    z-index: -2;
    pointer-events: none;
}

@keyframes ambientPan {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(-1%, -1%); }
    100% { transform: scale(1) translate(1%, 1%); }
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f1011; 
}
::-webkit-scrollbar-thumb {
    background: #2a2c2e; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e1c17b; 
}

/* Trader Grid Cards */
.trader-grid-card {
    background: rgba(22, 24, 26, 0.85); /* Сделали более непрозрачным взамен блюра */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.trader-grid-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top, rgba(225, 193, 123, 0.15) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.trader-grid-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(225, 193, 123, 0.15);
    border-color: rgba(225, 193, 123, 0.4);
    background: rgba(28, 30, 32, 0.7);
}

.trader-grid-card:hover::before {
    opacity: 1;
}

/* Trader Profile Pics */
.trader-portrait {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #000;
    border: 2px solid #3a3b3c;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 2;
}

.trader-grid-card:hover .trader-portrait {
    border-color: #e1c17b;
    box-shadow: 0 0 15px rgba(225, 193, 123, 0.5);
    transform: scale(1.05);
}

.trader-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Utility to hide ugly scrollbar in modal but allow scrolling */
.hidden-scroll {
    scrollbar-width: thin;
    scrollbar-color: #3a3b3c transparent;
}
.hidden-scroll::-webkit-scrollbar {
    width: 4px;
}
.hidden-scroll::-webkit-scrollbar-thumb {
    background-color: #3a3b3c;
    border-radius: 4px;
}

}

/* Collector Stash Accordion */
#collector-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
}
#collector-stash-box.open #collector-content {
    max-height: 3000px;
    opacity: 1;
    transition: max-height 0.6s ease-in-out, opacity 0.6s ease;
}
#collector-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#collector-stash-box.open #collector-chevron {
    transform: rotate(180deg);
}

/* Custom Quest Checkboxes */
.quest-item {
    cursor: pointer;
    background: transparent;
    transition: background-color 0.15s ease;
}
.quest-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: #121314;
    margin: 0;
    width: 1.4em;
    height: 1.4em;
    border: 1.5px solid #4a4b4c;
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 1px;
}

.custom-checkbox::before {
    content: "";
    width: 0.8em;
    height: 0.8em;
    transform: scale(0);
    transition: 0.15s transform cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 1em 1em #121314; /* Checkmark color (dark to pop against Gold) */
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
    border-color: #e1c17b;
    background-color: #e1c17b;
}
.custom-checkbox:checked::before {
    transform: scale(1);
}

.quest-label {
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration-thickness: 1.5px;
    text-decoration-color: transparent;
}
.custom-checkbox:checked + .quest-label {
    color: #5a5b5c;
    text-decoration: line-through;
    text-decoration-color: #e1c17b;
}

/* Collector Grid (Container style) */
.item-card {
    position: relative;
    padding-top: 100%; /* Square responsive grid */
    background: radial-gradient(circle at center, rgba(30,30,30,1) 0%, rgba(10,10,10,1) 100%);
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

/* Simulate Tarkov inventory slots */
.item-card::after {
    content: "";
    position: absolute;
    top: 2px; bottom: 2px; left: 2px; right: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.item-card:hover {
    border-color: #666;
    background: radial-gradient(circle at center, rgba(40,40,40,1) 0%, rgba(15,15,15,1) 100%);
}

.item-card img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(2px 4px 6px black);
}

/* Mark item as collected */
.item-card.collected {
    border-color: #8b994d;
    background: rgba(139, 153, 77, 0.15);
}

.item-card.collected img {
    opacity: 0.6;
}

.item-checkmark {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #8b994d;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: -2px -2px 8px rgba(0,0,0,0.5);
    z-index: 5;
}

.item-card.collected .item-checkmark {
    opacity: 1;
    transform: scale(1) translate(-8px, -8px);
}

/* Name tooltip inside the slot */
.tooltip-name {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: rgba(0,0,0,0.85);
    color: #ccc;
    font-size: 9px;
    padding: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 4;
}

.item-card:hover .tooltip-name {
    opacity: 1;
}

/* Info Button */
.info-btn {
    opacity: 0.5;
    transition: opacity 0.2s ease, fill 0.2s ease;
}
.quest-item:hover .info-btn {
    opacity: 0.8;
}
.info-btn:hover {
    opacity: 1 !important;
}

/* Modal states */
/* Modal states */
#quest-modal.show, #trader-quests-modal.show, #collector-modal.show, #hideout-modal.show, #active-map-modal.show, #privacy-modal.show {
    opacity: 1;
    pointer-events: auto;
}
#quest-modal.show > div, #trader-quests-modal.show > div, #collector-modal.show > div, #hideout-modal.show > div, #active-map-modal.show > div, #privacy-modal.show > div {
    transform: scale(1);
}

/* Custom Toggle Switch for 'Hide Completed' */
#hide-completed-cb:checked ~ .dot {
    transform: translateX(100%);
    background-color: #e1c17b;
}
#hide-completed-cb:checked ~ .block {
    border-color: #e1c17b;
}

/* Hide Completed Logic */
.hide-completed-mode .quest-item:has(.custom-checkbox:checked) {
    display: none !important;
}

/* Hideout Dynamic Colors */
.hideout-grid-card {
    transition: all 0.3s ease;
}
.hideout-grid-card:hover {
    border-color: var(--card-accent, #5bc0be) !important;
}
.hideout-grid-card .glow-bg {
    background-color: rgba(var(--card-accent-rgb, 91, 192, 190), 0.05);
}
.hideout-grid-card:hover .icon-container {
    box-shadow: 0 0 15px rgba(var(--card-accent-rgb, 91, 192, 190), 0.4) !important;
}
.hideout-grid-card:hover .station-name {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(var(--card-accent-rgb, 91, 192, 190), 0.6);
}
.hideout-grid-card .prog-text {
    color: var(--card-accent, #5bc0be) !important;
}
.hideout-grid-card.is-complete {
    border-color: var(--card-accent, #5bc0be) !important;
}
.hideout-grid-card .complete-icon {
    color: var(--card-accent, #5bc0be) !important;
}
