/* ── Hack Shack Store ── */

.hackshack-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a2e;
    color: #ccc;
    font-size: 12px;
}

/* ── Header ── */

.hackshack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(180deg, #1e1e36, #16162a);
    border-bottom: 1px solid #2a2a44;
    flex-shrink: 0;
}

.hackshack-title {
    font-size: 16px;
    font-weight: 700;
    color: #4caf50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.hackshack-wallet {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 11px;
}

.hackshack-wallet-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s;
}

.hackshack-wallet-chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hackshack-wallet-label {
    color: #888;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hackshack-wallet-val {
    color: #e0e0e0;
    font-weight: 600;
}

.hackshack-wallet-chip.hc .hackshack-wallet-val { color: #4caf50; }
.hackshack-wallet-chip.dc .hackshack-wallet-val { color: #ab47bc; }
.hackshack-wallet-chip.bc .hackshack-wallet-val { color: #ff9800; }

/* Flash animation for wallet on purchase */
.hackshack-wallet-chip.spent {
    animation: hackshack-spend 0.4s ease-out;
}

@keyframes hackshack-spend {
    0%   { background: rgba(255, 82, 82, 0.3); }
    100% { background: rgba(255, 255, 255, 0.05); }
}

/* ── Section Tabs (Hack Shack / Dark Web) ── */

.hackshack-tabs {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #2a2a44;
    flex-shrink: 0;
}

.hackshack-section-tabs {
    display: flex;
    background: #16162a;
    gap: 2px;
    padding: 0 8px;
}

.hackshack-section-tab {
    padding: 7px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-weight: 500;
}

.hackshack-section-tab:hover:not(.locked) {
    color: #ddd;
}

.hackshack-section-tab.active {
    border-bottom-color: #4caf50;
    color: #fff;
}

.hackshack-section-tab.locked {
    color: #555;
    cursor: not-allowed;
}

.hackshack-section-tab.locked:hover {
    color: #666;
}

/* Dark Web active tab gets spooky colors */
.hackshack-section-tab.active[data-section="dark_web"] {
    border-bottom-color: #ab47bc;
    color: #ce93d8;
}

/* ── Category Tabs ── */

.hackshack-cat-tabs {
    display: flex;
    background: #1c1c32;
    padding: 0 8px;
    gap: 2px;
}

.hackshack-tab {
    padding: 5px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.hackshack-tab:hover {
    color: #ccc;
}

.hackshack-tab.active {
    border-bottom-color: #4fc3f7;
    color: #fff;
}

/* Dark Web mode category tabs */
.hackshack-app.dark-web-mode .hackshack-tab.active {
    border-bottom-color: #ab47bc;
}

/* ── Items Grid ── */

.hackshack-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    align-content: start;
}

/* ── Item Card ── */

.hackshack-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a2a44;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.hackshack-item:hover {
    border-color: #3a3a5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hackshack-item.owned {
    opacity: 0.55;
    border-color: #2a2a3a;
}

.hackshack-item.owned:hover {
    transform: none;
    box-shadow: none;
}

/* Tier accent stripe at top of card */
.hackshack-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.hackshack-item[data-tier="0"]::before { background: #78909c; }
.hackshack-item[data-tier="1"]::before { background: #4caf50; }
.hackshack-item[data-tier="2"]::before { background: #2196f3; }
.hackshack-item[data-tier="3"]::before { background: #ab47bc; }
.hackshack-item[data-tier="4"]::before { background: #ff9800; }
.hackshack-item[data-tier="5"]::before { background: #f44336; }

/* Purchase success flash */
.hackshack-item.just-bought {
    animation: hackshack-bought 0.6s ease-out;
}

@keyframes hackshack-bought {
    0%   { border-color: #4caf50; box-shadow: 0 0 20px rgba(76, 175, 80, 0.4); }
    100% { border-color: #2a2a44; box-shadow: none; }
}

/* ── Item Header ── */

.hackshack-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.hackshack-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8e8e8;
    line-height: 1.3;
}

/* ── Tier / Rarity Badge ── */

.hackshack-tier-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.hackshack-tier-badge[data-tier="0"] { background: rgba(120,144,156,0.2); color: #b0bec5; }
.hackshack-tier-badge[data-tier="1"] { background: rgba(76,175,80,0.15); color: #81c784; }
.hackshack-tier-badge[data-tier="2"] { background: rgba(33,150,243,0.15); color: #64b5f6; }
.hackshack-tier-badge[data-tier="3"] { background: rgba(171,71,188,0.15); color: #ce93d8; }
.hackshack-tier-badge[data-tier="4"] { background: rgba(255,152,0,0.15); color: #ffb74d; }
.hackshack-tier-badge[data-tier="5"] { background: rgba(244,67,54,0.15); color: #ef9a9a; }

/* ── Level Pips ── */

.hackshack-level-pips {
    display: flex;
    gap: 3px;
    align-items: center;
    margin: 4px 0 2px;
}

.hackshack-level-pips .pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #444;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hackshack-level-pips .pip.filled {
    background: #4caf50;
    border-color: #66bb6a;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
}

.hackshack-level-pips .pip-label {
    font-size: 9px;
    color: #888;
    margin-left: 4px;
}

/* ── Owned Count Badge (consumables) ── */

.hackshack-owned-count {
    font-size: 10px;
    color: #aaa;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 7px;
    border-radius: 3px;
    white-space: nowrap;
}

/* ── "NEW" Badge ── */

.hackshack-new-badge {
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    background: #e53935;
    padding: 1px 5px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: hackshack-new-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes hackshack-new-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* ── Item Description ── */

.hackshack-item-desc {
    color: #999;
    font-size: 11px;
    margin-bottom: 10px;
    line-height: 1.5;
    flex: 1;
}

/* ── Item Footer (price + button) ── */

.hackshack-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hackshack-price {
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
}

.hackshack-price.currency-hc { color: #4caf50; }
.hackshack-price.currency-dc { color: #ab47bc; }
.hackshack-price.currency-bc { color: #ff9800; }

/* ── Buy Button ── */

.hackshack-buy {
    background: #4caf50;
    border: none;
    border-radius: 5px;
    color: #fff;
    padding: 6px 16px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
}

.hackshack-buy:hover:not(.disabled) {
    background: #66bb6a;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.hackshack-buy:active:not(.disabled) {
    transform: scale(0.96);
}

.hackshack-buy.upgrade {
    background: #2196f3;
}

.hackshack-buy.upgrade:hover:not(.disabled) {
    background: #42a5f5;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.hackshack-buy.disabled {
    background: #333;
    color: #666;
    cursor: default;
    border: 1px solid #3a3a3a;
}

.hackshack-buy.disabled.owned-badge {
    background: transparent;
    border: 1px solid #3a3a4a;
    color: #6a6a7a;
    font-style: italic;
}

/* ── Dark Web Mode ── */

.hackshack-app.dark-web-mode {
    background: #14081e;
}

.hackshack-app.dark-web-mode .hackshack-header {
    background: linear-gradient(180deg, #1a0e28, #14081e);
    border-bottom-color: #2a1a3a;
}

.hackshack-app.dark-web-mode .hackshack-title {
    color: #ab47bc;
    text-shadow: 0 0 8px rgba(171, 71, 188, 0.3);
}

.hackshack-app.dark-web-mode .hackshack-item {
    border-color: #2a1a3a;
    background: rgba(171, 71, 188, 0.03);
}

.hackshack-app.dark-web-mode .hackshack-item:hover {
    border-color: #3a2a4a;
}

.hackshack-app.dark-web-mode .hackshack-buy:not(.disabled) {
    background: #7b1fa2;
}

.hackshack-app.dark-web-mode .hackshack-buy:hover:not(.disabled) {
    background: #9c27b0;
    box-shadow: 0 2px 8px rgba(171, 71, 188, 0.3);
}

.hackshack-app.dark-web-mode .hackshack-item.just-bought {
    animation: hackshack-bought-dark 0.6s ease-out;
}

@keyframes hackshack-bought-dark {
    0%   { border-color: #ab47bc; box-shadow: 0 0 20px rgba(171, 71, 188, 0.4); }
    100% { border-color: #2a1a3a; box-shadow: none; }
}

/* ── Empty / Loading States ── */

.hackshack-empty {
    padding: 40px 20px;
    text-align: center;
    color: #555;
    font-style: italic;
    grid-column: 1 / -1;
}

.hackshack-loading {
    padding: 40px 20px;
    text-align: center;
    color: #555;
    grid-column: 1 / -1;
}

/* ── Tooltip ── */

.hackshack-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #222240;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.hackshack-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #3a3a5a;
}

.hackshack-buy:hover .hackshack-tooltip {
    opacity: 1;
}

/* ── Scrollbar ── */

.hackshack-items::-webkit-scrollbar {
    width: 6px;
}

.hackshack-items::-webkit-scrollbar-track {
    background: transparent;
}

.hackshack-items::-webkit-scrollbar-thumb {
    background: #3a3a50;
    border-radius: 3px;
}

.hackshack-items::-webkit-scrollbar-thumb:hover {
    background: #4a4a60;
}

/* ── Item enter animation ── */

.hackshack-item {
    animation: hackshack-card-in 0.2s ease-out both;
}

@keyframes hackshack-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
