/* --- Base and Imported Styles from your main CSS --- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Add some horizontal padding */
}

/* Header & Nav Styles (copied from your main style) */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
}
header h1 { margin: 0; }
.header-content { display: flex; align-items: center; }

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    background-color: #34495e;
}
nav ul li { padding: 15px 20px; transition: background-color 0.3s; }
nav ul li a { color: white; text-decoration: none; font-weight: 500; }
nav ul li:hover { background-color: #2c3e50; }

/* Container to hold the select dropdown and the delete button */
.deletable-select-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between dropdown and button */
}

/* Make the dropdown take up the available space */
.deletable-select-container .form-input {
    flex-grow: 1;
}

/* Style for the new delete button */
.delete-btn {
    padding: 5px 10px;
    background-color: #dc3545; /* A standard 'danger' red */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px; /* Make the trash icon a decent size */
    line-height: 1;
    flex-shrink: 0; /* Prevent the button from shrinking */
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Hide the button when it's disabled */
.delete-btn:disabled {
    background-color: #6c757d; /* A muted gray */
    cursor: not-allowed;
    opacity: 0.5;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 1em;
    transition: background-color 0.2s;
}
.btn-success { background-color: #2ecc71; color: white; }
.btn-success:hover { background-color: #27ae60; }


/* Form Styles */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.form-label {
    width: 180px;
    padding-right: 15px;
    font-weight: 500;
    flex-shrink: 0;
}
.form-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box; 
    max-width: 450px;
}

.form-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Status Indicators */
.status-online { color: #27ae60; font-weight: bold; }
.status-offline { color: #e74c3c; font-weight: bold; }
.status-error { color: #f39c12; font-weight: bold; }


/* --- Page-Specific Styles for the Preset Loader --- */

.loader-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    margin-top: 20px;
}

aside h2, main h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 0;
}

/* Preset List (Left Sidebar) */
#preset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-item {
    padding: 12px 15px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-weight: 500;
}

.preset-item:hover {
    background-color: #e9eff5;
    border-color: #3498db;
}

.preset-item.selected {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
    font-weight: bold;
}

/* Editor Panel (Main Content) */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.editor-header h2 {
    border: none;
    padding: 0;
    margin: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
#status-message {
    font-style: italic;
    min-height: 20px;
}

#editor-panel {
    background-color: white;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-height: 400px;
}

/* Main container for the two columns */
.position-columns-container {
    display: flex;
    flex: 1; 
    gap: 20px;
}

/* Style for each individual column (e.g., the X-Y-Z column) */
.position-column {
    flex: 1;
    min-width: 0; 
    display: flex;
    flex-direction: column;
    gap: 15px; 
}

/* This targets the .form-row that holds an individual label and input (e.g., "X" and its box) */
.position-columns-container .form-row {
    flex-direction: column; 
    align-items: flex-start;
    width: 100%; 
    margin-bottom: 0;
}

/* This targets the label (e.g., "X", "Y") inside the column */
.position-columns-container .form-label {
    width: auto; 
    margin-bottom: 5px;
    font-weight: normal;
}

.position-columns-container .form-input {
    width: 100%; 
    max-width: none;
    box-sizing: border-box;
}

/* The label for the position grid container */
.position-grid-label {
    width: 180px; 
    font-weight: 500;
    padding-right: 15px;
    flex-shrink: 0;
}

/* Adjustments for inputs inside the position grid */
.position-grid .form-row {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
}
.position-grid .form-label {
    width: 100%;
    font-weight: normal;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.position-grid .form-input {
    width: 100%;
    max-width: none;
}

.position-loader-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px; 
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* Make the dropdown take up most of the space */
.position-loader-row .form-input {
    flex: 1; 
}

/* Style for the load button to match others */
.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}