/* Reagent Bag UI Styles */

#reagent-bag-button {
    position: absolute;
    bottom: 20px;
    left: 280px; /* Next to character sheet */
    z-index: 100;
    background: linear-gradient(145deg, #8B4513, #A0522D);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #CD853F;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

#reagent-bag-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    border-color: #DAA520;
}

#reagent-bag-button:active {
    transform: scale(0.95);
}

.reagent-bag-icon {
    font-size: 28px;
    color: #DAA520;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.reagent-bag-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B35;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}



/* Reagent Bag Panel - Collapsible */
#reagent-bag-modal {
    position: fixed;
    bottom: 20px;
    right: 320px;
    z-index: 100;
    background-image: linear-gradient(to bottom, rgba(40, 30, 20, 0.9), rgba(20, 15, 10, 0.9));
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #555;
    width: 350px;
    max-height: 950px;
    transition: all 0.3s ease;
    display: block;
}

#reagent-bag-modal.collapsed {
    transform: scale(0.9);
    opacity: 0.9;
    overflow: hidden;
    max-height: 30px;
    padding: 10px 15px;
    width: 200px;
    border-radius: 20px;
    background-image: linear-gradient(to bottom, rgba(60, 45, 30, 0.8), rgba(30, 22, 15, 0.8));
}

.reagent-bag-container {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    max-height: 600px;
}

.reagent-bag-header {
    margin-bottom: 15px;
}

.reagent-bag-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    color: #ddd;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    cursor: pointer;
    user-select: none;
}

#reagent-bag-modal.collapsed .reagent-bag-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#reagent-bag-modal.collapsed .reagent-bag-title::after {
    content: " (Click to open)";
    font-size: 12px;
    font-weight: normal;
    opacity: 0.7;
}

#reagent-bag-modal.collapsed .reagent-bag-content,
#reagent-bag-modal.collapsed .reagent-bag-stats {
    display: none;
}

.reagent-bag-stats {
    color: #AAA;
    font-size: 12px;
    margin-bottom: 10px;
    text-align: center;
}

.reagent-bag-content {
    max-height: 700px;  /* Further increased to show all content including Total Boosts */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Main layout: left detail + right icons */
.reagent-main-area {
    display: flex;
    gap: 15px;
    height: 260px;  /* Slightly more compact to give total boosts more space */
    margin-bottom: 15px;
}

/* Left panel: Selected reagent details */
.reagent-detail-panel {
    flex: 2;
    background: rgba(30, 20, 15, 0.8);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #555;
    overflow: hidden; /* No scrolling - content should fit */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.no-selection {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.no-selection-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Right panel: Icon list */
.reagent-icon-panel {
    flex: 1;
    background: rgba(30, 20, 15, 0.8);
    border-radius: 8px;
    border: 1px solid #555;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.reagent-icon-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #ddd;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #555;
    user-select: none;
}

.reagent-icon-list {
    flex: 1;
    padding: 10px;
    overflow-y: auto; /* Allow scrolling for large collections */
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-content: flex-start;
    max-width: 100%;
    scroll-behavior: smooth;
}

/* Reagent icon item in the grid */
.reagent-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    width: 50px;
    height: 50px;
    position: relative;
    box-sizing: border-box;
}

/* Rarity-based glow effects */
.reagent-icon-item.rarity-1 {
    box-shadow: 0 0 8px rgba(128, 128, 128, 0.4), inset 0 0 8px rgba(128, 128, 128, 0.1);
}

.reagent-icon-item.rarity-2 {
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5), inset 0 0 10px rgba(0, 255, 0, 0.15);
}

.reagent-icon-item.rarity-3 {
    box-shadow: 0 0 12px rgba(0, 128, 255, 0.6), inset 0 0 12px rgba(0, 128, 255, 0.2);
}

.reagent-icon-item.rarity-4 {
    box-shadow: 0 0 14px rgba(128, 0, 255, 0.7), inset 0 0 14px rgba(128, 0, 255, 0.25);
}

.reagent-icon-item.rarity-5 {
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.8), inset 0 0 16px rgba(255, 215, 0, 0.3);
    animation: legendaryPulse 2s ease-in-out infinite alternate;
}

/* Enhanced glow on hover */
.reagent-icon-item.rarity-1:hover {
    box-shadow: 0 0 12px rgba(128, 128, 128, 0.6), inset 0 0 12px rgba(128, 128, 128, 0.2);
}

.reagent-icon-item.rarity-2:hover {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7), inset 0 0 15px rgba(0, 255, 0, 0.25);
}

.reagent-icon-item.rarity-3:hover {
    box-shadow: 0 0 18px rgba(0, 128, 255, 0.8), inset 0 0 18px rgba(0, 128, 255, 0.3);
}

.reagent-icon-item.rarity-4:hover {
    box-shadow: 0 0 20px rgba(128, 0, 255, 0.9), inset 0 0 20px rgba(128, 0, 255, 0.35);
}

.reagent-icon-item.rarity-5:hover {
    box-shadow: 0 0 24px rgba(255, 215, 0, 1.0), inset 0 0 24px rgba(255, 215, 0, 0.4);
}

/* Boost type left-side indicators */
.reagent-icon-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 8px 0 0 8px;
    z-index: 1;
}

.reagent-icon-item.boost-luck::before {
    background: linear-gradient(to bottom, #9932CC, #663399);
}

.reagent-icon-item.boost-overall_yield::before {
    background: linear-gradient(to bottom, #32CD32, #228B22);
}

.reagent-icon-item.boost-strength::before {
    background: linear-gradient(to bottom, #FF4500, #CC3300);
}

.reagent-icon-item.boost-speed::before {
    background: linear-gradient(to bottom, #00BFFF, #0099CC);
}

.reagent-icon-item.boost-gold_yield::before {
    background: linear-gradient(to bottom, #FFD700, #FFA500);
}

.reagent-icon-item.boost-silver_yield::before {
    background: linear-gradient(to bottom, #C0C0C0, #999999);
}

.reagent-icon-item.boost-copper_yield::before {
    background: linear-gradient(to bottom, #CD7F32, #A0522D);
}

/* Legendary pulse animation */
@keyframes legendaryPulse {
    0% {
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.8), inset 0 0 16px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 1.0), inset 0 0 20px rgba(255, 215, 0, 0.4);
    }
}

.reagent-icon-item:hover {
    background: rgba(50, 40, 30, 0.8);
    border-color: #666;
    transform: scale(1.05);
}

.reagent-icon-item.selected {
    background: rgba(60, 45, 30, 0.9);
    border-color: #888;
    transform: scale(1.1);
}

.reagent-icon-item .reagent-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Remove the old info section since we're not showing quantities */
.reagent-icon-item-info {
    display: none;
}

.reagent-icon-item-name {
    display: none;
}

.reagent-icon-item-quantity {
    display: none;
}

/* Tooltip styles */
.reagent-tooltip {
    position: absolute;
    background: rgba(20, 15, 10, 0.95);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 12px;
    z-index: 200;
    pointer-events: none;
    min-width: 200px;
    max-width: 300px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.reagent-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.reagent-tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.reagent-tooltip-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.reagent-tooltip-name {
    color: #DAA520;
    font-size: 14px;
    font-weight: bold;
    flex: 1;
}

.reagent-tooltip-rarity {
    font-size: 12px;
    font-weight: bold;
}

.reagent-tooltip-content {
    color: #CCC;
    font-size: 12px;
    line-height: 1.4;
}

.reagent-tooltip-stat {
    margin-bottom: 4px;
}

.reagent-tooltip-stat:last-child {
    margin-bottom: 0;
}

/* Detail card - Clean list layout */
.reagent-detail-card {
    background: rgba(40, 30, 20, 0.8);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 12px;
    height: fit-content;
}

.reagent-detail-card.rarity-1 { border-left: 4px solid #808080; }
.reagent-detail-card.rarity-2 { border-left: 4px solid #00FF00; }
.reagent-detail-card.rarity-3 { border-left: 4px solid #0080FF; }
.reagent-detail-card.rarity-4 { border-left: 4px solid #8000FF; }
.reagent-detail-card.rarity-5 { border-left: 4px solid #FFD700; }

.reagent-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.reagent-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.reagent-name {
    color: #DAA520;
    font-size: 15px;
    font-weight: bold;
    flex: 1;
}

.reagent-description {
    color: #CCC;
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Clean list layout instead of grid */
.reagent-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.reagent-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.reagent-stat-label {
    color: #AAA;
    font-size: 12px;
    text-transform: none;
    font-weight: normal;
}

.reagent-stat-value {
    color: #FFF;
    font-weight: bold;
    font-size: 12px;
}

.reagent-discovery-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
    font-size: 11px;
}

/* Total boosts section */
.reagent-total-boosts {
    background: rgba(30, 20, 15, 0.8);
    border-radius: 8px;
    border: 1px solid #555;
    overflow: hidden;
    flex: 0 0 auto; /* Don't grow, use content size */
    display: flex;
    flex-direction: column;
    min-height: 100px; /* Compact but visible */
    max-height: 200px; /* Limit height to force scrolling with many items */
}

.total-boosts-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #ddd;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #555;
    user-select: none;
}

.total-boosts-list {
    padding: 10px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1; /* Take all remaining space in the container */
    scroll-behavior: smooth;
    align-content: flex-start; /* Align items to top when wrapping */
    justify-content: flex-start; /* Align items to left */
}

.total-boost-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #ddd;
    border-left: 3px solid #666;
    user-select: none;
    white-space: nowrap; /* Prevent text wrapping */
    flex: 0 0 auto; /* Don't grow or shrink, use natural size */
    max-width: fit-content; /* Only take as much space as needed */
}

.total-boost-item.boost-luck { border-left-color: #9932CC; }
.total-boost-item.boost-overall_yield { border-left-color: #32CD32; }
.total-boost-item.boost-strength { border-left-color: #FF4500; }
.total-boost-item.boost-speed { border-left-color: #00BFFF; }
.total-boost-item.boost-silver_yield { border-left-color: #C0C0C0; }
.total-boost-item.boost-copper_yield { border-left-color: #CD7F32; }

.empty-reagent-bag {
    text-align: center;
    color: #888;
    font-size: 16px;
    padding: 40px 20px;
}

.empty-reagent-bag-icon {
    font-size: 48px;
    color: #555;
    margin-bottom: 15px;
}

/* Reagent Discovery Notification - Simple floating text */
.reagent-discovery {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 69, 19, 0.9);
    border: 2px solid #DAA520;
    border-radius: 8px;
    padding: 10px 15px;
    z-index: 150;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: reagentDiscoveryFloat 3s ease-out forwards;
    font-size: 16px;
    font-weight: bold;
    color: #DAA520;
    text-align: center;
    pointer-events: none;
    min-width: 200px;
    max-width: 300px;
}

@keyframes reagentDiscoveryFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -70%) scale(0.9);
    }
}

.reagent-discovery-header {
    text-align: center;
    margin-bottom: 15px;
}

.reagent-discovery-title {
    color: #DAA520;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 0 5px 0;
}

.reagent-discovery-subtitle {
    color: #DDD;
    font-size: 14px;
    margin: 0;
}

.reagent-discovery-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
}

.reagent-discovery-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.reagent-discovery-details {
    flex: 1;
}

.reagent-discovery-name {
    color: #DAA520;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.reagent-discovery-description {
    color: #CCC;
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
}

.reagent-discovery-close {
    text-align: center;
    margin-top: 10px;
}

.reagent-discovery-close button {
    background: linear-gradient(145deg, #555, #777);
    border: 2px solid #888;
    color: #FFF;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.reagent-discovery-close button:hover {
    background: linear-gradient(145deg, #666, #888);
    border-color: #AAA;
}

/* Scrollbar styling for reagent bag */
.reagent-bag-content::-webkit-scrollbar {
    width: 8px;
}

.reagent-bag-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.reagent-bag-content::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 4px;
}

.reagent-bag-content::-webkit-scrollbar-thumb:hover {
    background: #A0522D;
} 

/* Mobile-specific reagent icon adjustments */
@media (max-width: 768px) {
    /* Mobile reagent icons in horizontal scroller */
    .reagents-scroller .reagent-icon {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        margin: 0 4px;
        position: relative;
        transition: all 0.2s ease;
    }
    
    /* Apply rarity glow effects to mobile reagent icons */
    .reagents-scroller .reagent-icon.rarity-1 {
        box-shadow: 0 0 6px rgba(128, 128, 128, 0.5), inset 0 0 6px rgba(128, 128, 128, 0.15);
    }
    
    .reagents-scroller .reagent-icon.rarity-2 {
        box-shadow: 0 0 8px rgba(0, 255, 0, 0.6), inset 0 0 8px rgba(0, 255, 0, 0.2);
    }
    
    .reagents-scroller .reagent-icon.rarity-3 {
        box-shadow: 0 0 10px rgba(0, 128, 255, 0.7), inset 0 0 10px rgba(0, 128, 255, 0.25);
    }
    
    .reagents-scroller .reagent-icon.rarity-4 {
        box-shadow: 0 0 12px rgba(128, 0, 255, 0.8), inset 0 0 12px rgba(128, 0, 255, 0.3);
    }
    
    .reagents-scroller .reagent-icon.rarity-5 {
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.9), inset 0 0 14px rgba(255, 215, 0, 0.35);
        animation: legendaryPulseMobile 2s ease-in-out infinite alternate;
    }
    
    /* Enhanced mobile hover/tap effects */
    .reagents-scroller .reagent-icon.selected,
    .reagents-scroller .reagent-icon:active {
        transform: scale(1.1);
    }
    
    .reagents-scroller .reagent-icon.rarity-1.selected {
        box-shadow: 0 0 10px rgba(128, 128, 128, 0.7), inset 0 0 10px rgba(128, 128, 128, 0.25);
    }
    
    .reagents-scroller .reagent-icon.rarity-2.selected {
        box-shadow: 0 0 12px rgba(0, 255, 0, 0.8), inset 0 0 12px rgba(0, 255, 0, 0.3);
    }
    
    .reagents-scroller .reagent-icon.rarity-3.selected {
        box-shadow: 0 0 14px rgba(0, 128, 255, 0.9), inset 0 0 14px rgba(0, 128, 255, 0.35);
    }
    
    .reagents-scroller .reagent-icon.rarity-4.selected {
        box-shadow: 0 0 16px rgba(128, 0, 255, 1.0), inset 0 0 16px rgba(128, 0, 255, 0.4);
    }
    
    .reagents-scroller .reagent-icon.rarity-5.selected {
        box-shadow: 0 0 18px rgba(255, 215, 0, 1.1), inset 0 0 18px rgba(255, 215, 0, 0.45);
    }
    
    /* Mobile boost type left-side indicators */
    .reagents-scroller .reagent-icon::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 2px;
        border-radius: 6px 0 0 6px;
        z-index: 1;
    }
    
    .reagents-scroller .reagent-icon.boost-luck::before {
        background: linear-gradient(to bottom, #9932CC, #663399);
    }
    
    .reagents-scroller .reagent-icon.boost-overall_yield::before {
        background: linear-gradient(to bottom, #32CD32, #228B22);
    }
    
    .reagents-scroller .reagent-icon.boost-strength::before {
        background: linear-gradient(to bottom, #FF4500, #CC3300);
    }
    
    .reagents-scroller .reagent-icon.boost-speed::before {
        background: linear-gradient(to bottom, #00BFFF, #0099CC);
    }
    
    .reagents-scroller .reagent-icon.boost-gold_yield::before {
        background: linear-gradient(to bottom, #FFD700, #FFA500);
    }
    
    .reagents-scroller .reagent-icon.boost-silver_yield::before {
        background: linear-gradient(to bottom, #C0C0C0, #999999);
    }
    
    .reagents-scroller .reagent-icon.boost-copper_yield::before {
        background: linear-gradient(to bottom, #CD7F32, #A0522D);
    }
    
    /* Mobile legendary pulse animation (slightly reduced intensity) */
    @keyframes legendaryPulseMobile {
        0% {
            box-shadow: 0 0 14px rgba(255, 215, 0, 0.9), inset 0 0 14px rgba(255, 215, 0, 0.35);
        }
        100% {
            box-shadow: 0 0 16px rgba(255, 215, 0, 1.0), inset 0 0 16px rgba(255, 215, 0, 0.4);
        }
    }
} 