/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: 'Source Code Pro', monospace;
    font-size: 10px;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.4;
    padding: 5px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
}

/* Header and Navigation */
.header {
    margin-bottom: 10px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.header-logos {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 5px 0;
}

/* Navigation */
.nav-list {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-item {
    display: inline-block;
}

.nav-link {
    display: inline-block;
    padding: 4px 8px;
    text-decoration: none;
    color: #6c757d;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 10px;
    font-family: 'Source Code Pro', monospace;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #e9ecef;
    color: #495057;
}

.nav-link.active {
    background-color: #FBD120;
    color: white;
    border-color: #FBD120;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

h1 { font-size: 16px; }
h2 { font-size: 14px; }
h3 { font-size: 12px; }
h4, h5, h6 { font-size: 11px; }

p {
    margin-bottom: 5px;
    font-size: 10px;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -2px;
    margin-bottom: 5px;
}

.col {
    flex: 1;
    padding: 0 2px;
}

.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Cards */
.card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px;
}

.card-body {
    padding: 5px;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

/* Table */
th,
td {
  border: 1px solid black;
  width: auto;
  padding-left: 5px;
  padding-right: 5px;
  overflow: hidden;
  text-align: center;
}

/* Forms */
.form-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #333;
}

.form-control, .form-select {
    display: block;
    width: 100%;
    height: 50%;
    padding: 3px 6px;
    font-size: 10px;
    font-family: 'Source Code Pro', monospace;
    color: #495057;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 2px;
    margin-bottom: 5px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.1rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 4px 8px;
    font-size: 10px;
    font-family: 'Source Code Pro', monospace;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    margin: 2px;
    transition: all 0.2s ease;
}

.btn-primary {
    color: white;
    background-color: #FBD120;
    border-color: #FBD120;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Radio Button Groups */
.radio-group {
    display: flex;
    align-items: center;
    margin: 3px 0;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    gap: 8px;
}

.radio-group-label {
    flex-shrink: 0;
    margin-bottom: 0 !important;
    margin-right: 8px;
    font-weight: 600;
    /* min-width: 120px; */
}

.form-check-inline {
    /* display: inline-block;
    margin-right: 8px;
    margin-bottom: 3px; */

    display: flex;
    margin-right: 1px;
    margin-bottom: 1px;
}

.form-check-input {
    margin-right: 3px;
}

.form-check-label {
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Source Code Pro', monospace;
}

.form-check-input:checked {
    background-color: #FBD120;
    border-color: #FBD120;
}

.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.1rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    padding: 6px 10px;
    margin-bottom: 5px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 10px;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

/* Plot container */
#timeseries-plot {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background-color: white;
}

/* Legend */
#custom-legend {
    max-height: calc(100% - 50px);
    overflow-y: auto;
    font-size: 10px;
    padding: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.legend-line {
    width: 20px;
    height: 2px;
    margin-right: 5px;
    flex-shrink: 0;
}

.legend-text {
    flex-grow: 1;
    min-width: 0;
}

.legend-name {
    font-size: 10px;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
}

.legend-unit {
    font-size: 9px;
    color: #6c757d;
    font-style: italic;
}

/* Layout heights */
.top-section {
    height: 22vh;
    min-height: 200px;
}

.bottom-section {
    height: 65vh;
    min-height: 500px;
}

.plot-container {
    height: 100%;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: #6c757d !important; font-size: 9px; }
.text-danger { color: #dc3545 !important; }
.text-white { color: white; }
.text-primary { color: #FBD120 !important; }
.text-decoration-none { text-decoration: none; }
.small { font-size: 9px; }
.x-small { font-size: 7px; }
.fw-bold { font-weight: 700; }
.h-100 { height: 100%; }
.w-100 { width: 100%; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 2px; }
.mb-2 { margin-bottom: 4px; }
.mb-3 { margin-bottom: 6px; }
.mb-4 { margin-bottom: 8px; }
.mb-5 { margin-bottom: 10px; }
.mt-2 { margin-top: 4px; }
.me-2 { margin-right: 4px; }
.ms-3 { margin-left: 6px; }
.p-3 { padding: 6px; }
.p-4 { padding: 8px; }
.py-5 { padding-top: 10px; padding-bottom: 10px; }
.rounded { border-radius: 3px; }
.rounded-circle { border-radius: 50%; }
.bg-light { background-color: #f8f9fa; }
.bg-primary { background-color: #FBD120; color: white; }
.bg-success { background-color: #198754; color: white; }
.bg-warning { background-color: #ffc107; color: black; }
.bg-info { background-color: #0dcaf0; color: black; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }


/* Custom styling for hotspots begin */
.custom-hotspot {
    width: 30px;
    height: 30px;
    background-color: rgba(255, 0, 0, 0.7);
    border: 3px solid white;
    border-radius: 50%;
    cursor: crosshair;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.custom-hotspot:hover {
    background-color: rgba(255, 0, 0, 1);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Style for the Pannellum tooltip */
.pnlm-tooltip {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-family: 'Source Code Pro', monospace !important;
    font-size: 12px !important;
    max-width: 50px !important;
    line-height: 1.4 !important;
}

/* Sensor info panel styling */
#sensor-info-panel {
    animation: fadeIn 0.3s ease;
}

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

#sensor-info-panel h3 {
    margin-top: 0;
    color: #007bff;
    font-family: 'Source Code Pro', monospace;
}

#sensor-info-panel strong {
    color: #495057;
}

/* Custom styling for hotspots end */

/* Responsive breakpoint classes */
.col-sm-6 { flex: 0 0 50%; max-width: 50%; }

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Home page specific */
.hover-shadow {
    transition: box-shadow 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Researcher photos */
.researcher-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #dee2e6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.researcher-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #FBD120;
}

.researcher-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Facility slideshow */
.facility-slideshow {
    width: 250px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
    transition: box-shadow 0.2s ease;
    position: relative;
}

.facility-slideshow:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #FBD120;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slideshow-images {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.slideshow-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

.slideshow-images img.active {
    display: block;
}

.slideshow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.slideshow-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slideshow-btn.prev {
    left: 5px;
}

.slideshow-btn.next {
    right: 5px;
}

.slideshow-dots {
    text-align: center;
    position: absolute;
    bottom: 8px;
    width: 100%;
    z-index: 10;
}

.slideshow-dot {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.slideshow-dot.active,
.slideshow-dot:hover {
    background-color: #FBD120;
}

/* Partner logos */
.partner-logo {
    width: 200px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.partner-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #FBD120;
}

.partner-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    object-position: center;
}

/* Seven-column layout for research team */
.col-team-member {
    flex: 0 0 14.285714%; /* 100% / 7 = ~14.29% */
    max-width: 14.285714%;
    padding: 0 2px;
}

@media (max-width: 1200px) {
    .col-team-member {
        flex: 0 0 20%; /* 5 per row on medium screens */
        max-width: 20%;
    }
}

@media (max-width: 768px) {
    .col-team-member {
        flex: 0 0 33.333333%; /* 3 per row on small screens */
        max-width: 33.333333%;
    }
}

@media (max-width: 576px) {
    .col-team-member {
        flex: 0 0 50%; /* 2 per row on extra small screens */
        max-width: 50%;
    }
}

.display-4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.lead {
    font-size: 12px;
    margin-bottom: 3px;
}

/* Lists */
ul, ol {
    margin-bottom: 5px;
    padding-left: 15px;
}

li {
    margin-bottom: 2px;
    font-size: 10px;
}

.list-unstyled {
    list-style: none;
    padding-left: 0;
}

/* Horizontal rule */
hr {
    margin: 5px 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 2px;
        font-size: 9px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .about-btn-header {
        font-size: 8px;
        padding: 2px 6px;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 2px;
    }
    
    .col-3, .col-4, .col-6, .col-8, .col-9 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 5px;
    }
    
    .top-section {
        height: 20vh;
        min-height: 100px;
    }
    
    .bottom-section {
        height: 60vh;
        min-height: 300px;
    }
    
    h1 { font-size: 14px; }
    h2 { font-size: 12px; }
    h3 { font-size: 11px; }
    h4, h5, h6 { font-size: 10px; }
}

/* Experiment details */
#experiment-details p {
    margin-bottom: 3px;
    font-size: 8px;
}

/* Removed empty ruleset for #filtered-experiments */

#series-dropdown {
    height: 150px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.5);
    }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 75%;
    max-width: 900px;
    max-height: 85vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #FBD120 0%, #f0c420 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e6b800;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    padding: 0 5px;
    border-radius: 3px;
}

.modal-close:hover,
.modal-close:focus {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.6;
}

.about-section h3 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #FBD120;
}

.about-section h3:first-child {
    margin-top: 0;
}

.about-section h4 {
    color: #555;
    font-size: 12px;
    font-weight: 600;
    margin: 15px 0 8px 0;
}

.about-section p {
    margin-bottom: 12px;
    font-size: 11px;
    color: #444;
    text-align: justify;
}

.about-section ul {
    margin: 10px 0 15px 0;
    padding-left: 20px;
}

.about-section li {
    margin-bottom: 8px;
    font-size: 11px;
    color: #444;
    line-height: 1.5;
}

.about-section li strong {
    color: #333;
    font-weight: 600;
}

.research-partners {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #FBD120;
    margin-top: 20px;
}

.research-partners h4 {
    margin-top: 0;
    color: #333;
}

/* Title section with About button */
.title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* About button styling */
.about-btn-header {
    background: none;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-family: 'Source Code Pro', monospace;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 3px;
    color: #6c757d;
    transition: all 0.2s ease;
    height: fit-content;
}

.about-btn-header:hover {
    background-color: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
        font-size: 10px;
        max-height: calc(95vh - 60px);
    }
    
    .about-section h3 {
        font-size: 13px;
    }
    
    .about-section h4 {
        font-size: 11px;
    }
    
    .about-section p,
    .about-section li {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .modal-header {
        padding: 10px 12px;
    }
    
    .modal-header h2 {
        font-size: 14px;
    }
    
    .modal-body {
        padding: 12px;
        font-size: 9px;
    }
    
    .about-section h3 {
        font-size: 12px;
    }
    
    .about-section h4 {
        font-size: 10px;
    }
    
    .about-section p,
    .about-section li {
        font-size: 9px;
    }
}