/* Color variables */

:root {
    --primary-color: #05b2fc;
    --secondary-color: #002186;
    --bg-color: #f0f6fa;
    --box-color-light: #ffffff;
    --box-color: #f4f2f2;
    --box-border-color: #5c718a;
    --text-color: #000821;
    --light-text-color: #5c718a;
    --accent-color: #4facfe;
    --text-dark-bg: #ffffff;
    --disabled-color: #cde1ee;
    --table-color-a: #f4f2f2;
    --table-color-b: #e0dfde;
    --breaking-red: #be232d;
    --accent-red: #ef6c6c;
    --acent-green: #63de9d;
    --accent-yellow: #fae000;



}

/* 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;
    line-height: 1.6;
    color: #333;
    background: var(--box-color);
    min-height: 100vh;
}



/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--box-color);
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--primary-color);
    color: var(--text-dark-bg);
    padding: 2rem 0;
    text-align: center;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.app-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Intro screen */
.intro-text {
    color: var(--light-text-color);
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 2;
}

.intro-text strong {
    font-weight: 900;
}

/* .intro-text p {
    line-height: 2;
} */

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 300;
    text-align: center;
    border: 1px solid var(--primary-color);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    background: var(--bg-color);
}



p.filter-warning {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    padding: 1rem 2rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 20%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Headers */
.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Start step specific header styling */
#step-start .step-header {
    margin-bottom: 3rem;
}

.step-header h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.step-header p {
    font-size: 1.1rem;
    color: var(--light-text-color);
}

/* Step Content */
.step-content {
    margin-bottom: 2rem;
}

/* Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.step-navigation.intro-screen {
    justify-content: center;
    border-top: none;
    padding: 0;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button.primary {
    background: var(--primary-color);
    color: var(--text-dark-bg);
}

.nav-button.primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.nav-button.secondary {
    background: var(--primary-color);
    color: white;
}

.nav-button.secondary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Start Step */
.start-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem); /* Account for main-content padding */
    text-align: center;
}

.feature-list, .data-sources {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-list h3, .data-sources h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature-list ul, .data-sources ul {
    list-style: none;
    padding-left: 0;
}

.feature-list li, .data-sources li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 1.5rem;
}

.feature-list li:before, .data-sources li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.feature-list li:last-child, .data-sources li:last-child {
    border-bottom: none;
}

.simple-link {
    color: #4facfe;
    text-decoration: none;
    font-weight: 500;
}

.simple-link:hover {
    text-decoration: underline;
}

/* Upload Step */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.change-file-btn {
    padding: 5px;
    margin: 10px;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--light-text-color);
}

.sample-data {
    margin-top: 2rem;
    text-align: center;
}

.sample-data h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.sample-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--box-border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--box-color-light);
    cursor: pointer;
}

.sample-select:focus {
    outline: none;
    border-color: var(--primary-color);

}

/* Filter Step */
.filter-container {
    margin-bottom: 2rem;
}

.data-preview {
    padding: 1.5rem;
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--box-color);
}

.filter-controls {
    padding: 1.5rem;
}

.filter-panel-title h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.section-header h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.filter-instructions {
    padding: 1rem;
    margin-bottom: 0.7em;
    text-align: left;
}

.filter-instructions p {
    margin-bottom: 0.5rem;
}

.filter-instructions p:last-child {
    margin-bottom: 0;
}

/* Area Step */
.area-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.area-controls {
    padding: 1.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--box-border-color);
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-group h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.control-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.control-button {
    background: #4facfe;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.control-button:hover {
    background: #3d8bfd;
    transform: translateY(-1px);
}

.area-map {
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

/* Main Controls and Preview Section */
.main-controls-preview {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    border-bottom: 1px solid var(--box-border-color);   
    padding-bottom: 1.5rem;
}

.resolution-controls {
    flex: 1;
    padding: 1.5rem;
    min-width: 0; /* Prevents flex item from overflowing */
}

.control-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--box-border-color);
}

.control-section.last-control {
    border-bottom: none;
    padding-bottom: 0;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.control-description {
    color: var(--light-text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.resolution-slider {
    margin-bottom: 1.5rem;
}

.resolution-slider input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: var(--light-text-color);
    outline: none;
    -webkit-appearance: none;
}

.resolution-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resolution-info {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.resolution-examples {
    padding: 1rem;
    border-radius: 8px;
}

.example-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--box-border-color);
}

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

.example-label {
    font-weight: 600;
    color: #2c3e50;
}

.example-desc {
    color: #6c757d;
}

.bin-controls {
    display: flex;
    margin-bottom: 1.5rem;
    flex-direction: column;
}

.bin-input-wrapper {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.bin-input {
    flex: 1;
}

.bin-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.bin-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.bin-input input:focus {
    outline: none;
    border-color: #4facfe;
}

.preview-container {
    flex: 1;
    padding: 1.5rem;
    min-width: 0; /* Prevents flex item from overflowing */
}

.preview-header {
    text-align: left;
    margin-bottom: 1rem;
}

.preview-header h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.preview-header p {
    color: #6c757d;
    font-size: 0.9rem;
}

.preview-map {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

/* Applied Configuration Summary */
.applied-config-summary {
    margin: 1rem 0;
    padding: 1rem;
    background: #e8f5e8;
    border-radius: 8px;
    border: 1px solid #c3e6c3;
    font-size: 0.9rem;
}

.applied-config-summary h5 {
    color: #2d5a2d;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.applied-config-summary p {
    color: #4a7c4a;
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
}

/* Current Configuration Section */
.current-config-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    font-size: 0.9rem;
}

.current-config-section h5 {
    color: #856404;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.current-config-section p {
    color: #856404;
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
}

/* Configuration Items */
.config-items {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    margin-bottom: 1rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.config-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-value {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.1rem;
}

.legend-container {
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Bin Preview */
.bin-preview {
    margin-top: 1rem;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.legend-value {
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
}

.bin-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Generate Section */
.generate-section {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
}

.generate-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.generate-button:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.generate-button:active {
    transform: translateY(0);
}

.generate-help {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Preview Controls - Within Preview Container */
.preview-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    align-items: flex-start;
}

.bin-preview-container {
    flex: 1;
    padding: 1.5rem;
    min-width: 0; /* Prevents flex item from overflowing */
}

.bin-preview-container h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}



.bin-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: inline-block;
    margin-left: 0.5rem;
}

/* Optimize bin preview for horizontal layout */
.bin-preview {
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.bin-preview li {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.bin-label {
    font-weight: 500;
    color: var(--text-color);
}

.bin-count {
    color: var(--light-text-color);
    font-size: 0.8rem;
    font-style: italic;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--box-color-light);
    border-radius: 8px;
    border: 1px solid var(--box-border-color);
    font-size: 0.9rem;
    min-width: fit-content;
}

.bin-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--box-border-color);
    margin-right: 10px;
}

.legend-value {
    font-weight: 600;
    color: var(--text-color);
}

.generate-section-compact {
    flex: 1;
    text-align: center;
    padding: 1rem;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Prominent Generate Section (keeping for reference) */
.generate-section-prominent {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.generate-header h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.generate-header p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.generate-button-prominent {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.generate-button-prominent:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.generate-button-prominent:active {
    transform: translateY(0);
}

/* Disabled state for when no changes are pending */
.generate-button-prominent:disabled {
    background: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.generate-button-prominent:disabled:hover {
    background: #6c757d;
    transform: none;
}

/* Changes Indicator */
.changes-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    font-size: 0.85rem;
    font-weight: 600;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: #f39c12;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Histogram Section - Separate from Preview Container */
.histogram-section {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 12px;
    flex: 1;
    text-align: center;
}

.histogram-section h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.histogram-section p {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;

}

/* Histogram Container */
.histogram-container {
    padding: 1rem;
}

.histogram-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.histogram-header h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.histogram-header p {
    color: var(--light-text-color);
    font-size: 0.9rem;
}

.histogram-instructions {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

.histogram-orange {
    color: #fde725;
    font-weight: 600;
}

.histogram-green {
    color: #35b779;
    font-weight: 600;
}

.histogram-svg {
    display: block;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Side-by-side histogram layout */
.histogram-wrapper {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

.histogram-title {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.histogram-chart {
    padding: 1rem;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Color Customization Styles */
.color-customization {
    margin-top: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--box-border-color);
    padding-bottom: 2rem;
}

.color-customization-header {
    display: flex;
    align-items: left;
    margin-bottom: 1rem;
    flex-direction: column;
}

.color-customization-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.color-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-direction: column;
    align-items: flex-end;
}

.color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.color-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-legend-item:hover {
    background-color: rgba(79, 172, 254, 0.1);
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.coloris-input {
    width: 80px;
    height: 32px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 0.75rem;
    background: #ffffff;
    padding: 4px 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.coloris-input:hover {
    cursor: pointer;
}

.coloris-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* Coloris field spacing */
.clr-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clr-field button {
    margin-right: 0.5rem;
}

.clr-field input {
    margin-left: 0.5rem;
}

.color-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
}

.color-picker-popup {
    position: absolute;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
}

.color-picker-popup h6 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #2c3e50;
}

.color-picker-input {
    width: 100%;
    height: 40px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
}

.color-picker-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.color-picker-actions button {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.clr-field input {
  min-width: 100px;
  text-align: left;
}

.copy-legend-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.copy-legend-btn:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

#reset-colors {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#reset-colors:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.copy-feedback {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-feedback.visible {
    opacity: 1;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.legend-header h4 {
    color: #2c3e50;
}

.palette-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.palette-controls label {
    font-size: 0.9rem;
    color: #495057;
}

.palette-controls input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Download Step */
.download-container {
    max-width: 800px;
    margin: 0 auto;
}

.download-info {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--box-border-color);
    padding-bottom: 2rem;
}

.info-item {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.5rem 0;
}

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

.info-label {
    font-weight: 600;
    color: #2c3e50;
}

.info-value {
    color: var(--light-text-colortext-color);
    font-weight: 600;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.download-option {
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}



.download-option h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.download-option p {
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
}

.download-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.download-button.primary {
    background: var(--secondary-color);
    color: white;
}

.download-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--secondary-color);
}
/* Responsive Design */
@media (max-width: 1200px) {
    .filter-container,
    .area-container,
    .resolution-container {
        grid-template-columns: 1fr;
    }
    
    .bin-controls {
        grid-template-columns: 1fr;
    }
    
    .download-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .step-header h2 {
        font-size: 2.5rem;
        color: var(--accent-color)
    }
    
    .nav-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

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

.visible {
    display: block !important;
}

/* Toast Notifications */
/* Update existing toast styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success {
    background: var(--acent-green);
}

.toast.error {
    background: var(--accent-red);
}

.toast.info {
    background: var(--primary-color);
}

.toast.warning {
    background: var(--accent-yellow);
    color: var(--text-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.loading {
    background: #17a2b8;
    min-width: 200px;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* ============================================================================
   DATA PREVIEW TABLE STYLES
   ============================================================================ */

   .preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header styling */
.preview-table thead {
    background: var(--primary-color);
    color: var(--text-dark-bg);
}

.preview-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

/* Zebra striping */
.preview-table tbody tr:nth-child(even) {
    background-color: var(--table-color-a);
}

.preview-table tbody tr:nth-child(odd) {
    background-color: var(--table-color-b);
}

/* Cell styling */
.preview-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--bg-color);
    vertical-align: top;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-info {
    margin-top: 20px;  
}

/* Table container - consolidated with above .data-preview rule */

.table-icon {
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
    font-weight: 300;
}

.column-header {
    min-width: 60px;
}

/* Filter popup styles */
.disabled {
    display: none;
}



/* ============================================================================
   FILTER POPUP STYLES
   ============================================================================ */

.filter-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 600px;
    height: 600px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

.filter-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--primary-color);
    color: white;
}

.filter-popup-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-filter-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-popup-content {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Filter Type Selector */
.filter-type-selector {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.filter-type-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.filter-type-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Filter Content */
.filter-content {
    margin-bottom: 24px;
}

/* Categorical Filter */
.categorical-filter .filter-summary {
    margin-bottom: 16px;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.categorical-filter .filter-summary span {
    color: #495057;
    font-size: 14px;
}

.more-indicator {
    color: #dc3545;
    font-size: 13px;
    font-style: italic;
}

.value-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 14px;
}

.filter-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.filter-checkbox span {
    color: #495057;
}

.filter-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.filter-actions button {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-actions button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Numeric Filter */
.numeric-filter .filter-summary {
    margin-bottom: 16px;
    padding: 12px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    color: #0056b3;
    font-size: 14px;
}

.range-inputs {
    display: flex;
    gap: 16px;
}

.range-inputs label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #495057;
}

.range-inputs input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Date Filter */
.date-filter .date-format-selector {
    margin-bottom: 16px;
}

.date-format-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.date-format-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.date-range {
    display: flex;
    gap: 16px;
}

.date-range label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #495057;
}

.date-range input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Filter Popup Actions */
.filter-popup-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.filter-popup-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-filter-btn {
    background: var(--primary-color);
    color: white;
}

.apply-filter-btn:hover {
    background: var(--primary-color-dark);
}

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

.clear-filter-btn:hover {
    background: #5a6268;
}

/* ============================================================================
   ACTIVE FILTERS DISPLAY
   ============================================================================ */

.active-filters-container {
    margin: 1rem 0;
    padding: 1rem;
    color: var(--light-text-color);
    /* background: var(--box-color);
       border-radius: 12px;
       border: 1px solid var(--accent-color); */
}

.active-filters-container h4 {
    color: var(--text-color);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.filter-tag .remove-filter:hover {
    background: var(--disabled-color);
}

.no-filters-message {
    color: var(--text-color);
    font-style: italic;
    margin: 0;
}

/* leaflet custom icons */
.my-marker-icon {
  width: 6px;             /* radius: 3 → diâmetro ≈ 6 */
  height: 6px;
  background: var(--secondary-color);    /* fillColor */
  border: 1px solid var(--bg-color); /* color + weight */
  border-radius: 50%;     /* deixa redondinho */
  opacity: 0.6;           /* fillOpacity */
}

/* Fix for missing Leaflet Draw rectangle icon */
.leaflet-draw-draw-rectangle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M2 2h12v12H2V2zm1 1v10h10V3H3z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 16px 16px !important;
}