/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f4f4f4;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    background: #367fa9;
    color: white;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.osu-logo {
    height: 35px;
    width: auto;
    margin-left: 20px;
    vertical-align: middle;
}

.header-controls {
    display: flex;
    gap: 10px;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
    width: 100%;
}

/* Dropdown Menu System */
.dropdown-menu-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 180px); /* Leave more space for bottom controls */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px; /* Space for scrollbar */
}

/* Custom scrollbar for dropdown menu container */
.dropdown-menu-container::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.dropdown-menu-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.dropdown-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}


.dropdown-menu {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 250px;
    flex-shrink: 0; /* Prevent individual menus from shrinking */
}

.dropdown-header {
    background: #4A90E2;
    color: white;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    transition: background-color 0.2s;
}

.dropdown-header:hover {
    background: #357ABD;
}

.dropdown-arrow {
    transition: transform 0.3s;
    font-size: 12px;
    transform: rotate(0deg); /* Arrow points down by default */
}

.dropdown-menu:not(.collapsed) .dropdown-arrow {
    transform: rotate(180deg); /* Arrow points up when menu is open */
}

.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 10px;
}

.dropdown-menu.collapsed .dropdown-content {
    max-height: 0;
    padding: 0 10px;
    overflow: hidden;
}

/* Depth Control in Dropdown */
.depth-control-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.depth-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* SSURGO Info Panel */
.ssurgo-info-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 350px;
    max-height: 80vh;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.panel-close:hover {
    background-color: #e9ecef;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.info-section {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.section-header {
    background: #4A90E2;
    color: white;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.section-arrow {
    transition: transform 0.3s;
    font-size: 12px;
    transform: rotate(0deg); /* Arrow points down by default */
}

.info-section:not(.collapsed) .section-arrow {
    transform: rotate(180deg); /* Arrow points up when section is open */
}

.section-content {
    padding: 15px;
    background: white;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.info-section.collapsed .section-content {
    max-height: 0;
    padding: 0 15px;
}

/* Landing Page Overlay */
.landing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.landing-content {
    background: white;
    padding: 40px 60px;
    border-radius: 8px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.landing-content h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.3;
}

.landing-description {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.landing-instructions {
    font-size: 16px;
    color: #888;
    margin-bottom: 30px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 18px;
}

/* Landing Buttons */
.landing-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.landing-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

/* Info table styles */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.info-table th,
.info-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.info-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.info-table tr:last-child td {
    border-bottom: none;
}

/* Info item styles */
.info-item {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item strong {
    color: #333;
    margin-right: 8px;
}

/* Control Groups */
.control-group {
    margin-bottom: 25px;
}

.control-group h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    position: relative;
}

.radio-option:hover {
    background-color: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    accent-color: #367fa9;
}

.radio-label {
    font-size: 14px;
    color: #333;
}


/* Checkbox Options */
.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    position: relative;
}

.checkbox-option:hover {
    background-color: #f8f9fa;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #367fa9;
}

.checkbox-label {
    font-size: 14px;
    color: #333;
    flex: 1;
}

/* Info Button Styles */
.info-btn {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4A90E2;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s, transform 0.1s;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    font-family: Georgia, serif;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-transform: lowercase;
}

.info-btn:hover {
    background: #357ABD;
    transform: scale(1.1);
}

.info-btn:active {
    transform: scale(0.95);
}

/* Overlay Color Preview */
.overlay-color-preview {
    margin-left: auto;
    width: 30px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: opacity 0.2s;
}

.overlay-color-preview .color-line {
    width: 24px;
    height: 3px;
    border-radius: 1px;
}

/* Specific styles for different overlay types */
.overlay-color-preview .color-line[style*="dashed"] {
    background: repeating-linear-gradient(
        to right,
        #FFD700 0px,
        #FFD700 3px,
        transparent 3px,
        transparent 6px
    );
    border: none;
    height: 2px;
}

.overlay-color-preview .color-star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 12px;
    font-weight: bold;
}

/* Form Elements */
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #367fa9;
    box-shadow: 0 0 0 2px rgba(54, 127, 169, 0.2);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #367fa9;
    color: white;
}

.btn-primary:hover {
    background-color: #2c6691;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-story-map {
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #c0392b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-story-map:hover {
    background-color: #c0392b;
    color: white;
    text-decoration: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Selection Info Panel */
.selection-info {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.info-header h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.info-content {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* Profile View */
.profile-view {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.profile-header {
    margin-bottom: 15px;
}

.profile-content h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.chart-container {
    height: 300px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    background: #f8f8f8;
}

/* Map Overlays */
.map-legend {
    position: absolute;
    top: 80px;  /* Positioned below zoom controls with ample spacing */
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 140px;
}

.map-legend h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border: 1px solid #666;
    border-radius: 2px;
}

.mouse-coords {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #367fa9;
    font-size: 16px;
    text-align: center;
}

.loading-content span {
    display: block;
    min-width: 200px;
    white-space: nowrap;
    color: #367fa9;
    font-weight: 500;
}

.loading-content i {
    font-size: 32px;
}

/* Loading Progress Bar */
.loading-progress-container {
    width: 250px;
    margin-top: 15px;
    display: none; /* Hidden by default, shown via JavaScript */
}

.loading-progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.loading-progress-fill {
    height: 100%;
    background-color: #367fa9;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}

.loading-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #367fa9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f8f9fa;
}

.modal-body {
    padding: 24px;
}

/* App version display */
.app-version {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #ddd;
}

.app-version span {
    color: #4A90E2;
    font-weight: 600;
}

.modal-body h3 {
    font-size: 16px;
    color: #333;
    margin-top: 24px;
    margin-bottom: 12px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body ul {
    margin-left: 20px;
    line-height: 1.6;
}

.modal-body li {
    margin-bottom: 6px;
    color: #555;
}

/* Source Modal Styling */
.source-info {
    font-size: 14px;
    line-height: 1.6;
}

.source-description {
    font-size: 15px;
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #4A90E2;
}

.source-details {
    margin-bottom: 20px;
}

.source-details p {
    margin: 8px 0;
}

.source-links {
    margin-bottom: 20px;
}

.source-links ul {
    margin-left: 20px;
    margin-top: 8px;
}

.source-links a {
    color: #4A90E2;
    text-decoration: none;
}

.source-links a:hover {
    text-decoration: underline;
}

.source-citation {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 6px;
}

.citation-text {
    font-style: italic;
    font-size: 13px;
    color: #555;
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        margin-left: 0;
        transform: translateX(-100%);
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 16px;
    }
}

/* Leaflet Customizations */
.leaflet-container {
    background: #f8f8f8;
}

/* North Arrow Control */
.leaflet-north-arrow {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    padding: 2px;
    cursor: default;
    margin-right: 10px !important;  /* Add space between north arrow and zoom controls */
}

.leaflet-north-arrow:hover {
    background: #f4f4f4;
}

.leaflet-north-arrow svg {
    display: block;
}

/* Adjust positioning to place north arrow to the left of zoom controls */
.leaflet-top.leaflet-right {
    display: flex;
    flex-direction: row-reverse;  /* Reverse the order so north arrow appears left of zoom */
    align-items: flex-start;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.5;
}

.popup-content h4,
.raster-popup h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.popup-content p,
.raster-popup p {
    margin: 5px 0;
    font-size: 14px;
}

.raster-popup {
    min-width: 200px;
}

.raster-popup small {
    color: #666;
    font-style: italic;
}

.raster-cell-popup {
    min-width: 180px;
}

/* Simple popup styles */
.simple-popup {
    padding: 8px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 150px;
}

.simple-popup strong {
    color: #333;
    font-weight: 600;
}

.raster-cell-popup h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.raster-cell-popup p {
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.3;
}

/* Road popup styling */
.road-popup {
    min-width: 180px;
}

.road-popup h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.road-popup p {
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.3;
}

/* Information Center Marker Styling */
.information-center-marker {
    background: none;
    border: none;
}

.information-center-marker .star-icon {
    color: #ffd700; /* Gold star */
    font-weight: bold;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7), -1px -1px 2px rgba(0,0,0,0.3);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.9));
    -webkit-text-stroke: 2px #8a2be2; /* Purple outline - thicker */
    position: absolute;
    top: 0;
    left: 0;
}

/* Info center popup styling */
.info-center-popup {
    min-width: 200px;
}

.info-center-popup h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.info-center-popup p {
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.3;
}

/* Raster rendering - crisp pixels */
.crisp-raster {
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
}

/* Hillshade background layer styling */
.hillshade-background {
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    opacity: 0.4 !important;
    mix-blend-mode: multiply;
}

/* Raster legend styling */
.raster-legend-scale {
    background: #fafafa;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Soil Order Colors (matching R configuration) */
.soil-alfisols { background-color: #B5D55D; }
.soil-andisols { background-color: #EA028C; }
.soil-aridisols { background-color: #FDDCB9; }
.soil-entisols { background-color: #75CDD6; }
.soil-gelisols { background-color: #31A4BF; }
.soil-histosols { background-color: #AE5044; }
.soil-inceptisols { background-color: #CB7662; }
.soil-mollisols { background-color: #00A551; }
.soil-oxisols { background-color: #EC1F25; }
.soil-spodosols { background-color: #D4BEC4; }
.soil-ultisols { background-color: #FAAF19; }
.soil-vertisols { background-color: #FFF100; }
.soil-unknown { background-color: #808080; }

/* Click marker styles */
.combined-click-marker {
    background: transparent;
    border: none;
}

/* SSURGO Detail Panel (SoilWeb style) */
.ssurgo-detail-panel {
    position: absolute;
    right: 60px;  /* Moved left to avoid zoom button */
    top: 20px;
    width: 400px;
    max-height: 85vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

.detail-panel-header {
    padding: 15px 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    color: #333;
}

.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
}

.detail-section {
    background: white;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section-header {
    padding: 12px 15px;
    background: #e8e8e8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #0066cc;
    transition: background-color 0.2s;
}

.detail-section-header:hover {
    background: #d8d8d8;
}

.detail-section-header .section-arrow {
    font-size: 12px;
    transition: transform 0.2s;
    transform: rotate(0deg); /* Arrow points down by default */
}

.detail-section-header.active .section-arrow {
    transform: rotate(180deg); /* Arrow points up when section is active/open */
}

.detail-section-content {
    padding: 15px;
    background: white;
    display: none;
}

.detail-section-header.active + .detail-section-content {
    display: block;
}

/* Component list styling */
.component-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.component-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.component-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.component-name {
    font-size: 14px;
    margin-bottom: 5px;
}
.soil-series-link {
    color: #0066cc;
    text-decoration: none;
    display: inline;
}
.soil-series-link:hover {
    text-decoration: underline;
}
.soil-series-link strong {
    font-weight: bold;
}
.series-links {
    padding: 15px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}
.series-link {
    color: #0066cc;
    text-decoration: none;
    margin: 0 5px;
}
.series-link:hover {
    text-decoration: underline;
}
.series-back-link {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: center;
}
.series-back-link a {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
}
.series-back-link a:hover {
    text-decoration: underline;
}

/* Soil Profile Visualization Styles */
.soil-profile-container {
    padding: 15px;
}

.profile-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.profile-btn {
    padding: 8px 12px;
    background: #f0f8ff;
    border: 2px solid #4169e1;
    border-radius: 4px;
    color: #4169e1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-btn:hover {
    background: #e6f3ff;
}

.profile-btn.active {
    background: #4169e1;
    color: white;
}

.profile-btn i {
    margin-left: 4px;
    font-size: 11px;
}

.profile-chart-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    min-height: 400px;
}

#soil-profile-chart {
    width: 100%;
    height: 400px;
}

.chart-footer {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.view-source-link {
    color: #4169e1;
    text-decoration: none;
    font-size: 13px;
}

.view-source-link:hover {
    text-decoration: underline;
}

.component-percentage {
    display: inline;
    font-weight: normal;
}

.component-details {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.geomorphic-position {
    font-style: italic;
    color: #666;
}

.view-similar-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
}

/* Map Unit Data styling */
.mapunit-data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mapunit-data-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.mapunit-data-item:last-child {
    border-bottom: none;
}

.mapunit-data-label {
    font-weight: bold;
    color: #333;
}

.mapunit-data-value {
    color: #666;
    font-style: italic;
}

.mapunit-data-help {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #0066cc;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
}

/* Details section styling */
.details-info {
    padding: 0;
}

.details-info p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

.details-info strong {
    color: #333;
    margin-right: 5px;
}

.detail-data-link {
    color: #0066cc;
    text-decoration: underline;
    font-size: 14px;
}

.detail-data-link:hover {
    color: #0052a3;
    text-decoration: none;
}

/* Survey Metadata styling */
.survey-metadata-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.survey-metadata-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.survey-metadata-item:last-child {
    border-bottom: none;
}

.survey-metadata-label {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.survey-metadata-value {
    color: #666;
    font-style: italic;
}

/* PRISM Climate Controls */
.month-control-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.month-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.month-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.play-btn:hover {
    background: #1976D2;
}

.play-btn.playing {
    background: #f44336;
}

.play-btn.playing .fa-play:before {
    content: "\f04c"; /* FontAwesome pause icon */
}

.month-slider {
    flex: 1;
    height: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    border-radius: 2px;
}

.month-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #2196F3;
    cursor: pointer;
    border-radius: 50%;
}

.month-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #2196F3;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.month-display {
    min-width: 80px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.prism-update-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.prism-update-info small {
    color: #666;
    font-size: 11px;
}

/* ===== Soil Suitability Ratings ===== */
.suitability-tabs {
    padding: 5px 0;
}

.suitability-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.suitability-tab-btn {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.suitability-tab-btn:hover {
    background: #e0e0e0;
}

.suitability-tab-btn.active {
    background: #367fa9;
    color: white;
    border-color: #367fa9;
}

.suitability-tab-content h4 {
    font-size: 13px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.suitability-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suitability-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

.suitability-item:last-child {
    border-bottom: none;
}

.suitability-name {
    flex: 1;
    color: #333;
    padding-right: 10px;
}

.suitability-rating {
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
}

.rating-good {
    background: #d4edda;
    color: #155724;
}

.rating-fair {
    background: #fff3cd;
    color: #856404;
}

.rating-limited {
    background: #ffeeba;
    color: #856404;
}

.rating-poor {
    background: #f8d7da;
    color: #721c24;
}

.rating-not-rated {
    background: #e9ecef;
    color: #6c757d;
}