* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f0f8ff;
    color: #333;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 5px 5px 0 0;
}

header h1 {
    margin-bottom: 10px;
}

.resources {
    display: flex;
    justify-content: space-between;
    background-color: #34495e;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.resource {
    font-size: 1.2rem;
    font-weight: bold;
}

main {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.game-area {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.clicker-area {
    text-align: center;
    margin-bottom: 30px;
}

#main-clicker {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#main-clicker:hover {
    background-color: #2980b9;
}

#main-clicker:active {
    transform: scale(0.98);
}

#click-feedback {
    position: relative;
    height: 40px;
    margin-top: 10px;
    font-size: 1.2rem;
    color: #27ae60;
    overflow: hidden;
}

.click-feedback-item {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(39, 174, 96, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    animation: float-up 1.5s ease-out;
    pointer-events: none;
}

@keyframes float-up {
    0% {
        opacity: 1;
        top: 100%;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        top: 0;
    }
}

.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background-color: #f8f9fa;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.tab-button:hover {
    background-color: #e9ecef;
}

.tab-button.active {
    background-color: #3498db;
    color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.building-list, .staff-list, .upgrade-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.building-item, .staff-item, .upgrade-item {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    transition: transform 0.2s, background-color 0.2s, opacity 0.2s;
}

/* Apply hover effects only to non-purchased items */
.building-item:hover, 
.staff-item:hover, 
.upgrade-item:not(.purchased):hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.building-name, .staff-name, .upgrade-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.building-cost, .staff-cost, .upgrade-cost {
    color: #e74c3c;
    margin-bottom: 10px;
}

.building-description, .staff-description, .upgrade-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.buy-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
}

.buy-button:hover:not(:disabled) {
    background-color: #27ae60;
    transform: translateY(-2px);
}

.buy-button:active:not(:disabled) {
    transform: translateY(0);
}

.buy-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.notifications {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow-y: auto;
}

.notifications h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.notification {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 3px;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
}

.notification.success {
    border-left-color: #2ecc71;
}

.notification.warning {
    border-left-color: #f39c12;
}

.notification.error {
    border-left-color: #e74c3c;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .resources {
        flex-direction: column;
        gap: 10px;
    }
    
    .building-list, .staff-list, .upgrade-list {
        grid-template-columns: 1fr;
    }
}
/* Tab Badges */
.tab-button {
    position: relative; /* Needed for absolute positioning of badge */
}

.badge {
    display: none; /* Hidden by default */
    position: absolute;
    top: 2px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    border: 1px solid white;
}

.badge.visible {
    display: block; /* Show when visible class is added */
}

/* ---- Style for purchased upgrades ---- */
.upgrade-item.purchased {
    opacity: 0.6; /* Make it slightly transparent */
    background-color: #e9ecef; /* Lighter background */
    border-color: #ced4da; /* Lighter border */
}

/* Remove hover transform/shadow effect from purchased items */
.upgrade-item.purchased:hover {
    transform: none; 
    box-shadow: none; 
}

/* Style the button within a purchased upgrade item */
.upgrade-item.purchased .buy-button {
    background-color: #6c757d; /* Grey out the button */
    color: white;
    cursor: not-allowed;
    border: none; /* Ensure no border overrides */
}

/* Prevent hover effects on the disabled button */
.upgrade-item.purchased .buy-button:hover {
    background-color: #6c757d; /* Keep hover color the same as disabled */
    transform: none;
}
/* ---- End purchased upgrade styles ---- */

/* Locked item styling */
.building-item.locked,
.staff-item.locked,
.upgrade-item.locked {
    opacity: 0.6;
    border-left: 3px solid #ccc; /* Add a visual cue */
}

.building-item.locked .building-name span,
.staff-item.locked .staff-name span,
.upgrade-item.locked .upgrade-name span {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

/* Level Unlocks List Styling */
#level-unlocks-list {
    margin-top: 20px; /* Add space above the list */
    padding: 10px;
    background-color: #f8f9fa; /* Match stat item background */
    border: 1px solid #ddd;    /* Match stat item border */
    border-radius: 5px;
}

#level-unlocks-list h3 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee; /* Lighter border for heading */
    font-size: 1.1em;
}

#level-unlocks-list ul {
    list-style: disc; /* Use standard bullets */
    padding-left: 25px; /* Indent list items */
}

#level-unlocks-list li {
    margin-bottom: 5px; /* Space out list items */
}

/* Refined Locked Item Styling */
.building-item.locked,
.staff-item.locked,
.upgrade-item.locked {
    opacity: 0.65; /* Slightly less transparent */
    background-color: #f0f0f0; /* Add a light grey background */
    border-left: 3px solid #aaa; /* Darker grey border */
}

/* Keep lock text relatively small and grey */
.building-item.locked .building-name span,
.staff-item.locked .staff-name span,
.upgrade-item.locked .upgrade-name span {
    font-size: 0.8em;
    font-weight: normal; /* Don't bold the lock text */
    color: #555;
    margin-left: 8px;
}

/* Stats Tab Button Styling */
.stats-container {
    /* Ensure it remains a grid */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center; /* Vertically align items in the grid */
}

.stat-button-container {
    /* Override default stat padding/border if needed, or just align */
    padding: 0; 
    border: none;
    background-color: transparent;
    display: flex; /* Use flexbox for alignment within the cell */
    justify-content: flex-start; /* Align button to the start */
    align-items: center; /* Center button vertically */
}

.button-reset {
    /* Base styles similar to .buy-button */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 0.9em; /* Slightly smaller than buy buttons maybe */
    
    /* Specific reset button color (e.g., warning/danger) */
    background-color: #e74c3c; /* Red */
    width: auto; /* Allow button to size to content */
}

.button-reset:hover {
    background-color: #c0392b; /* Darker red */
    transform: translateY(-2px);
}

.button-reset:active {
    transform: translateY(0);
}
