/* Style for the popup container */
.leaflet-popup-content {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    text-align: center;
    position: relative;
}

/* Style for popup header with title and button */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 10px;
    margin-bottom: 10px;
}

/* Style for the title */
.leaflet-popup-content b {
    font-size: 16px;
    color: #007BFF;
    flex: 0 1 auto;
    text-align: left;
    word-break: break-word;
    overflow: hidden;
}

/* Style for the image */
.leaflet-popup-content img {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
    max-width: 100%;
    height: auto;
}

/* Style for the date and category badge */
.leaflet-popup-content .date {
    font-size: 12px;
    color: #555;
}

/* Category and Date Badge */
.material-info-badge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: linear-gradient(135deg, #d0d0d0 0%, #e0e0e0 100%);
    color: #333;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.material-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-category-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.material-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-datetime-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.material-note {
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-note-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Spectrum Details Button */
.spectrum-details-button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.spectrum-details-button:hover {
    background-color: #0056b3;
}

/* Spectrum Modal Styles */
.spectrum-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.spectrum-modal.active {
    display: flex;
}

.spectrum-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 95%;
    max-width: 2000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Modal Header */
.spectrum-modal-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    gap: 10px;
    position: relative;
}

.spectrum-modal-title {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.spectrum-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    right: 15px;
}

.spectrum-modal-close:hover {
    color: #222;
    background: #e9ecef;
}

/* Navigation buttons */
.spectrum-nav-button {
    background-color: #007BFF;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.spectrum-nav-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.spectrum-nav-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.spectrum-nav-prev {
    margin-right: 0;
}

.spectrum-nav-next {
    margin-left: 10px;
}

/* Tabs */
.spectrum-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    background-color: #f8f9fa;
    padding: 10px;
    gap: 5px;
}

.spectrum-tab-button {
    flex: 1;
    padding: 12px 20px;
    background-color: #e9ecef;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
}

.spectrum-tab-button:hover {
    background-color: #dee2e6;
}

.spectrum-tab-button.active {
    background-color: #007BFF;
    color: white;
}

/* Tab Content */
.spectrum-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.spectrum-tab-pane {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.spectrum-tab-pane.active {
    display: flex;
    flex-direction: column;
    position: relative;
}

#spectrum-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
}

/* Modal Material Info Badge */
.modal-material-info-badge {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(135deg, #d0d0d0 0%, #e0e0e0 100%);
    color: #333;
    padding: 10px 12px;
    margin: 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    align-items: flex-start;
    min-width: 200px;
    flex-shrink: 0;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.image-badge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

#spectra-plot,
#mean-plot {
    flex: 1;
    min-height: 500px;
}