/* Shop Module Styles - Premium Overhaul */
#modal-shop .modal-content {
    width: 950px;
    max-width: 95vw;
    height: 85vh;
    display: flex !important;
    /* OVERRIDE modals_fix.css block override */
    flex-direction: column;
    padding: 0;
    overflow: hidden;

    /* Premium Border & Background */
    border: 1px solid var(--neon-gold);
    border-radius: var(--border-radius);
    background: radial-gradient(circle at center, #1a1a2e 0%, #16213e 100%);
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(255, 215, 0, 0.2),
        inset 0 0 100px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

/* Header */
.shop-header {
    height: 80px;
    background: rgba(20, 20, 25, 0.6);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
    box-sizing: border-box;
}

.shop-title {
    font-family: 'Press Start 2P', cursive;
    color: var(--neon-gold);
    font-size: 1.8rem;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.5),
        2px 2px 0 #000;
    margin: 0;
    text-align: center;
    flex: 1;
    letter-spacing: 2px;
}

.shop-title-group {
    flex: 1;
    text-align: center;
}

.shop-refresh-time {
    margin-top: 8px;
    color: #bdb7a5;
    font: 600 0.72rem/1.2 'Inter', sans-serif;
    letter-spacing: 0.04em;
}



/* Body */
.shop-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Subtle texture overlay */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Interface */
.shop-interface {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    padding: 30px;
    gap: 30px;
    min-width: 0;
    min-height: 0;
}

/* Panels */
.shop-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.shop-panel:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.shop-panel-header {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    padding: 15px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 1px;
}

/* Grid */
.shop-item-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    grid-auto-rows: 70px;
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
}

/* Item Slots */
.shop-item-slot {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.shop-item-slot:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 215, 0, 0.2);
}

.shop-item-slot.selected {
    border-color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.1);
    box-shadow:
        0 0 15px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
    z-index: 2;
}

.shop-item-slot:focus-visible {
    outline: 2px solid var(--neon-gold);
    outline-offset: 3px;
}

.shop-item-slot.skill-book {
    border-color: rgba(126, 211, 255, 0.65);
}

.shop-book-classes {
    position: absolute;
    right: 2px;
    bottom: 2px;
    left: 2px;
    overflow: hidden;
    padding: 2px 3px;
    color: #d9f3ff;
    background: rgba(5, 12, 20, 0.9);
    border-radius: 3px;
    font: 700 0.46rem/1.15 'Inter', sans-serif;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-item-icon {
    width: 52px;
    height: 52px;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}

.shop-item-slot:hover .shop-item-icon {
    transform: scale(1.1);
}

/* Price Tag */
.shop-item-price-tag {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #1a1a1a;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 5;
    font-family: 'Press Start 2P', monospace;
}

/* Transaction Area */
.shop-transaction-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 0 1 180px;
    min-width: 100px;
}

.transaction-arrow {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Button */
.btn-shop-action {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #3e2723;
    border: none;
    padding: 18px 24px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    box-shadow:
        0 4px 0 #b8860b,
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.2s;
    width: 100%;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-shop-action:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 0 #b8860b,
        0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.6);
    filter: brightness(1.1);
}

.btn-shop-action:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #b8860b,
        0 5px 10px rgba(0, 0, 0, 0.3);
}

.btn-shop-action:disabled {
    cursor: wait;
    filter: grayscale(0.45);
    opacity: 0.7;
}

/* Shine effect */
.btn-shop-action::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.btn-shop-action:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(50%, 50%);
    transition: 0.5s;
}

/* Footer */
.shop-footer {
    background: rgba(20, 20, 25, 0.8);
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    gap: 20px;
    backdrop-filter: blur(5px);
}

/* Footer Tabs */
.shop-tabs {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.shop-tab-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.shop-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.shop-tab-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(100, 108, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Gold Display - Premium */
.shop-gold-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(40, 40, 30, 0.8));
    padding: 10px 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 215, 0, 0.1);
    min-width: 140px;
    justify-content: flex-end;
}

.shop-gold-display .coin-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
    animation: goldGlow 3s infinite alternate;
}

@keyframes goldGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.4));
        transform: scale(1);
    }

    to {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
        transform: scale(1.1);
    }
}

#shop-gold-display {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.transaction-summary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.transaction-total {
    font-family: 'Press Start 2P', cursive;
    color: #aaa;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.transaction-total span {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@media (max-width: 720px) {
    #modal-shop .modal-content {
        width: calc(100vw - 16px);
        max-width: none;
        height: min(88dvh, 760px);
    }

    .shop-header {
        height: 68px;
        padding: 0 12px;
    }

    .shop-title {
        font-size: 1.35rem;
    }

    .shop-interface {
        display: grid;
        grid-template-areas:
            "source selected"
            "action action";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 16px;
    }

    .shop-panel:first-child {
        grid-area: source;
    }

    .shop-panel:last-child {
        grid-area: selected;
    }

    .shop-transaction-area {
        grid-area: action;
        flex-direction: row;
        width: auto;
        min-width: 0;
        min-height: 52px;
        gap: 12px;
    }

    .transaction-arrow {
        margin: 0;
        font-size: 1.5rem;
    }

    .btn-shop-action {
        width: min(260px, 100%);
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.7rem;
    }

    .shop-panel-header {
        padding: 12px 6px;
        font-size: 0.65rem;
    }

    .shop-item-grid {
        grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
        grid-auto-rows: 58px;
        gap: 10px;
        padding: 12px;
    }

    .shop-item-slot {
        width: 58px;
        height: 58px;
        min-width: 44px;
        min-height: 44px;
    }

    .shop-item-icon {
        width: 44px;
        height: 44px;
    }

    .shop-footer {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }

    .shop-tabs {
        gap: 6px;
    }

    .shop-tab-btn {
        min-height: 44px;
        padding: 9px 12px;
        font-size: 0.68rem;
    }

    .transaction-summary {
        margin-left: auto;
    }

    .transaction-total {
        padding: 8px 10px;
        font-size: 0.72rem;
    }

    .shop-gold-display {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 8px 12px;
    }
}
