/* Main styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: 600;
}

h2 {
    text-align: center;
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 500;
}

/* Info and measurements tables */
.info-table, .measurements-table {
    margin: 0 auto;
    width: 100%;
    max-width: 650px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 0.95em;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #3a516e;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4a6fa5;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.button:hover {
    background-color: #3a5a80;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Grafana iframe styles */
.grafana-iframe-container {
    margin: 30px auto;
    max-width: 1400px;
    text-align: center;
    padding: 0 20px;
}

.grafana-iframe-container h2 {
    margin-bottom: 20px;
    color: #3a516e;
}

.iframe-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
}

.iframe-grid iframe {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    width: 450px;
    height: 200px;
}

/* Legend styles - compact and cozy */
.legend-container {
    margin-top: 25px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 8px;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #e0e0e0;
}

.legend-toggle {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 200px;
    margin: 5px auto;
}

.legend-toggle:hover {
    background-color: #3a5a80;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.legend-content {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.legend-column {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.legend-column h4 {
    margin: 5px 0 8px 0;
    text-align: center;
    color: #3a516e;
    font-size: 0.9em;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.legend-item {
    padding: 6px 8px;
    margin: 3px 0;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    font-size: 0.8em;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.legend-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Color classes for legend */
.dark-green { background-color: #2e7d32; color: white; }
.light-green { background-color: #a5d6a7; }
.green { background-color: #4caf50; color: white; }
.yellow { background-color: #fff59d; }
.orange { background-color: #ffb74d; }
.red { background-color: #e53935; color: white; }
.blue { background-color: #1565c0; color: white; }
.light-blue { background-color: #bbdefb; }

/* Responsive adjustments */
@media (max-width: 1500px) {
    .iframe-grid {
        max-width: 950px;
    }
}

@media (max-width: 1000px) {
    .iframe-grid {
        max-width: 450px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .legend-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    .iframe-grid iframe {
        width: 100%;
        max-width: 450px;
    }
}

@media (max-width: 480px) {
    .iframe-grid iframe {
        height: 180px;
        min-width: 0;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .legend-item {
        padding: 5px;
        font-size: 0.75em;
    }
    
    .legend-column h4 {
        font-size: 0.85em;
    }
    
    .button, .legend-toggle {
        font-size: 0.85em;
        padding: 6px 12px;
    }
}
