/* css/shop-event.css - Traveling merchant overlay styles */

.shop-event-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5500;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Arial, sans-serif;
    animation: shopFadeIn 0.5s ease-out;
}

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

.shop-event-panel {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: linear-gradient(135deg, #2c1810 0%, #1a1a2e 50%, #16213e 100%);
    border: 2px solid #d4a574;
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(212, 165, 116, 0.3);
}

.shop-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shop-event-merchant-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-event-icon {
    font-size: 28px;
}

.shop-event-name {
    font-size: 18px;
    font-weight: bold;
    color: #d4a574;
    text-shadow: 0 0 8px rgba(212, 165, 116, 0.5);
}

.shop-event-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.shop-event-close:hover {
    color: #fff;
}

.shop-event-greeting {
    font-size: 14px;
    color: #aaa;
    font-style: italic;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

.shop-event-coins {
    font-size: 14px;
    color: #FFD700;
    text-align: right;
    margin-bottom: 12px;
}

.shop-event-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.shop-event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.shop-event-item:hover {
    border-color: #d4a574;
}

.shop-event-item-icon {
    font-size: 24px;
    min-width: 32px;
    text-align: center;
}

.shop-event-item-details {
    flex: 1;
}

.shop-event-item-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.shop-event-item-desc {
    font-size: 11px;
    color: #888;
}

.shop-event-item-price {
    font-size: 13px;
    color: #FFD700;
    white-space: nowrap;
}

.shop-event-buy-btn {
    padding: 6px 14px;
    background: rgba(212, 165, 116, 0.2);
    border: 1px solid #d4a574;
    border-radius: 6px;
    color: #d4a574;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-event-buy-btn:hover:not(.cant-afford) {
    background: rgba(212, 165, 116, 0.4);
}

.shop-event-buy-btn.cant-afford {
    opacity: 0.4;
    cursor: not-allowed;
}

.shop-event-leave {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(100, 100, 100, 0.2);
    border: 1px solid #666;
    border-radius: 8px;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-event-leave:hover {
    background: rgba(100, 100, 100, 0.4);
    color: #fff;
}

/* --- Merchant Icon (floating button on idle screen) --- */

.shop-merchant-icon {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 5000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #d4a574;
    background: rgba(30, 20, 10, 0.9);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: merchantBob 2s ease-in-out infinite, merchantGlow 2s ease-in-out infinite;
    transition: transform 0.2s;
}

.shop-merchant-icon:hover {
    transform: scale(1.15);
}

@keyframes merchantBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes merchantGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 165, 116, 0.3), 0 0 20px rgba(212, 165, 116, 0.1); }
    50% { box-shadow: 0 0 18px rgba(212, 165, 116, 0.6), 0 0 36px rgba(212, 165, 116, 0.25); }
}

/* --- Biome Transition Overlay --- */

.shop-biome-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 5400;
    transition: background 0.5s ease-out, opacity 0.5s ease-out;
    pointer-events: auto;
}

.shop-biome-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    animation: biomeBgFadeIn 0.6s ease-out forwards;
    overflow: hidden;
}

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

.shop-biome-greeting {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.shop-biome-merchant-name {
    font-size: 24px;
    font-weight: bold;
    color: #d4a574;
    text-shadow: 0 0 12px rgba(212, 165, 116, 0.6);
    margin-bottom: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.shop-biome-merchant-text {
    font-size: 16px;
    color: #ccc;
    font-style: italic;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 24px;
}

/* Biome slide-up for shop panel */
.shop-biome-slide-up {
    animation: biomeSlideUp 0.5s ease-out forwards;
}

.shop-biome-slide-down {
    animation: biomeSlideDown 0.3s ease-in forwards;
}

@keyframes biomeSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes biomeSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* --- Biome Decorations --- */

/* Quartermaster: diagonal stripes */
.shop-biome-stripes {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255, 255, 255, 0.03) 20px,
        rgba(255, 255, 255, 0.03) 40px
    );
    pointer-events: none;
}

/* Apothecary: floating bubbles */
.shop-biome-bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: rgba(180, 100, 255, 0.15);
    border: 1px solid rgba(180, 100, 255, 0.2);
    animation: biomeBubble 4s ease-in infinite;
    pointer-events: none;
}

@keyframes biomeBubble {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* Collector: sparkle dots */
.shop-biome-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #FFD700;
    animation: biomeSparkle 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes biomeSparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* Wanderer: twinkling stars */
.shop-biome-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    animation: biomeStar 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes biomeStar {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Mobile */
@media (max-width: 768px) {
    .shop-event-panel {
        width: 95%;
        padding: 14px;
        max-height: 85vh;
    }

    .shop-event-item {
        padding: 8px;
    }

    .shop-event-item-name {
        font-size: 13px;
    }

    .shop-merchant-icon {
        bottom: 60px;
        right: 14px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .shop-biome-merchant-name {
        font-size: 20px;
    }

    .shop-biome-merchant-text {
        font-size: 14px;
    }
}
