/* scapoorbuilder.css */

/* Reset Margins and Padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
body {
    margin: 0;
    padding: 0;
    background-color: #333; /* Dark background for contrast */
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Ensure body takes full viewport height */
    overflow: hidden; /* Prevent body scrolling */
}

/* Canvas Container */
#canvasContainer {
    flex: 1; /* Take up remaining space */
    overflow: auto; /* Enable scrolling */
    border: 2px solid #fff; /* Optional: Adds a white border around the canvas */
    position: relative; /* To contain absolute positioned elements if any */
    z-index: 1; /* Positioned below tools and controls */
    width: 100%; /* Ensure it takes full width */
    height: 100%; /* Ensure it takes full height */
    padding: 0; /* Remove any padding that might add extra space */
    margin: 0; /* Remove any margin that might add extra space */
}

/* Canvas Styling */
#builderCanvas {
    display: block;
    margin: 0;
    padding: 0;
    image-rendering: pixelated; /* Ensures crisp pixel art when scaled */
    /* Width and height are managed via HTML and JS */
}

/* Tools Container */
#tools {
    background-color: #444;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap; /* Allow tools to wrap on smaller screens */
    gap: 20px;
    margin: 10px; /* Add some spacing */
    z-index: 2; /* Positioned above canvas and controls */
    overflow-x: auto; /* Allow horizontal scrolling if necessary */
}

/* Tool Category Styling */
.tool-category {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Tool Category Headers */
.tool-category h3 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Tile Icons */
.tile-icon {
    width: 24px; /* Adjust as needed */
    height: 24px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Tile Buttons */
.tileButton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #555;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 6px; /* Spacing between buttons */
    width: 120px; /* Fixed width for consistency */
}

.tileButton img.tile-icon {
    margin-right: 8px;
}

.tileButton:hover {
    background-color: #666;
}

.tileButton.active {
    background-color: #ff9800;
}

/* Controls Container */
#controls {
    background-color: #444;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    margin: 10px;
    z-index: 2; /* Positioned above canvas */
}

/* Save and Load Buttons */
#saveButton, #loadButton, #savePngButton {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #2196f3;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

#saveButton:hover, #loadButton:hover {
    background-color: #1976d2;
}

/* Save as PNG Button Specific Styles */
#savePngButton {
    background-color: #4caf50; /* Green color */
}

#savePngButton:hover {
    background-color: #388e3c; /* Darker green on hover */
}

/* Responsive Design */
@media (max-width: 800px) {
    /* Adjust tools and controls spacing on smaller screens */
    #tools, #controls {
        margin: 5px;
    }
    
    .tileButton {
        width: 80px; /* Reduced width for smaller screens */
        padding: 6px 8px;
        font-size: 12px;
    }
    
    #saveButton, #loadButton, #savePngButton {
        flex: 1 1 45%;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .tool-category h3 {
        font-size: 14px;
    }
    
    .tile-icon {
        width: 20px;
        height: 20px;
        margin-right: 5px;
    }
}

/* Customize Scrollbars for Webkit Browsers */
#canvasContainer::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#canvasContainer::-webkit-scrollbar-track {
    background: #444;
    border-radius: 6px;
}

#canvasContainer::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 6px;
    border: 3px solid #444;
}

#canvasContainer::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* For Firefox */
#canvasContainer {
    scrollbar-width: thin;
    scrollbar-color: #888 #444;
}
