:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --accent-color: #50c878;
    --text-color: #2c3e50;
    --text-light: #6c757d;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-radius: 16px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;

    /* Glassmorphism variables */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-light: rgba(255, 255, 255, 0.25);
    --glass-bg-dark: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(10px);
    --text-on-glass: #ffffff;
    --text-on-glass-secondary: rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Avenir Light', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    font-weight: 400;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Homepage Styles */
.homepage {
    min-height: 100vh;
}

.hero-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9)),
                url('steamcity-official.jpg') center/cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
}

.hero-stats .stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.cta-button {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--box-shadow);
    margin-top: 30px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
    background: linear-gradient(45deg, #3a7bd5, #50c878);
}


/* Features Section */
.features-section {
    padding: 5rem 0;
    background: white;
}

.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.protocol-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 4px solid;
    position: relative;
}

.protocol-card:hover {
    transform: translateY(-5px);
}

.protocol-card.environmental {
    border-top-color: #27ae60;
}

.protocol-card.energy {
    border-top-color: #f39c12;
}

.protocol-card.mobility {
    border-top-color: #3498db;
}

.protocol-card.governance {
    border-top-color: #e74c3c;
}

.protocol-card.technology {
    border-top-color: #9b59b6;
}

/* CTA Card Special Styling */
.protocol-card.cta-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top: 4px solid #ffd700;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

.protocol-card.cta-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
}

.protocol-card.cta-card .protocol-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.protocol-card.cta-card h3 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.protocol-card.cta-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-cta-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 0.5rem;
}

.card-cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.protocol-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.protocol-card p {
    color: #666;
    line-height: 1.6;
}

/* Homepage Footer */
.homepage-footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ffd700;
}

.eu-logo {
    width: 150px;
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.85rem;
    line-height: 1.4;
}

.partners-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem 1rem;
    margin-top: 0.5rem;
}

.partners-list a {
    color: #a8c8ec;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 0.3rem 0;
}

.partners-list a:hover {
    color: #ffd700;
    text-decoration: underline;
    transform: translateX(5px);
}

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

.modal-content {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    margin: 15% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--glass-shadow);
    color: var(--text-on-glass);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: black;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content input {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    transition: var(--transition);
}

.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.modal-content input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.modal-content button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Main App Styles */
#main-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 1.5rem 2rem;
    color: var(--text-on-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.app-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.title-container {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.app-title {
    margin: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.title-main {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.title-sub {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -0.2rem;
}

.title-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.3px;
}


.main-nav {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem;
}

.nav-button {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-on-glass);
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    letter-spacing: 0.3px;
}

.nav-button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    transform: translateY(-1px);
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-button.active:hover {
    background: linear-gradient(135deg, #3a7bd5, #50c878);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(74, 144, 226, 0.5);
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

/* App Main Content */
.app-main {
    flex: 1;
    position: relative;
    background: #f8f9fa;
}

.view {
    display: none;
    height: 100%;
    width: 100%;
    position: relative;
}

.view.active {
    display: block;
}


/* Map View */
#map-view {
    overflow: hidden;
}

#map-view.active {
    display: flex;
    height: calc(100vh - 140px);
}

.map-controls {
    width: 300px;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    overflow-y: auto;
    border-radius: var(--border-radius);
    margin: 1rem 1rem 0 1rem;
    height: calc(100% - 1rem);
    color: var(--text-on-glass);
}

.filter-panel h3 {
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    font-size: 1.2rem;
}

#protocol-filter, #experiments-protocol-filter {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    font-weight: 500;
    transition: var(--transition);
}

#protocol-filter:focus, #experiments-protocol-filter:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

#protocol-filter option, #experiments-protocol-filter option {
    background: var(--primary-color);
    color: white;
}

/* Center Map Button */
.center-map-button {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-on-glass);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
    box-shadow: var(--glass-shadow);
}

.center-map-button:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

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

.legend {
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    padding: 0.6rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-weight: 500;
    text-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-item.clickable {
    cursor: pointer;
    user-select: none;
}

.legend-item.clickable:hover {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transform: translateX(2px);
    border: 1px solid var(--glass-border);
}

.legend-item.active {
    background-color: rgba(102, 126, 234, 0.2);
    border-left: 3px solid #667eea;
    padding-left: 0.5rem;
    font-weight: 600;
}

.legend-item.active .legend-color {
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    transform: scale(1.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-right: 0.8rem;
    flex-shrink: 0;
    display: block;
}

.legend-color.all-colors {
    background: conic-gradient(
        #e74c3c 0deg 72deg,
        #27ae60 72deg 144deg,
        #3498db 144deg 216deg,
        #f39c12 216deg 288deg,
        #9b59b6 288deg 360deg
    );
    position: relative;
    overflow: hidden;
}

.interactive-map {
    flex: 1;
    position: relative;
}

/* Floating Center Map Button */
.center-map-floating {
    position: absolute;
    bottom: 30px;
    left: 10px;
    z-index: 1000;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-map-floating:hover {
    background: #f4f4f4;
}

.center-map-floating:active {
    background: #f4f4f4;
}

#map {
    width: 100%;
    height: 100%;
}

/* Experiment Detail View */
#experiment-detail-view {
    padding: 2rem;
}

/* Sensor Detail View */
#sensor-detail-view {
    padding: 2rem;
}

.sensor-title-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    color: #333;
}

.sensor-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.sensor-specifications-section,
.sensor-status-section,
.sensor-location-section,
.sensor-calibration-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

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

.sensor-type {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

.sensor-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.sensor-status.status-active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.sensor-status.status-maintenance {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.sensor-status.status-offline {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.sensor-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.specifications-content,
.status-content,
.location-content,
.calibration-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sensor-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

#sensor-chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    position: relative;
}

#sensorChart {
    width: 100% !important;
    height: 100% !important;
}

.sensor-chart-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Experiment charts section - uniform styling with sensor charts */
.charts-section {
    margin-top: 2rem;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

.charts-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

#experiment-charts {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    position: relative;
}

/* Charts controls styling */
.charts-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-filter-controls {
    display: flex;
    gap: 0.5rem;
}

.time-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(79, 172, 254, 0.3);
    background: transparent;
    color: #4facfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.time-filter-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    border-color: rgba(79, 172, 254, 0.5);
}

.time-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.open-data-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.open-data-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}


.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.detail-label {
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    margin-right: 1rem;
    min-width: 120px;
}

.detail-value {
    color: #333;
    text-align: right;
    flex-grow: 1;
    word-break: break-word;
}

.detail-item.highlight-measurement {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    margin: 0.25rem 0;
    border-left: 4px solid var(--primary-color);
}

.detail-value.measurement-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.detail-item.highlight-measurement {
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.detail-item.highlight-measurement .detail-value.measurement-value {
    font-size: 1.2rem;
    font-weight: 800;
}

/* Responsive design for sensor details */
@media (max-width: 768px) {
    .sensor-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #sensor-detail-view {
        padding: 1rem;
    }

    .sensor-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: auto;
        margin-right: 0;
    }

    .detail-value {
        text-align: left;
    }
}

.detail-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.back-button {
    background: #667eea;
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.back-button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#experiment-info {
    margin-top: 0.5rem;
}

.experiment-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.experiment-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.experiment-section h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.experiment-section p {
    margin: 0;
    line-height: 1.6;
}

.detail-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.experiment-title-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    color: #333;
}

/* Two-column layout for experiment details */
.experiment-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.title-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.experiment-title-section h2 {
    margin: 0;
    color: #333;
}

.sensors-section, .charts-section, .methodology-section, .hypotheses-section, .conclusions-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
    flex: 1;
}

/* Charts section spans full width */


.sensors-section h3, .charts-section h3, .methodology-section h3, .hypotheses-section h3, .conclusions-section h3 {
    margin-bottom: 1rem;
    color: #333;
    text-shadow: none;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    font-weight: 600;
}

/* Content styling for new sections */
.methodology-content, .hypotheses-content, .conclusions-content {
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.methodology-content {
    border-left: 3px solid #17a2b8;
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.05) 0%, transparent 100%);
}

.hypotheses-content {
    border-left: 3px solid #ffc107;
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.05) 0%, transparent 100%);
}

.conclusions-content {
    border-left: 3px solid #28a745;
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, transparent 100%);
}

/* Responsive design for experiment details */
@media (max-width: 768px) {
    .experiment-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-content {
        padding: 0.5rem;
    }

    .left-column, .right-column {
        gap: 1rem;
    }

    .sensors-section, .methodology-section, .hypotheses-section, .conclusions-section, .charts-section {
        padding: 1rem;
    }

    .methodology-content, .hypotheses-content, .conclusions-content {
        font-size: 0.9rem;
        padding-left: 0.75rem;
    }
}

.sensors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.sensor-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    position: relative;
}

.sensor-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.sensor-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border-color: rgba(102, 126, 234, 0.4);
}

.sensor-card .click-hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    color: #667eea;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sensor-card.clickable:hover .click-hint {
    opacity: 1;
}

/* Experiment link in sensor detail view */
.experiment-link-container {
    margin-top: 1rem;
}

.experiment-link-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.experiment-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.sensor-card h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.sensor-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.sensor-unit {
    font-size: 0.9rem;
    color: #666;
}

/* New sensor metadata styles */
.sensor-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.sensor-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-online {
    color: #28a745;
}

.status-offline {
    color: #dc3545;
}

.status-warning {
    color: #ffc107;
}

.sensor-battery {
    font-size: 0.8rem;
    color: #666;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-planned {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.status-ongoing {
    background-color: rgba(255, 165, 0, 0.1);
    color: #ff8c00;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.status-finished {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.status-archived {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-cancelled {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Experiments View */
#experiments-view {
    padding: 2rem;
    background: transparent;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
}

.view-header h2 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.experiment-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    cursor: pointer;
    transition: var(--transition);
    border-top: 4px solid;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.experiment-card:hover {
    transform: translateY(-5px);
    background: var(--glass-bg-light);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.experiment-card.environmental {
    border-top-color: #27ae60;
}

.experiment-card.energy {
    border-top-color: #f39c12;
}

.experiment-card.mobility {
    border-top-color: #3498db;
}

.experiment-card.governance {
    border-top-color: #e74c3c;
}

.experiment-card.technology {
    border-top-color: #9b59b6;
}

.experiment-card h3 {
    margin-bottom: 0.8rem;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sensor-indicator {
    font-size: 1rem;
    opacity: 0.8;
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.sensor-filter-section {
    margin-top: 1rem;
}

.sensor-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--border-radius) / 2);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: #333;
    font-family: inherit;
}

.sensor-filter-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sensor-filter-btn[data-active="true"] {
    border: 1px solid var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    color: #333;
}

.sensor-filter-btn[data-active="true"]:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* Data View Filters */
.data-filter-panel {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1rem 0 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Search-like filter activation */
.filter-search-box {
    margin: 1.5rem 0;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.search-input-container:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-icon {
    margin-right: 0.8rem;
    font-size: 1.1rem;
    opacity: 0.7;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.filter-count {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.8rem;
}

/* Statistical indicators panel */
.stats-panel {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1rem 0 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}


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

.stats-panel h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Statistics by sensor */
.stats-by-sensor {
    margin-bottom: 2rem;
}

.sensor-stats-section {
    margin-bottom: 2rem;
}

.sensor-stats-header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.sensor-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.sensor-header-content {
    flex: 1;
}

.sensor-stats-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.3rem 0;
}

.sensor-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.3;
    font-style: italic;
}

.sensor-unit {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    flex-shrink: 0;
    margin-top: 0.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Global stats section */
.global-stats {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.global-stats h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.global-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.basic-data-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.basic-data-filters .filter-group {
    flex: 1;
    min-width: 200px;
}

.apply-filters-btn {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.apply-filters-btn:hover {
    background: #3a7bc8;
    border-color: #3a7bc8;
}

.clear-filters-btn {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.4);
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.clear-filters-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.6);
}


.experiment-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.experiment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    margin-top: auto;
}

.experiment-location {
    font-weight: 500;
}

.protocol-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    display: inline-block;
    text-align: center;
    min-width: 1.5rem;
    cursor: help;
}

.protocol-badge.environmental {
    background: #27ae60;
}

.protocol-badge.energy {
    background: #f39c12;
}

.protocol-badge.mobility {
    background: #3498db;
}

.protocol-badge.governance {
    background: #e74c3c;
}

.protocol-badge.technology {
    background: #9b59b6;
}

.protocol-name {
    font-weight: 600;
    color: var(--text-color);
}

/* Experiments Filter Panel */
.experiments-filter-panel {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1rem 0 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

.experiments-filter-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
    text-shadow: none;
}

.experiments-filter-panel h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
    color: #333;
    font-weight: 600;
    text-shadow: none;
}

.filters-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-group select {
    padding: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    min-width: 180px;
    width: 180px;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    background: #f8f9fa;
}

.filter-group select option {
    background: white;
    color: #333;
}

.clear-filters-btn {
    padding: 0.8rem 1.2rem;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 6px;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.clear-filters-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.6);
}

/* Filter sections */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Collapsible filter sections */
.filter-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: var(--transition);
    padding: 0.5rem 0;
    color: #333 !important;
    font-weight: 600;
}

.filter-toggle:hover {
    color: #667eea !important;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.toggle-icon.rotated {
    transform: rotate(90deg);
}

.filter-content {
    padding-top: 0.25rem;
    transition: all 0.3s ease;
}

.filter-content.show {
    display: block !important;
}

/* Date inputs styling */
.filter-group input[type="date"] {
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.9rem;
    min-width: 150px;
    transition: var(--transition);
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.7);
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Filter header - title and more filters button on same line */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    text-shadow: none;
}

.more-filters-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
}

.more-filters-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.6);
}

.more-filters-btn .toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.more-filters-btn .toggle-icon.rotated {
    transform: rotate(90deg);
}

/* Additional filters container */
.additional-filters {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Filter actions */
.filter-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.experiments-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.experiments-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--border-radius) / 2);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: #333;
}

.experiments-legend .legend-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.experiments-legend .legend-item.active {
    border: 1px solid var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    color: #333;
}

.experiments-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
}

.experiments-legend .legend-color.all-colors {
    background: conic-gradient(
        #e74c3c 0deg 72deg,
        #27ae60 72deg 144deg,
        #3498db 144deg 216deg,
        #f39c12 216deg 288deg,
        #9b59b6 288deg 360deg
    );
}

/* Sensors View */
#sensors-view {
    padding: 2rem;
    background: transparent;
}

.sensors-filter-panel {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1rem 0 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Remove duplicate - now using .view-header */

/* Loading message */
.loading-message {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #666;
    margin-top: 2rem;
}

.loading-message::before {
    content: '⏳';
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.sensors-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.sensor-device-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border-left: 4px solid var(--primary-color);
}

.sensor-device-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.sensor-device-card.active {
    border-left-color: #28a745;
}

.sensor-device-card.maintenance {
    border-left-color: #ffc107;
}

.sensor-device-card.offline {
    border-left-color: #dc3545;
}

.sensor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.sensor-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.sensor-card-type {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.sensor-card-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    white-space: nowrap;
}

.sensor-card-status.active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.sensor-card-status.maintenance {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.sensor-card-status.offline {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.sensor-card-body {
    margin-bottom: 1rem;
}

.sensor-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.sensor-card-info strong {
    color: #333;
}

.sensor-current-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.sensor-last-update {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.sensor-card-location {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.sensor-card-actions {
    display: flex;
    gap: 0.5rem;
}

.sensor-action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    flex: 1;
    text-align: center;
}

.sensor-action-btn:hover {
    background: #3a7bc8;
    border-color: #3a7bc8;
    transform: translateY(-1px);
}

.sensor-action-btn.secondary {
    background: white;
    color: var(--primary-color);
    border-color: rgba(102, 126, 234, 0.4);
}

.sensor-action-btn.secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
}

/* Sensor Detail Modal */
.sensor-detail-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.sensor-modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sensor-modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sensor-modal-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.sensor-modal-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

.sensor-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.sensor-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.sensor-modal-body {
    padding: 2rem;
}

.sensor-modal-section {
    margin-bottom: 2rem;
}

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

.sensor-modal-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.sensor-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sensor-spec-item {
    background: rgba(248, 249, 250, 0.8);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.sensor-spec-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sensor-spec-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.sensor-chart-container {
    height: 300px;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

/* No data message */
.no-sensors-message {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #666;
    margin-top: 2rem;
}

.no-sensors-message h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.no-sensors-message p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsive design for sensors view */
@media (max-width: 768px) {
    .sensors-filter-panel {
        padding: 1rem;
        margin: 0.5rem 0 1.5rem 0;
    }

    .filters-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
        min-width: auto;
    }

    .sensors-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sensor-modal-content {
        width: 95%;
        margin: 1rem;
    }

    .sensor-modal-header, .sensor-modal-body {
        padding: 1.5rem;
    }

    .sensor-specs-grid {
        grid-template-columns: 1fr;
    }
}

/* Data View */
#data-view {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Force hide data view elements when not active */
#data-view:not(.active) {
    display: none !important;
}

#data-view:not(.active) * {
    display: none !important;
    visibility: hidden !important;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-controls select {
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.chart-controls select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.chart-controls select option {
    background: var(--primary-color);
    color: white;
}

#chart-container {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1rem 0 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #333;
    flex: 0 0 auto;
}

#dataChart {
    width: 100% !important;
    height: 100% !important;
}

/* Map Popup Styles */
.map-popup h4 {
    margin-bottom: 0.8rem;
    color: #333;
    font-size: 1.1rem;
}

.map-popup p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.popup-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    transition: all 0.3s ease;
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 1rem;
}

.leaflet-popup-tip {
    background: white;
}

/* Chart container for experiment detail */
#experiment-mini-chart {
    height: 500px !important;
}

/* Additional experiment detail styles */
.experiment-meta p {
    margin-bottom: 0.8rem;
}

.experiment-meta strong {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .protocols-grid {
        grid-template-columns: 1fr;
    }

    .app-header {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
    }

    #map-view {
        flex-direction: column;
        height: auto;
    }

    .map-controls {
        width: 100%;
        height: auto;
    }

    .detail-content {
        grid-template-columns: 1fr;
    }

    .experiments-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .nav-button {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .header-left {
        gap: 1rem;
    }

    .app-logo {
        width: 45px;
        height: 45px;
    }

    .title-main {
        font-size: 1.4rem;
    }

    .title-sub {
        font-size: 0.85rem;
    }

    .title-tagline {
        font-size: 0.7rem;
    }

    .sensors-grid {
        grid-template-columns: 1fr;
    }

    .popup-button {
        width: 100%;
    }
}

/* Loading Screen Styles */
#loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

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

.loading-content h2 {
    margin-bottom: 0.5rem;
    font-weight: 300;
    font-size: 1.5rem;
}

.loading-content p {
    opacity: 0.8;
    font-size: 1rem;
}

/* Custom Chart Legend Styling */
.custom-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.custom-legend-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--border-radius) / 2);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0.25rem;
    user-select: none;
}

/* Data view header */

.view-details-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.view-details-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.view-details-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}