/*
 * Map Controls Widget
 * Manages the floating widget for basemaps and overlays.
 */

:root {
    --mc-bg: #ffffff;
    --mc-border: #e5e7eb;
    --mc-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --mc-radius: 8px;
    --mc-icon-color: #4b5563; /* Gray-600 */
    --mc-icon-hover-bg: #f3f4f6; /* Gray-100 */
    --mc-header-text: #111827; /* Gray-900 */
    --mc-section-border: #f3f4f6;
    --mc-label-text: #6b7280; /* Gray-500 */
}

.map-controls-widget {
    position: absolute;
    top: 68px; /* Position below the top bar */
    right: 15px;
    z-index: var(--z-map-controls);
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Align items to the top */
    pointer-events: none; /* Allow clicks to pass through the container */
}

.map-controls-toggle {
    width: 40px;
    height: 40px;
    background-color: var(--mc-bg);
    border: 1px solid var(--mc-border);
    border-radius: 0;
    box-shadow: var(--mc-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease;
    order: 2; /* Button is now on the right */
    pointer-events: auto; /* Make the button itself clickable */
}

.map-controls-toggle:hover {
    background-color: var(--mc-icon-hover-bg);
}

.map-controls-toggle .material-symbols-outlined {
    font-size: 24px;
    color: var(--mc-icon-color);
}

.map-controls-panel {
    width: 280px;
    background-color: var(--mc-bg);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    margin-right: 8px; /* Space between panel and button */
    opacity: 0;
    transform: translateX(10px); /* Animate from the right */
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
    display: none; /* Initially hidden and removed from layout */
    flex-direction: column;
    order: 1; /* Panel is now on the left */
}

.map-controls-panel.visible {
    display: flex; /* Make visible and add to layout */
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.mc-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--mc-border);
}

.mc-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--mc-header-text);
}

.mc-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--mc-section-border);
}
.mc-section:last-child {
    border-bottom: none;
}

.mc-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--mc-label-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.mc-control-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Radio and Checkbox Styles */
.mc-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.mc-option input {
    cursor: pointer;
}

.mc-option label {
    cursor: pointer;
    flex-grow: 1;
    color: var(--mc-header-text);
}

.mc-separator {
    font-size: 11px;
    font-weight: 600;
    color: var(--mc-label-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mc-section-border);
}

.mc-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--mc-section-border);
}

.mc-manage-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    width: auto;
}

.mc-manage-btn:hover {
    text-decoration: underline;
    background: none;
}
