/* Import Tailwind CSS base styles */
@import "tailwindcss";

/* Define CSS variables for theming */
:root {
    --bg-color: #e5e7eb; /* Light mode background */
    --canvas-border: #1f2937;
    --text-color: #1f2937;
    --btn-bg: #3b82f6; /* Blue-500 */
    --btn-hover: #2563eb; /* Blue-600 */
}

/* Dark Mode Configuration */
body.dark-mode {
    --bg-color: #1f2937; /* Dark mode background */
    --canvas-border: #4b5563;
    --text-color: #d1d5db; /* Light gray text */
    background-color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    cursor: crosshair; /* Global cursor for drawing */
}

/* Canvas Styling */
#art {
    border: 2px solid var(--canvas-border);
    display: block;
    margin: 0 auto;
    touch-action: none;
    width: 90%;
    max-width: 1000px;
    height: auto;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background-color: white; /* Canvas background should be distinct */
    cursor: default; /* Cursor is set dynamically in JS for move/resize */
}

/* Button Styling */
.menu-button, #dark-mode-toggle, #toggle-resize-move, #undo-button {
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.menu-button:hover, #dark-mode-toggle:hover, #toggle-resize-move:hover, #undo-button:hover {
    opacity: 0.9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Menu Container: Initially hidden */
#buttons-container {
    display: none;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 16px;
    border-radius: 8px;
    background-color: var(--bg-color);
    border: 1px solid var(--canvas-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    flex-wrap: wrap;
    gap: 12px;
    width: 95%;
    max-width: 700px;
}

/* Menu visibility toggle class: JS adds/removes this class */
#buttons-container.active {
    display: flex;
}

/* Styling for inputs and selects within the menu */
#buttons-container input[type="text"],
#buttons-container select,
#buttons-container input[type="range"] {
    border: 1px solid #d1d5db;
    padding: 8px;
    border-radius: 4px;
    background-color: #fff;
    color: #1f2937;
}
body.dark-mode #buttons-container input[type="text"],
body.dark-mode #buttons-container select {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.control-group {
    padding: 10px;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    flex-grow: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Custom cursor for moving */
.cursor-move { cursor: move !important; }
