/* Garden Game v0.4.0 Styles */

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

body {
    font-family: Arial, sans-serif;
    background-color: #87CEEB;
    color: #333;
    padding: 20px;
}

#game-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #2d5016;
    margin-bottom: 20px;
}

h2 {
    color: #3d6526;
    margin-bottom: 10px;
}

h3 {
    color: #4a7c59;
    margin-bottom: 5px;
}

#timer {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 5px;
}

#game-time {
    font-weight: bold;
    font-family: monospace;
}

#game-area {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    flex: 1;
}

#garden-container {
    text-align: center;
    flex: 2;
}

#garden-grid {
    display: grid;
    grid-template-columns: repeat(2, 100px);
    grid-template-rows: repeat(2, 100px);
    gap: 10px;
    margin: 20px auto;
    padding: 20px;
    background-color: #8B4513;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    width: fit-content;
}

.plot {
    width: 100px;
    height: 100px;
    background-color: #654321;
    border: 2px solid #4a3018;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    position: relative;
}

.plot:hover {
    background-color: #7a5230;
    transform: scale(1.05);
}

.plot.planted {
    background-color: #3d6526;
    cursor: default;
    flex-direction: column;
    padding: 10px;
}

.plot.planted:hover {
    transform: scale(1);
}

.plot.ready {
    background-color: #4CAF50;
    cursor: pointer;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.plot.ready:hover {
    transform: scale(1.1);
}

/* Seed buttons */
.seed-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seed-button:hover {
    background-color: #f0f0f0;
    border-color: #3d6526;
}

.seed-button.selected {
    background-color: #3d6526;
    color: white;
    border-color: #2d5016;
}

/* Credits display */
#credits-display {
    margin-top: 20px;
    padding: 10px;
    background-color: #e8f5e9;
    border-radius: 5px;
}

#credits-display p {
    font-size: 18px;
    font-weight: bold;
}

.credit-countdown {
    font-size: 14px !important;
    font-weight: normal !important;
    color: #666;
    margin-top: 5px;
}

/* Inventory */
.inventory-item {
    padding: 8px;
    margin-bottom: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Store section */
#store-section {
    background-color: #f5f5dc;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

#store-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.sell-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sell-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Growth stage colors */
.plot[data-stage="0"] {
    background-color: #4a3c28;
}

.plot[data-stage="1"] {
    background-color: #5d4e37;
}

.plot[data-stage="2"] {
    background-color: #3d6526;
}

.plot[data-stage="3"] {
    background-color: #4CAF50;
}

/* Plant-specific colors */
.plot.tomato[data-stage="0"] {
    background-color: #5c3d3d;
}

.plot.tomato[data-stage="1"] {
    background-color: #7a5252;
}

.plot.tomato[data-stage="2"] {
    background-color: #c65353;
}

.plot.tomato[data-stage="3"] {
    background-color: #ff6347;
}

.plot.corn[data-stage="0"] {
    background-color: #4a4a2e;
}

.plot.corn[data-stage="1"] {
    background-color: #6b6b42;
}

.plot.corn[data-stage="2"] {
    background-color: #8b8b56;
}

.plot.corn[data-stage="3"] {
    background-color: #FFD700;
}

/* Plot content layout */
.stage-label {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.countdown {
    font-size: 14px;
    font-weight: normal;
    color: #FFE4B5;
    margin-top: 5px;
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

.plot.ready .countdown {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: bold;
}

/* Message notifications */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Version display */
#version {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 12px;
    color: #666;
    opacity: 0.7;
    font-family: monospace;
}

/* Reset button */
#reset-button {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 5px 15px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

#reset-button:hover {
    background-color: #c82333;
    opacity: 1;
    transform: scale(1.05);
}

/* Power-ups section */
#power-ups {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0e68c;
    border-radius: 5px;
}

.power-up-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #8FBC8F;
    border: 2px solid #556B2F;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.power-up-button:hover:not(.disabled) {
    background-color: #90EE90;
    border-color: #228B22;
    transform: scale(1.02);
}

.power-up-button.disabled {
    background-color: #cccccc;
    border-color: #999999;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.power-up-button.disabled:hover {
    transform: scale(1);
}

.power-up-button.active {
    background-color: #32CD32;
    color: white;
    border-color: #228B22;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #32CD32;
    }
    to {
        box-shadow: 0 0 15px #32CD32;
    }
}

/* Fertilizer cursor mode */
body[style*="crosshair"] .plot.planted:not(.ready) {
    border: 3px solid #32CD32;
    animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
    0% {
        border-color: #32CD32;
    }
    50% {
        border-color: #90EE90;
    }
    100% {
        border-color: #32CD32;
    }
}

/* Inventory change animations */
.inventory-change, .credit-change {
    position: fixed;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1001;
    animation: floatUp 1s ease-out forwards;
}

.inventory-change.positive, .credit-change.positive {
    color: #32CD32;
}

.inventory-change.negative, .credit-change.negative {
    color: #dc3545;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.inventory-item.flash {
    animation: inventoryFlash 0.5s ease;
}

@keyframes inventoryFlash {
    0%, 100% {
        background-color: #fff;
        transform: scale(1);
    }
    50% {
        background-color: #90EE90;
        transform: scale(1.05);
    }
}

/* Credit display animations */
#credits-display p.flash-credit {
    animation: creditFlash 0.5s ease;
}

@keyframes creditFlash {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #2d5016;
    }
}

/* Help button */
#help-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#help-button:hover {
    background-color: #45a049;
    transform: scale(1.1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: modalFade 0.3s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal h2 {
    margin-bottom: 15px;
    color: #2d5016;
}

.modal h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #3d6526;
}

.modal ul {
    margin-left: 20px;
}

.modal li {
    margin-bottom: 8px;
}

.modal-button {
    margin: 10px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.modal-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

#win-modal .modal-content {
    text-align: center;
}

#win-stats {
    margin: 20px 0;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 5px;
}

#win-stats p {
    margin: 10px 0;
    font-size: 18px;
}

/* Planting animation */
.plant-animation {
    animation: plantPop 0.5s ease;
}

@keyframes plantPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}