/* --- Store Header --- */
#storeTitle {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
}

/* --- Upgrades Container --- */
#upgradesContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 60px; /* Reserve space */
    padding: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 5px;
    margin-bottom: 10px;
}

body.dark-mode #upgradesContainer {
    background: rgba(255,255,255,0.05);
}

.upgrade-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, border-color 0.1s;
}

.upgrade-icon:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    z-index: 10;
}

body.dark-mode .upgrade-icon {
    background: #444;
    border-color: #555;
    color: #eee;
}

.icon-placeholder {
    font-weight: bold;
    font-size: 20px;
    color: #555;
}

/* --- Bulk Buy Section --- */
#bulkBuyContainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: 'Fredoka One', cursive;
}

.buy-sell-toggle {
    color: #fff;
    cursor: pointer;
}

.bulk-options {
    display: flex;
    gap: 10px;
}

.bulk-btn {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.bulk-btn.active, .bulk-btn:hover {
    opacity: 1;
    color: #ffd700;
}

/* --- Shop Items (Buildings) --- */
#shopContainer {
    display: flex;
    flex-direction: column;
    gap: 0; /* No gap, they touch like in the screenshot */
}

.shopButton {
    display: flex;
    align-items: center;
    width: 100%;
    height: 64px;
    background: linear-gradient(to bottom, #eee, #ddd);
    border: 1px solid #bbb;
    border-bottom: 1px solid #999;
    margin: 0; /* Remove margin to stack them */
    padding: 0 10px;
    cursor: pointer;
    position: relative;
    transition: filter 0.1s;
}

.shopButton:hover {
    filter: brightness(1.05);
    z-index: 1; /* Bring to front on hover */
    border-color: #888;
}

.shopButton:active {
    filter: brightness(0.95);
}

body.dark-mode .shopButton {
    background: linear-gradient(to bottom, #444, #333);
    border-color: #222;
}

/* Icon */
.shop-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0; /* Prevent shrinking */
    overflow: hidden; /* Hide overflowing alt text */
}

.shop-icon img {
    max-width: 50px;
    max-height: 50px;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
    font-size: 0; /* Hide alt text if image breaks */
    display: block;
}

/* Info (Name & Cost) */
.shop-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Prevent text overflow */
}

.shop-name {
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    color: #333;
    text-shadow: 1px 1px 0 #fff;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .shop-name {
    color: #eee;
    text-shadow: 1px 1px 0 #000;
}

@media (max-width: 1400px) {
    .shop-name {
        font-size: 18px;
    }
}

.shop-cost {
    font-weight: bold;
    color: #2e7d32; /* Green for cost */
    font-size: 14px;
    margin-top: 2px;
}

body.dark-mode .shop-cost {
    color: #69f0ae;
}

/* Amount (Right Side) */
.shop-amount {
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    color: rgba(0,0,0,0.15);
    margin-left: 10px;
    line-height: 64px;
}

body.dark-mode .shop-amount {
    color: rgba(255,255,255,0.1);
}

/* --- Dark Shop --- */
.dark-shop-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dark-shop-container .shopButton {
    background-color: #333;
    border: 1px solid #444;
    width: 100%; /* Ensure full width in modal */
    cursor: pointer;
    background: linear-gradient(to bottom, #3e3e3e, #2b2b2b);
    border-bottom-color: #1a1a1a;
    border-right-color: #1a1a1a;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.2);
    color: #eee;
}

.dark-shop-container .shopButton:hover {
    background-color: #424242;
    border-color: #ff5252;
    transform: scale(1.02);
    background: linear-gradient(to bottom, #4a4a4a, #333);
}

.dark-shop-container .shopButton #nameAndCost p:first-of-type {
    color: #ff8a80; /* Light Red */
}

.dark-shop-container .shopButton #nameAndCost p:last-of-type {
    color: #ff5252; /* Red */
}

.dark-shop-container .shopButton #amount {
    color: #757575;
}

/* --- Research / Synergies --- */
#researchHeader {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 10px;
}

.researchButton {
    background-color: #e3f2fd; /* Light Blue */
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 10px;
    margin: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: var(--shadow);
}

body.dark-mode .researchButton {
    background-color: #1a237e;
    border-color: #3949ab;
    color: #e8eaf6;
}

.researchButton:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.researchButton:active {
    transform: translateY(0);
}

.researchButton.purchased {
    opacity: 0.6;
    cursor: default;
    border-color: #4caf50;
    background-color: #e8f5e9;
}

body.dark-mode .researchButton.purchased {
    background-color: #1b5e20;
    border-color: #4caf50;
}

/* --- Upgrade Tooltip --- */
.tooltip-card {
    display: none; /* Hidden by default */
    position: fixed;
    right: 31%; /* Just to the left of the 30% store sidebar */
    top: 100px; /* Fixed height near the top */
    width: 300px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    pointer-events: none; /* Let clicks pass through if it gets in the way */
    animation: fadeIn 0.2s ease-out;
}

.tooltip-card h3 {
    margin: 0 0 10px 0;
    color: var(--accent-color);
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.tooltip-card p {
    font-size: 15px;
    line-height: 1.4;
    color: #ddd;
    margin-bottom: 15px;
}

.tooltip-card .tooltip-footer {
    display: flex;
    justify-content: flex-end;
    font-weight: bold;
}

.tooltip-card .cost {
    color: #ff5252; /* Red for cost */
    font-size: 18px;
}

body.dark-mode .tooltip-card {
    background: rgba(30, 30, 30, 0.98);
    border-color: var(--secondary-color);
}
