/**
 * D&D AI RPG - Shop/Trading System Styles
 * Merchant UI, buy/sell tabs, and item displays
 */

/* Shop Panel Overlay */
.shop-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shop-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #f39c12;
    border-radius: 15px;
    max-width: 850px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Shop Header */
.shop-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.shop-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.shop-icon {
    font-size: 32px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 10px;
}

.shop-title h2 {
    margin: 0;
    color: #1a1a2e;
    font-size: 20px;
}

.merchant-name {
    margin: 0;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
}

.player-gold {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.gold-icon {
    font-size: 20px;
}

.gold-amount {
    font-size: 18px;
    font-weight: bold;
    color: #1a1a2e;
}

.shop-header .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #1a1a2e;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

/* Shop Tabs */
.shop-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px 0;
}

.shop-tab {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px 8px 0 0;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.shop-tab.active {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
}

/* Shop Body */
.shop-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
}

.shop-tab-content {
    display: none;
}

.shop-tab-content.active {
    display: block;
}

/* Shop Category */
.shop-category {
    margin-bottom: 25px;
}

.shop-category h3 {
    color: #f39c12;
    font-size: 15px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(243, 156, 18, 0.3);
}

/* Shop Items */
.shop-items,
.sell-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s;
}

.shop-item:hover {
    border-color: rgba(243, 156, 18, 0.5);
    background: rgba(243, 156, 18, 0.1);
}

.shop-item.unavailable {
    opacity: 0.5;
}

.shop-item .item-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shop-item .item-info {
    flex: 1;
    min-width: 0;
}

.shop-item .item-name {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 3px;
}

.shop-item .item-desc {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.shop-item .item-stat {
    font-size: 11px;
    color: #3498db;
}

.shop-item .item-price {
    text-align: right;
    min-width: 80px;
}

.shop-item .item-price span {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #f1c40f;
}

.shop-item .item-price .expensive {
    color: #e74c3c;
}

.shop-item .item-price .stock {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: normal;
}

.shop-item .item-price .sell-value {
    color: #2ecc71;
}

/* Buy/Sell Buttons */
.buy-btn,
.sell-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 80px;
}

.buy-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #1a1a2e;
}

.buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.buy-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

.sell-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
}

.sell-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Empty States */
.empty-shop,
.empty-inventory {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Shop Notification */
.shop-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.95) 0%, rgba(230, 126, 34, 0.95) 100%);
    border: 3px solid #f39c12;
    border-radius: 12px;
    padding: 15px 25px;
    color: #1a1a2e;
    z-index: 5000;
    animation: shopNotify 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(243, 156, 18, 0.4);
    font-weight: 500;
}

@keyframes shopNotify {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.shop-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
}

.shop-notification span {
    font-size: 20px;
}

/* Rarity Colors */
.rarity-uncommon .item-name { color: #2ecc71; }
.rarity-rare .item-name { color: #3498db; }
.rarity-epic .item-name { color: #9b59b6; }
.rarity-legendary .item-name { color: #f39c12; }

/* Quick Action Buttons (in game) */
.shop-quick-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-quick-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .shop-content {
        max-width: 98%;
        max-height: 95vh;
    }

    .shop-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .shop-title {
        width: 100%;
    }

    .shop-item {
        flex-wrap: wrap;
    }

    .shop-item .item-info {
        flex: 1 1 100%;
        order: 2;
    }

    .shop-item .item-icon {
        order: 1;
    }

    .shop-item .item-price {
        order: 3;
        text-align: left;
    }

    .buy-btn,
    .sell-btn {
        order: 4;
        flex: 1;
    }

    .shop-tabs {
        justify-content: center;
    }

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