/* --- Player Marker Controls --- */
/* The main container created by Leaflet */
.leaflet-control-playermarkerhub {
    margin-bottom: 25px !important; /* Nudge up from attribution */
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
}

/* The pop-up menu container */
#player-marker-options {
    margin-bottom: 10px;
}

/* Base style for our custom buttons */
.pm-button {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e2022; /* Dark background */
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    box-shadow: var(--pico-card-box-shadow);
}

.pm-button:hover {
    background-color: #303336;
}

/* The icons themselves */
.pm-button img {
    width: 20px;
    height: 20px;
    filter: invert(1) brightness(1.5); /* Makes dark SVGs appear white */
}

/* Active state for the placement toggle button (blue highlight) */
#toggle-placement-btn.active {
    background-color: var(--pico-primary);
}

/* Crosshair cursor for the whole map container when in placement mode */
#map-container.placing-mode {
    cursor: crosshair;
}

/* Override for custom player markers */
.player-marker-icon {
    background: none;
    border: none;
}

/* --- Player Marker Window --- */
#player-marker-window-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#player-marker-window {
    width: 70%;
    max-width: 1000px; /* A bit smaller than infamy window */
    height: 70%;
    background-color: var(--pico-card-background-color);
    border: 1px solid var(--pico-contrast);
    border-radius: var(--pico-border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--pico-box-shadow);
    overflow: hidden; /* Prevent content from spilling */
}

#player-marker-window-content {
    display: grid;
    grid-template-columns: 1fr 1fr; /* List column is 2x width of I/O */
    gap: 1rem;
    padding: 1rem;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
}

/* Style both columns */
#pm-list-column,
#pm-io-column {
    background-color: var(--pico-background-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures content doesn't break out */
}

/* Make the I/O column's articles stack */
#pm-io-column {
    font-size: 0.8em; /* <-- ADD: Slightly smaller font */
    gap: 1.5rem; 
    overflow-y: auto;
}

/* ADD THIS to make the I/O elements fit better */
#pm-io-column p {
    margin-bottom: 0.75rem;
}
#pm-io-column input,
#pm-io-column select,
#pm-io-column button {
    font-size: 0.9em; /* Make controls smaller too */
}

/* Make the list container scrollable */
#pm-list-container {
    flex-grow: 1; /* This is the key part */
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.5rem; /* Space for scrollbar */
}

/* Style the list itself */
#pm-list-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#pm-list-container li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    cursor: pointer;
    border-radius: var(--pico-border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#pm-list-container li:last-child {
    border-bottom: none;
}

#pm-list-container li:hover {
    background-color: var(--pico-primary-hover);
    color: var(--pico-primary-inverse);
}
#pm-list-container li small {
    color: var(--pico-muted-color);
}
#pm-list-container li:hover small {
    color: var(--pico-primary-inverse);
}


/* Style the controls at the bottom of the list */
#pm-list-controls {
    flex-shrink: 0; /* Prevents this from shrinking */
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
    display: flex;
    gap: 10px;
}

/* --- Logger Box --- */
#pm-logger {
    background-color: #111;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    display: flex;
    flex-direction: column;
    height: 150px; /* Fixed height */
    flex-shrink: 0;
}

#pm-logger header {
    background-color: #222;
    padding: 5px 10px;
    font-size: 0.85em;
    border-bottom: 1px solid #333;
    color: #aaa;
}

#pm-log-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px 10px;
    font-family: monospace;
    font-size: 0.8em;
}

.log-entry { margin: 0 0 2px 0; color: #ddd; }
.log-entry.system { color: #888; font-style: italic; }
.log-entry.add { color: #4CAF50; }   /* Green */
.log-entry.delete { color: #F44336; } /* Red */
.log-entry.edit { color: #FFC107; }   /* Yellow */

/* --- Collapsible Details --- */
.pm-details {
    background-color: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 0.5rem;
}

.pm-details summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.pm-details[open] summary {
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
}

.details-content {
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.warning-text {
    color: #ffbd2e;
    font-size: 0.85em;
    margin: 0;
}

/* --- Buttons --- */
.danger-button {
    background-color: #5c0505;
    border-color: #8a0a0a;
    color: white;
    width: 100%;
}
.danger-button:hover {
    background-color: #8a0a0a;
}
