body {
    font-family: 'Inter', sans-serif;
    background-color: #eef2f7;
}
.card {
    background-color: white;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.07), 0 2px 8px -1px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    overflow: visible; 
    position: relative; 
    width: 100%;
    margin: 0;
}
.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 24px -3px rgba(0, 0, 0, 0.1), 0 8px 12px -2px rgba(0, 0, 0, 0.06);
}
.filter-section, .plot-view-content-box, .submission-view-content-box { 
    background-color: white;
    border-radius: 0.75rem; /* rounded-xl */
    padding: 1.5rem 2rem;
    box-shadow: 0 6px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
}
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}
.detail-item {
    background-color: #f8f9fa;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    border: 1px solid #e9ecef;
}
.detail-item strong { color: #343a40; }

.icon {
    width: 20px; height: 20px;
    margin-right: 0.5rem;
    fill: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
}
.detail-item .icon { color: #495057; width: 18px; height: 18px; }
.primary-info-icon-container .icon { color: #3b82f6; }

select, input[type="text"], input[type="number"], textarea {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
input[type="range"]:disabled::-webkit-slider-thumb {
    background: #9ca3af; 
    cursor: not-allowed;
}
input[type="range"]:disabled::-moz-range-thumb {
    background: #9ca3af; 
    cursor: not-allowed;
}
input[type="number"]:disabled {
    background-color: #f3f4f6; 
    cursor: not-allowed;
}


::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #a8a8a8; border-radius: 10px; border: 2px solid #f1f1f1; }
::-webkit-scrollbar-thumb:hover { background: #777; }

.message-box-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.message-box-overlay.active { opacity: 1; visibility: visible; }
.message-box-content { background-color: white; padding: 2rem; border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); text-align: left; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;}
.message-box-content h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1.25rem; font-weight: 600; color: #1f2937; text-align: center;}
.message-box-content p { margin-bottom: 1.5rem; color: #4b5563; }
.message-box-button { background-color: #3b82f6; color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 0.375rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s; display: block; margin-left: auto; margin-right: auto;}
.message-box-button:hover { background-color: #2563eb; }
.ai-insights-button {
    background-color: #8b5cf6; /* Purple-500 */
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block; /* Or block with margin auto for centering */
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.ai-insights-button:hover {
    background-color: #7c3aed; /* Purple-600 */
}
.ai-insights-button:disabled {
    background-color: #a78bfa; /* Purple-300 */
    cursor: not-allowed;
}
#aiInsightsContent {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f9fafb; /* gray-50 */
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb; /* gray-200 */
    min-height: 50px;
    white-space: pre-wrap; /* Preserve line breaks from API */
}
.loading-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #8b5cf6; /* Purple */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0.5rem auto; /* Center spinner */
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.card-section-title { font-size: 0.95rem; font-weight: 600; color: #111827; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.3rem; margin-bottom: 0.75rem; }

.numeric-filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.numeric-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.numeric-filter-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}
.histogram-container {
    width: 100%;
    height: 40px;
    margin-bottom: 8px;
    background-color: #f9fafb;
    border-radius: 0.25rem;
    border: 1px solid #e5e7eb;
}
.histogram-container svg {
    display: block;
    width: 100%;
    height: 100%;
}
.range-slider-container {
    position: relative;
    height: 20px; 
    margin-bottom: 0.5rem;
}
.range-slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 20px; 
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none; 
    margin:0;
}
.range-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto; 
    margin-top: 1px; 
}
.range-slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    pointer-events: auto;
}
.slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background-color: #d1d5db; 
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: -1; 
}
 .slider-progress {
    position: absolute;
    height: 6px;
    background-color: #3b82f6; 
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0; 
}

.range-inputs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.range-inputs-container input[type="number"] {
    width: calc(50% - 0.75rem); 
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
}
.range-inputs-container span { color: #6b7280; } 

.current-range-display {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.25rem;
    text-align: center;
}
.numeric-filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) { 
    .numeric-filters-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}
@media (min-width: 1024px) { 
    .numeric-filters-grid {
        grid-template-columns: repeat(3, 1fr); 
    }
}


.numeric-filters-toggle-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 0; 
    font-size: 1.125rem; 
    font-weight: 500; 
    color: #374151; 
    background: none;
    border: none;
    border-top: 1px solid #e5e7eb; 
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}
.numeric-filters-toggle-button:hover {
    color: #1d4ed8; 
}
.numeric-filters-toggle-button .arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease-in-out;
}
.numeric-filters-pane {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding-top 0.5s ease-in-out; 
    padding-top: 0;
}
.numeric-filters-pane.open {
    max-height: 2000px; 
    padding-top: 1rem;
}
.numeric-filters-inner-content { 
    padding-bottom: 0.5rem; 
}

.numeric-filters-toggle-button.open .arrow-icon { 
     transform: rotate(180deg);
}

.filter-category-title {
    font-size: 1rem; 
    font-weight: 600; 
    color: #4b5563; 
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #d1d5db; 
}
.numeric-filters-inner-content > div:first-child > .filter-category-title {
    margin-top: 0; 
}

.image-container-with-overlay {
    position: relative;
    width: 100%;
    height: 208px; 
    overflow: hidden; 
    border-radius: 0.5rem; 
    margin-bottom: 1.25rem; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); 
}
.image-container-with-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}
.image-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
    color: white;
    padding: 0.75rem; 
    text-align: left;
}
.image-text-overlay .manufacturer {
    font-size: 1.125rem; 
    font-weight: 600; 
    display: block;
    line-height: 1.2;
}
.image-text-overlay .model {
    font-size: 1rem; 
    font-weight: 500; 
    display: block;
    line-height: 1.2;
}
/* Table Styles */
#aircraftTableContainer {
    overflow-x: auto; 
}
.aircraft-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem; 
    font-size: 0.875rem; 
}
.aircraft-table th, .aircraft-table td {
    border: 1px solid #e5e7eb; 
    padding: 0.75rem 1rem; 
    text-align: left;
    white-space: nowrap; 
}
.aircraft-table th {
    background-color: #f3f4f6; 
    font-weight: 600; 
    color: #374151; 
}
.aircraft-table tbody tr:nth-child(even) {
    background-color: #f9fafb; 
}
.aircraft-table tbody tr:hover {
    background-color: #eff6ff; 
}
/* Checkbox for plotting */
.plot-checkbox {
    position: absolute;
    top: 0.75rem; /* p-3 */
    right: 0.75rem; /* p-3 */
    width: 1.25rem; /* w-5 */
    height: 1.25rem; /* h-5 */
    accent-color: #3b82f6; /* blue-500 */
    z-index: 10; /* Ensure it's above image overlay */
}
.aircraft-table .plot-checkbox-cell {
    width: 40px; /* Fixed width for checkbox column */
    text-align: center;
}
.aircraft-table .plot-checkbox-cell input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #3b82f6;
}
/* Plot View Styles */
#scatterPlotContainer {
    width: 100%;
    min-height: 400px; /* Adjust as needed */
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-top: 1rem;
    position: relative; /* Needed for positioning the card overlay */
}
#scatterPlotContainer svg {
    display: block;
    width: 100%;
    height: 100%;
}
#plotCardOverlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.3);
    display: none; 
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 20;
}
#plotCardOverlay.flex {
    display: flex;
}
#plotCardOverlay > .card {
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}
.plot-popup-card .icon {
    width: 18px !important; 
    height: 18px !important;
}
.plot-tooltip {
    position: absolute;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    background: #374151; /* gray-700 */
    color: white;
    border-radius: 0.375rem;
    pointer-events: none; /* To prevent interference with mouse events on plot points */
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 30;
}
/* Clickable data styles */
.clickable-filter {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent; /* Initially transparent */
    transition: text-decoration-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.clickable-filter:hover {
    text-decoration-color: #3b82f6; /* blue-500 */
    color: #2563eb; /* blue-600 for slightly darker hover */
}

/* Submission Page Specific Styles */
#submissionTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.875rem;
}
#submissionTable th, #submissionTable td {
    border: 1px solid #d1d5db; /* gray-300 */
    padding: 0.5rem;
    text-align: left;
}
#submissionTable th {
    background-color: #f3f4f6; /* gray-100 */
}
#submissionTable input[type="text"], #submissionTable input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}
.action-button {
     background-color: #10b981; /* emerald-500 */
     color: white;
     padding: 0.5rem 1rem;
     border-radius: 0.375rem;
     font-weight: 500;
     cursor: pointer;
     transition: background-color 0.2s;
     margin-right: 0.5rem;
}
.action-button:hover {
    background-color: #059669; /* emerald-600 */
}
.action-button.remove {
    background-color: #ef4444; /* red-500 */
}
.action-button.remove:hover {
    background-color: #dc2626; /* red-600 */
}
.close-plot-card-btn {
    width: 1.25rem; /* w-5 */
    height: 1.25rem; /* h-5 */
    padding: 0.25rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-plot-card-btn:hover {
    background-color: #e5e7eb;
}

.card-view-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}
.card {
    width: 100%;
    margin: 0;
}

.card-value-clickable {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}
.card-value-clickable:hover, .card-value-clickable:focus {
    text-decoration: underline;
    color: #2563eb; /* blue-600 for accessibility */
}

.choices__list--dropdown, .choices__list[aria-expanded] {
  z-index: 10000 !important;
}

/* Image Modal Styles */
#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#imageModal:not(.hidden) {
    display: flex;
}

#imageModal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

#closeModalButton {
    position: absolute;
    top: 0;
    right: 0;
    color: white;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0;
    transition: color 0.2s, background 0.2s;
    z-index: 10;
}

#closeModalButton:hover {
    color: #e5e7eb;
    background: rgba(0,0,0,0.7);
}

/* Make aircraft images clickable */
.aircraft-image {
    cursor: pointer;
    transition: transform 0.2s;
}

.aircraft-image:hover {
    transform: scale(1.02);
}