/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f8ff;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #006400;
}

h2 {
    margin: 20px 0 10px;
    color: #006400;
}

/* Color Mixer Styles */
.color-mixer {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 20px 0;
}

.mixer-section {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    width: 45%;
    margin-bottom: 15px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.color-options {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.color-box {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.purple {
    background-color: #663399;
}

.white {
    background-color: #FFFFFF;
    color: #000;
    border: 1px solid #ddd;
}

.dark-red {
    background-color: #8B0000;
}

.yellow-orange {
    background-color: #FFAE42;
    color: #000;
}

.mixing-area {
    background-color: #eee;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mixed-color {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Coloring Section Styles */
.game-area {
    display: flex;
    flex-wrap: nowrap; /* Changed to nowrap to keep elements in a row */
    justify-content: flex-start; /* Align at the start rather than space-between */
    margin-top: 30px;
    align-items: flex-start;
}

.coloring-section {
    flex: 0 0 55%; /* Fixed width (flex-basis) of 55% with no growing/shrinking */
}

.plant-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#konva-container {
    width: 100%;
    height: 100%;
    position: relative;
    max-width: 500px;
    max-height: 500px;
    margin: 0 auto;
    cursor: crosshair;
}

.plant-container button {
    transition: all 0.2s ease;
}

.plant-container button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.color-palette {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.palette-color {
    width: 50px;
    height: 50px;
    margin: 0 10px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
}

.palette-color.selected {
    border: 2px solid #000;
}

/* Pot Selection Styles */
.pot-selection {
    width: 35%;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.pots {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.pot {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 5px;
}

.pot.selected {
    border: 2px solid #006400;
}

.pot-drop-area {
    min-height: 200px;
    background-color: #eee;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    border: 2px dashed #aaa;
}

/* Result Message */
.result-message {
    margin: 20px 0;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.success {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.try-again {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

/* Drag and Drop Visual Feedback */
.dragging-element, .dragging-plant {
    cursor: grabbing;
    transition: transform 0.1s ease;
    transform: scale(1.1);
}

/* Button Styles */
#reset-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #006400;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#reset-btn:hover {
    background-color: #004d00;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mixer-section {
        width: 100%;
    }
    
    .coloring-section, .pot-selection {
        width: 100%;
        margin-bottom: 20px;
    }
}
