/* ====== GENERAL STYLES ====== */

body {
    font-family: monospace, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

h3, h4 {
    margin-top: 0;
    margin-bottom: 0px;
}

/* ====== HEADER ====== */

#header {
    text-align: center;
    background-color: #333;
    color: white;
    padding: 20px 0;
}

#header h1 {
    font-size: 36px;
    margin: 0;
}

/* ====== ASCII DISPLAY ====== */

#ascii-display {
    position: relative;
    width: 650px;
    height: 400px;
    background-color: #f5f5f5;
    border: 2px solid #ccc;
    overflow: hidden;
}

/* ====== ASCII OBJECTS ====== */

.ascii-art {
    position: absolute;
    cursor: pointer;
    white-space: pre;
    color: black;
    font-size: 15px;
}

.selected {
    border: 2px solid blue;
    outline-offset: 2px;
}

.flashing-border {
    animation: flash-border 1s infinite;
    border: 2px solid red;
}

@keyframes flash-border {
    0% { border-color: red; }
    50% { border-color: transparent; }
    100% { border-color: red; }
}

/* ====== CONTEXT MENU ====== */

#context-menu {
    position: absolute;
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    border-radius: 8px;
    width: 160px;
    height: 150px;
    overflow-y: auto;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 1000;
}

#context-menu strong {
    font-size: 15px;
    color: #333;
    display: block;
    margin-bottom: 4px;
    padding-bottom: 2px;
}

#context-menu hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 10px 0;
}

#context-menu label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #444;
}

#context-menu input[type="checkbox"] {
    margin: 0;
}

#context-menu input[type="color"],
#context-menu input[type="number"],
#context-menu select {
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
}

#context-menu input[type="color"] {
    padding: 0;
    width: 60px;
    height: 28px;
}

#context-menu #color-section label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#context-menu button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    margin-top: 10px;
}

#context-menu button:hover {
    background-color: #c0392b;
}

/* ====== PANELS: COMMON STYLE ====== */

.panel-box {
    position: absolute;
    background-color: #f0f0f0;
    padding: 0;
    border: 1px solid #ccc;
    width: 200px;
    z-index: 20;
    box-sizing: border-box;

    max-height: 65vh;       /* Limit height to 75% of the screen */
    overflow-y: auto;       /* Allow vertical scrolling */
    overflow-x: hidden;     /* Prevent horizontal scroll unless needed */
    display: flex;
    flex-direction: column;
}

/* Collapsible Header */
.panel-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #ddd;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    border-bottom: 1px solid #bbb;
}

/* Panel Content */
.panel-content {
    padding: 10px;
}

/* Collapsed Panels */
.panel-box.collapsed .panel-content {
    display: none;
}

/* ====== INDIVIDUAL PANEL POSITIONS ====== */

#property-box {
    bottom: 20px;
    left: 20px;
}

#global-settings-panel {
    bottom: 20px;
    left: 240px; /* Offset from property box */
}

#items-in-scene-box {
    bottom: 20px;
    right: 20px;
}

/* ====== ITEM / SCENE BOX ====== */

#items-in-scene-box h3,
#items-in-scene-box h4 {
    margin-top: 0;
    margin-bottom: 0px;
}

#object-list,
#scene-list,
#keybindings-ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    margin-bottom: 0px;
}

#object-list li,
#keybindings-ul li,
#scene-list li {
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 0px;
}

.delete-x {
    background: transparent;
    border: none;
    color: darkgrey;
    font-weight: bold;
    margin: none;
    
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
}


/* ====== HIGHLIGHT ====== */

.highlight {
    background-color: #ffd700;
    font-weight: bold;
}

/* ====== BUTTON / FORM STYLES ====== */

textarea {
    margin-top: 30px;
    margin-bottom: -10px;
}

button {
    padding: 5px 15px;
    margin-top: 10px;
    cursor: pointer;
}

