/* well_map.css
   Full stylesheet extracted from well_map_combined.html
   This file is the canonical place for styles used by the Well Plat UI.
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    overflow: hidden;
}

/* Logo styling */
.logo {
    display: inline-block;
    margin: 0 16px 0 0;
    width: 64px;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    vertical-align: middle;
    /*box-shadow: 0 6px 18px rgba(0,0,0,0.12);*/
}

.header {
    background: white;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: auto;
    min-height: var(--header-min-height);
    transition: min-height 0.22s ease, padding 0.22s ease, transform 0.22s ease;
}

/* Collapsed header — minimal height, hide controls and title */
.header.collapsed {
    height: var(--header-height-collapsed) !important;
    min-height: var(--header-height-collapsed) !important;
    max-height: var(--header-height-collapsed) !important;
    /* give extra right padding so the toggle fits inside the header */
    padding: 4px 8px 4px 8px;
    padding-right: 40px;
    overflow: hidden;
    align-items: center;
}

/* Update the global header height variable when header is collapsed */
body:has(.header.collapsed) {
    --header-height: var(--header-height-collapsed);
}

/* Toggle button pinned to the far right of the viewport when expanded */
.header .header-toggle {
    position: fixed;
    right: 10px;               /* pin to far-right edge (small inset) */
    top: 20px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    padding: 8px 10px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    z-index: 1200;
}

.header .header-toggle:hover {
    background: rgba(0,0,0,0.03);
}

/* When header is collapsed, position the toggle inside the header (so it fits) */
.header.collapsed .header-toggle {
    position: absolute;       /* relative to .header (header is position:relative) */
    right: 8px;               /* small inset from header edge */
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 4px 6px;
    font-size: 1rem;
    z-index: 1201;
}

/* Simplify logo spacing: small left offset so layout is compact */
.header .logo {
    margin-left: 12px;
    transition: margin 0.18s ease, width 0.18s ease;
}

.header.collapsed .logo {
    margin-left: 6px;
    width: 32px;
}

/* Brand: logo + title stay together on one row */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

/* Keep title visible when header is collapsed; scale it down for compactness */
.brand h1 {
    margin: 0;
    font-size: 1.25rem;
    transition: font-size 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.header.collapsed .brand h1 {
    font-size: 0.8rem; /* more compact */
    opacity: 1;
    transform: none;
    line-height: 1;
}

/* Hide other controls when header is collapsed */
.header.collapsed .controls,
.header.collapsed .controls-right {
    display: none;
}

.header h1 {
    color: #333;
    font-size: 1.25rem;
    margin: 0;
    line-height: 1;
    font-weight: 700;
}

.controls {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-left: auto; /* push controls to the right */
    padding-top: 6px; /* align with brand baseline when wrapping */
    justify-content: flex-end; /* keep items aligned to the right when wrapping */
}

/* Responsive: stack header items on narrow screens; fix header and size map to remaining viewport */
@media (max-width: 700px) {
    /* Update root variables for small screens */
    :root {
        --header-min-height: 68px;
        --header-height-collapsed: 36px;
    }

    /* On small screens stack header items but keep header in normal flow
       so the map always sits entirely below the header (same behavior as large screens). */
    .header {
        position: relative; /* keep in document flow instead of fixed */
        width: 100%;
        z-index: 1200;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        height: auto; /* allow header to expand naturally */
        min-height: var(--header-min-height);
        padding-right: 72px; /* room for toggle */
    }

    /* When collapsed, reduce the height */
    .header.collapsed {
        height: var(--header-height-collapsed) !important;
        min-height: var(--header-height-collapsed) !important;
        max-height: var(--header-height-collapsed) !important;
        padding-right: 12px;
    }

    /* Shrink brand elements on small screens so they don't dominate space */
    .header .brand h1 {
        font-size: 1rem;
        line-height: 1.1;
        margin-left: 6px;
        font-weight: 700;
    }

    .header .logo {
        width: 48px;
        height: auto;
        margin: 0 0 6px 0;
    }

    /* position the toggle inside the header when small */
    .header .header-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Make controls maintain right alignment even on mobile when wrapping */
    .controls {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 8px; /* breathing room */
        /* Remove height restrictions to allow natural expansion */
    }

    /* Allow the inner control groups to wrap onto multiple lines if needed */
    .file-group-inner,
    .controls-right-inner {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    /* Make controls-right-inner stack buttons vertically on very narrow screens */
    .controls-right-inner {
        flex-direction: column;
        align-items: flex-end;
        width: 100%;
    }

    /* Adjust controls-right on mobile for better button accessibility */
    .controls-right {
        margin-right: 40px;
        width: 100%;
        align-items: flex-end;
    }

    /* Reduce header button min-width on small screens to help them fit */
    .header .controls button,
    .header .controls .file-input-label,
    .header .controls .save-btn,
    .header .controls .delete-btn,
    .header .controls .reset-btn {
        min-width: 70px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.9em;
    }

    /* Keep map-container in the flex layout so it naturally sits below the header.
       Avoid forcing margin-top or calc(100vh - header) when header is part of the flow. */
    .map-container {
        margin-top: 0;
        height: auto;
        flex: 1;
    }
}

/* Group file-related controls and add a subtle right divider */
.file-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px solid #e9ecef;
}

/* small label above each group */
.group-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

/* inner container keeps the buttons/inputs in a horizontal row */
.file-group-inner,
.controls-right-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-right {
    margin-right: 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0; /* allow shrinking */
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-input-label,
.delete-btn,
.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.2s;
    min-width: 120px;
    text-align: center;
    box-sizing: border-box;
    height: 42px;
}

/* Apply consistent minimum width and height to all header controls so layout is even */
.header .controls button,
.header .controls .file-input-label,
.header .controls .save-btn,
.header .controls .delete-btn,
.header .controls .reset-btn {
    min-width: 60px;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Save button: icon + label layout */
.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.2s;
    text-align: center;
    height: 42px;
}

/* icon spacing for buttons that include icons */
.controls-right-inner i.bi {
    font-size: 1.05rem;
    margin-right: 6px;
    vertical-align: middle;
}

/* ensure delete button maintains consistent styling */
.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
}

/* smaller label span so text size is consistent */
.btn-label {
    display: inline-block;
}
.delete-btn {
    background: #ff4d4d;
    color: white;
}
.delete-btn:hover {
    background: #e64949;
}
.file-input-label {
    background: #164955;
    color: white;
}

.file-input-label:hover {
    background: #059cb8;
}

.reset-btn {
    background: #efaf01;
    color: white;
    font-weight: 520;
}

.reset-btn:hover {
    background: #e68900;
}
.delete-btn:disabled,
.reset-btn:disabled {
    background: #cccccc !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.save-btn {
    background: #0f8e6a;
    color: white;
    font-weight: 520;
}

.save-btn:hover {
    background: #00e6a9;
}

.save-btn:disabled {
    background: #cccccc !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Map container styles */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

/* PDF overlay styles from original map */
.pdf-overlay {
    position: absolute;
    cursor: move;
    z-index: 350;
    border: 2px dashed #059cb8;
    background: transparent;
    transform-origin: center center;
}

.pdf-overlay svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.pdf-overlay img {
    width: 100%;
    height: 100%;
    opacity: 0.6;
    display: block;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #059cb8;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 1001;
}

.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.rotate-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #efaf01;
    border: 2px solid white;
    border-radius: 50%;
    cursor: crosshair;
    z-index: 1001;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.rotate-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #efaf01;
    z-index: -1;
}

/* Global sidebar sizing variables */
:root {
    /* Header height settings - globally accessible */
    --header-height: auto;
    --header-min-height: 88px;
    --header-height-collapsed: 36px;

    /* Sidebar width settings for large screens */
    --sidebar-full-width: 780px;
    --sidebar-half-width: 300px;

    /* Sidebar width settings for small screens - use relative units */
    --sidebar-full-width-small: calc(min(85vw, 800px));
    --sidebar-half-width-small: calc(min(65vw, 300px));

    /* Toggle button dimensions */
    --toggle-width: 20px;
    --toggle-height-large: 60px;
    --toggle-height-small: 48px;
}

/* Left sidebar base styles */
.left-sidebar {
    position: fixed;
    top: var(--header-min-height);
    left: calc(-1 * var(--sidebar-full-width)); /* Start offscreen */
    width: var(--sidebar-full-width);
    height: calc(100% - var(--header-min-height));
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: left 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.left-sidebar.open {
    left: 0;
    width: var(--sidebar-full-width);
}

.left-sidebar.half-collapsed {
    left: 0;
    width: var(--sidebar-half-width);
}

.sidebar-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Toggle button styles */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 2001;
    background: white;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 12px;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    font-size: 1.2em;
    transition: left 0.3s ease, box-shadow 0.3s ease;
    color: #666;
    font-weight: bold;
    min-height: var(--toggle-height-large);
    width: var(--toggle-width);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    color: #333;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

/* Position the toggle at the edge of the sidebar */
.sidebar-toggle.open {
    left: var(--sidebar-full-width);
    border-radius: 0 8px 8px 0;
    border-left: none;
    border-right: 1px solid #ddd;
}

.sidebar-toggle.half-collapsed {
    left: var(--sidebar-half-width);
    border-radius: 0 8px 8px 0;
    border-left: none;
    border-right: 1px solid #ddd;
}

/* Media query for smaller screens */
@media (max-width: 800px) {
    /* Adapt sidebar to use viewport-relative widths */
    .left-sidebar {
        left: calc(-1 * var(--sidebar-full-width-small));
        width: var(--sidebar-full-width-small);
        top: var(--header-min-height);
        height: calc(100vh - var(--header-min-height));
    }

    .left-sidebar.open {
        left: 0;
        width: var(--sidebar-full-width-small);
    }

    .left-sidebar.half-collapsed {
        left: 0;
        width: var(--sidebar-half-width-small);
    }

    /* Smaller toggle button on mobile */
    .sidebar-toggle {
        min-height: var(--toggle-height-small);
        padding: 10px 6px;
        width: 24px;
    }

    /* Reposition toggle based on mobile sidebar widths */
    .sidebar-toggle.open {
        left: var(--sidebar-full-width-small);
    }

    .sidebar-toggle.half-collapsed {
        left: var(--sidebar-half-width-small);
    }
}

/* Well list styles adapted */
.upload-area {
    border: 2px dashed #164955;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background-color: #e9ecef;
    border-color: #164955;
}

.upload-area.dragover {
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.geometry-thumbnail {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6c757d;
}

.well-grid {
    height: 400px;
    width: 100%;
    flex: 1;
}

.input-methods {
    margin-bottom: 20px;
}

.method-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin-bottom: 10px;
}

.method-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #08a4a3;
}

.method-card.active {
    border-color: #08a4a3;
    background-color: rgba(8, 164, 163, 0.3);
}

.method-icon {
    font-size: 1.5rem;
    color: #164955;
    margin-bottom: 8px;
}

.input-section-container {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.input-section-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-section-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.expanded-textarea {
    flex: 1;
    min-height: 200px;
    resize: vertical;
}

.expanded-upload-area {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}




/* Accordion styles */
.clickable-header {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.clickable-header:hover {
    background-color: #08a4a3;
}

.accordion-arrow {
    font-size: 0.8rem;
    color: #08a4a3;
    margin-left: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    transform-origin: center;
}

/* Hide wells grid initially */
.wells-table-container {
    display: none;
    flex: 1;
}

.wells-table-container.show {
    display: flex;
    flex-direction: column;
}

/* Radio button column styling */
.ag-cell input[type="radio"] {
    margin: 0;
    padding: 0;
}

.ag-cell[col-id="1"] {
    text-overflow: clip !important;
    overflow: visible !important;
}

/* Map interaction styles from original */
.plat-links-dropdown {
    position: relative;
    display: inline-block;
    min-width: 250px;
    margin-left: 10px;
}

.plat-links-dropdown select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23333" viewBox="0 0 16 16"><path d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    background-size: 12px;
}

/* Right sidebar styles for map tools - positioned inside the .map-container so it never overlaps header */
.right-sidebar {
    position: absolute; /* relative to .map-container (which has position: relative) */
    top: 12px;          /* inset from top of map area */
    right: -420px;      /* hidden off-screen (width + small gap) */
    width: 360px;
    height: calc(100% - 24px); /* fill map-container height minus inset */
    background: white;
    box-shadow: -6px 0 18px rgba(0,0,0,0.12);
    z-index: 900; /* below header (header uses 1000) */
    transition: right 0.28s ease, top 0.2s ease;
    overflow-y: auto;
    padding: 18px;
    border-radius: 8px 0 0 8px;
    pointer-events: auto;
}

/* Open state: slide into view with a comfortable inset from the map edge */
.right-sidebar.open {
    right: 12px;
}

/* Right-sidebar toggle button (settings) - position inside the map container in the upper-right of the map */
.right-sidebar-toggle {
    position: absolute; /* placed inside .map-container */
    top: 12px;
    right: 12px;
    z-index: 910;
    background: white;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 1.1em;
    transition: background 0.2s, transform 0.15s;
    pointer-events: auto;
}

.right-sidebar-toggle:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

/* Ensure toggle and sidebar reposition if header height changes (map-container margin-top already handles header space) */

/* Copy remaining styles from well_map_positioner.html */
.sidebar-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.1em;
}

.sidebar-section label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 600;
    font-size: 0.95em;
}

.sidebar-section small {
    color: #777;
    font-size: 0.85em;
    display: block;
    margin-bottom: 8px;
}

.sidebar-section .input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sidebar-section .button-group {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
}

.sidebar-section button {
    background: #08a4a3;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.sidebar-section button:hover {
    background: #08a4a3;
}

.sidebar-section button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Additional map tool styles */
.opacity-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #059cb8;
    cursor: pointer;
}

.opacity-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #059cb8;
    cursor: pointer;
    border: none;
}

.opacity-value {
    display: inline-block;
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
    min-width: 40px;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #aaa;
    color: #666;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    cursor: help;
    margin-left: 8px;
    background: #f7f7f7;
}

.help-icon:hover {
    background: #ececec;
}

/* Toggle switches */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    margin: 0 4px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #059cb8;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
}

/* Collapsible sidebar sections */
.sidebar-dropdown {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
}

.sidebar-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background: #f0f0f0;
    border-radius: 5px 5px 0 0;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sidebar-dropdown-header:hover {
    background: #e8e8e8;
}

.sidebar-dropdown-header h3 {
    margin: 0;
    font-size: 1em;
    color: #333;
    font-weight: 600;
}

.sidebar-dropdown-arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s ease;
}

.sidebar-dropdown-content {
    padding: 15px;
    background: white;
    border-radius: 0 0 5px 5px;
    display: none;
}

.sidebar-dropdown.expanded .sidebar-dropdown-content {
    display: block;
}

.sidebar-dropdown.expanded .sidebar-dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown .sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-dropdown .sidebar-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* DMS input styles */
.dms-input-container {
    display: flex;
    width: 100%;
    height: 31px;
    gap: 1px;
    align-items: center;
}

.dms-input-container input {
    padding: 2px 1px;
    text-align: center;
    min-width: 0;
    border-radius: 3px;
    border: 1px solid #ddd;
    margin: 0;
}

.dms-input-container input.deg-input {
    flex: 1.8;
}

.dms-input-container input.min-input {
    flex: 1;
}

.dms-input-container input.sec-input {
    flex: 2;
}

.dms-input-container span {
    display: flex;
    align-items: center;
    color: #777;
    font-size: 0.8em;
    width: 6px;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.dms-input-container select {
    width: 30px;
    padding: 2px 0 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path fill="%23888" d="M0 2l4 4 4-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 3px center;
    background-size: 7px;
    text-align: left;
    font-size: 0.9em;
    margin: 0;
}

.dms-coords-container {
    display: flex;
    width: 100%;
    gap: 4px;
    flex-wrap: nowrap;
}

.dms-coord-group {
    flex: 1;
    min-width: 0;
}

.dms-coord-group label {
    margin-bottom: 1px;
    font-size: 0.85em;
    display: block;
}

.sidebar-section input[type="number"] {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    width: 100%;
}

.sidebar-section .input-group label {
    flex: 1;
    min-width: 140px;
}

.sidebar-section .latlon-input {
    width: 100% !important;
    padding: 5px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.dms-coord-group .latlon-input {
    display: block;
    width: 100% !important;
    padding: 4px 6px;
    font-size: 0.95em;
}

/* Anchor point markers */
.anchor-point-marker {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.6);
    border: 2px solid rgba(255, 0, 0, 0.8);
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 1002;
    pointer-events: none;
}

.anchor-point-marker.pdf-point-2 {
    background-color: rgba(0, 123, 255, 0.7);
    border-color: rgba(0, 123, 255, 0.8);
}

.pdf-overlay.selecting-point {
    cursor: crosshair;
}

.crosshair-cursor {
    cursor: crosshair !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #059cb8;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}
