/* =========================================================
   Global
   ========================================================= */

/* Use a consistent box model throughout the application */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base page styling */
body {
    font-size: 1em;
    color: black;
    font-family: Verdana, Arial, sans-serif;
    margin: 0;
    padding: 10px;
    min-width: 320px;
}

/* Application-wide control sizing */
:root {
    --control-font-size: 1em;
    --control-height: 36px;
}

/* Main content container */
.container {
    max-width: 1400px;
}

/* =========================================================
   Typography
   ========================================================= */

/* Standard form labels */
label {
    font-weight: 400;
}

/* Emphasised text */
.strong {
    font-weight: bold;
}

/* Headings */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgb(180, 138, 31);
    border-bottom: 2px solid rgb(180, 138, 31);
    padding-bottom: 4px;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 2px solid rgb(180, 138, 31);
    padding-bottom: 4px;
}

h3 {
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid rgb(180, 138, 31);
    padding-bottom: 2px;
}

h4 {
    font-size: 1rem;
    font-weight: 700;
}

/* Standard paragraph */
p {
    font-size: 1em;
    margin: 6px 0;
}

/* Reduced spacing paragraph */
p.compact {
    margin-bottom: 8px;
}

/* Reduced spacing label */
label.compact {
    display: inline-block;
    margin-top: 8px;
}

/* =========================================================
   Links
   ========================================================= */

a {
    color: #2c7be5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================================================
   Inputs & Controls
   ========================================================= */

/* Prevent controls exceeding container width */
input,
select,
textarea,
button {
    max-width: 100%;
    font-family: inherit;
}

/* ---------------------------------------------------------
   Standard Text Inputs & Dropdowns
   --------------------------------------------------------- */
input[type="text"],
select {
    height: var(--control-height);
    padding: 1px 6px;
    font-size: var(--control-font-size);
    border: 1px solid black;
    background-color: #c8f2b2;
    vertical-align: middle;
}

/* Small spacing around text inputs */
input[type="text"] {
    margin: 1px;
}

/* ---------------------------------------------------------
   Date/Time Controls
   --------------------------------------------------------- */
.datetime-field {
    width: 260px;
}

.datetime-format {
    width: 180px;
}

/* Monospaced editing/display areas */
.grid {
    font-family: Consolas, "Courier New", monospace;
}

/* Allow only vertical resize */
textarea {
    resize: vertical;
}

/* Placeholder appearance */
input::placeholder {
    color: green;
    font-size: 0.85em;
    font-style: italic;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

button {
    background: rgb(180, 138, 31);
    color: white;
    border: none;
    height: var(--control-height);
    padding: 0 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--control-font-size);
}

button:hover {
    background: rgb(160, 122, 27);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Keyboard accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid rgb(180, 138, 31);
    outline-offset: 2px;
}

/* =========================================================
   Alignment Utilities
   ========================================================= */

.align-left {
    text-align: left !important;
}

.align-center {
    text-align: center !important;
}

.align-right {
    text-align: right !important;
}

/* Structural Utility Helpers */
.hidden {
    display: none !important;
}

/* =========================================================
   Checkbox Styling
   ========================================================= */

#autoRows {
    accent-color: #2e8b57;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* =========================================================
   Layout Helpers
   ========================================================= */

/* General horizontal control row */
.map-pin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0;
}

/* Button actions row */
.actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}

/* Checkbox + label combination */
.auto-rows-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

/* =========================================================
   Tables
   ========================================================= */

table {
    width: 100%;
    max-width: 1400px;
    border-collapse: collapse;
    border: 1px solid #000;
    font-size: 0.9em;
}

th,
td {
    border: 1px solid #000;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
}

thead {
    color: rgb(180, 138, 31);
    font-size: 0.85em;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 3px solid rgb(180, 138, 31);
    white-space: nowrap;
}

tbody tr:nth-child(odd) {
    background: #fff;
}

tbody tr:nth-child(even) {
    background: #eee;
}

/* Table Input Controls */
table input,
table select,
table textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 4px 6px;
    font: inherit;
    box-sizing: border-box;
    cursor: pointer;
}

table input[type="text"],
table select {
    height: 36px;
}

table textarea {
    min-height: 36px;
    resize: vertical;
}

/* =========================================================
   Status & Validation Messages
   ========================================================= */

/* Input validation error */
.error {
    background-color: #ffe6e6;
    border: 1px solid #cc0000;
}

/* Generic status message */
.message {
    font-size: 12px;
    line-height: 1.2;
    padding: 2px 6px;
    margin-left: 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    display: inline-block;
}

/* Error message */
.message.error {
    color: #b00020;
    background: #ffecec;
    border-color: #f5c2c7;
}

/* Warning message */
.message.warn {
    color: #856404;
    background: #fff3cd;
    border-color: #ffeeba;
}

/* Information message */
.message.info {
    color: #0c5460;
    background: #d1ecf1;
    border-color: #bee5eb;
}

/* Success message */
.message.success {
    color: #155724;
    background: #d4edda;
    border-color: #c3e6cb;
}

/* GMA East */
.message.gma-east {
    color: #155724;
    background: #d4edda;
    border-color: #c3e6cb;
}

/* GMA West */
.message.gma-west {
    color: #856404;
    background: #fff3cd;
    border-color: #ffeeba;
}

/* GMA Neutral */
.message.gma-neutral {
    color: #555;
    background: #eee;
    border-color: #ccc;
}

/* System-generated values, not user input */
#mapgr {
    color: #0c5460;
    background: #d1ecf1;
    border-color: #bee5eb;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    font-weight: bold;
    cursor: default;
}

#mapgr:focus {
    outline: none;
    box-shadow: none;
}

/* =========================================================
  Notes Display Container
   ========================================================= */
#notes {
    margin-top: 10px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
}

#notes object {
    display: block;
    width: 100%;
    font-family: monospace;
    white-space: pre-wrap;
}

/* =========================================================
   Map Display
   ========================================================= */

/* Hidden map container wrapper */
.map {
    display: none;
}

/* Main map panel */
#mapdiv {
    width: 100%;
    height: 500px;
    border: 1px solid rgb(180, 138, 31);
}

/* Secondary map content */
#mapdivs {
    margin-top: 10px;
}

/* =========================================================
   Footer & Diagnostic Areas
   ========================================================= */

/* Header/footer information */
#header,
#footer {
    font-size: 0.8em;
    font-style: italic;
    color: #666;
}

/* Container width constraints */
#notes {
    width: 50%;
    min-width: 320px;
    margin-top: 10px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
}

#notes object {
    display: block;
    width: 100%;
    height: 400px;
    font-family: monospace;
    white-space: pre-wrap;
}

/* Log & File Contents container set to 75% width */
#logs {
    width: 60%;
    min-width: 320px;
    margin-top: 10px;
}

/* Console-style log displays */
#log,
#filecontents {
    width: 100%; /* Fills 100% of parent #logs (75% screen width) */
    display: block;
    background: #111;
    color: #0f0;
    padding: 8px;
    font-size: 12px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #444;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* Specific heights */
#log {
    height: 300px;
}

#filecontents {
    height: 200px;
}