* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 100%;
    padding: 20px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.gauge-container {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-label {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
}

.gauge {
    position: relative;
    width: 250px;
    height: 250px;
    margin-bottom: 20px;
}

/* Gauge Body */
.gauge-body {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f0f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Farbiger Ring um das Manometer */
.gauge-color-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: circle(50%);
    opacity: 0.8;
    z-index: 1;
}

/* Spezifische Farben für Manometer 1 */
#gauge1-color {
    /* 
     * Für Manometer 1:
     * 0-400 bar mit Farbgrenzen bei:
     * Rot: 0-220 bar
     * Gelb: 220-260 bar
     * Grün: 260-400 bar
     */
    background: conic-gradient(
        transparent 0deg,
        transparent 90deg,
        #e74c3c 90deg, /* Rot beginnt bei oben rechts */
        #e74c3c 238.5deg, /* Rot endet bei 220 bar */
        #f1c40f 238.5deg, /* Gelb beginnt bei 220 bar */
        #f1c40f 265.5deg, /* Gelb endet bei 260 bar */
        #2ecc71 265.5deg, /* Grün beginnt bei 260 bar */
        #2ecc71 360deg /* Grün endet bei 400 bar bei oben rechts */
    );
    transform: rotate(-90deg); /* Rotation anpassen */
}

/* Spezifische Farben für Manometer 2 */
#gauge2-color {
    /* 
     * Für Manometer 2:
     * 0-250 bar mit Farbgrenzen bei:
     * Rot: 0-200 bar
     * Grün: 200-250 bar
     */
    background: conic-gradient(
        transparent 0deg,
        transparent 90deg,
        #e74c3c 90deg, /* Rot beginnt bei oben rechts */
        #e74c3c 306deg, /* Rot endet bei 200 bar (200/250 * 270° + 90°) */
        #2ecc71 306deg, /* Grün beginnt bei 200 bar */
        #2ecc71 360deg /* Grün endet bei 250 bar bei oben rechts */
    );
    transform: rotate(-90deg); /* Rotation anpassen */
}

.gauge-cover {
    position: absolute;
    width: 80%;
    height: 80%;
    background: white;
    border-radius: 50%;
    top: 10%;
    left: 10%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1) inset;
}

.gauge-value-container {
    position: absolute;
    width: 100%;
    bottom: 15%;
    z-index: 5;
    text-align: center;
}

.gauge-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.connection-status {
    font-size: 0.9rem;
    margin-top: 5px;
    color: #666;
    font-style: italic;
}

.gauge-unit {
    font-size: 1rem;
    color: #666;
    margin-top: 60%;
}

/* Stil für die Markierungen auf dem äußeren Ring */
.gauge-mark {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    color: #333;
    z-index: 3;
    width: 30px;
    text-align: center;
}

/* Position der Markierungen für Manometer 1 (0-400 bar) */
#gauge1 .gauge-mark-0 {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

#gauge1 .gauge-mark-100 {
    top: 25%;
    right: -5px;
}

#gauge1 .gauge-mark-220 {
    bottom: 25%;
    right: -5px;
}

#gauge1 .gauge-mark-260 {
    bottom: -5px;
    left: 25%;
}

#gauge1 .gauge-mark-350 {
    bottom: 25%;
    left: -5px;
}

/* Position der Markierungen für Manometer 2 (0-250 bar) */
#gauge2 .gauge-mark-0 {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

#gauge2 .gauge-mark-100 {
    top: 25%;
    right: -5px;
}

#gauge2 .gauge-mark-220 {
    bottom: 25%;
    left: -5px;
}

#gauge2 .gauge-mark-250 {
    bottom: 10%;
    left: -5px;
}

/* Neuer Stil für die Null-Anzeige oben in der Mitte */
.gauge-center-text {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    z-index: 5;
}

/* Gauge Needle */
.gauge-needle {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transition: transform 0.5s ease-out;
    transform: rotate(0deg); /* Zeiger startet bei 0 bar oben (0 Grad) */
    transform-origin: center center;
    z-index: 3;
}

.gauge-needle::before {
    content: '';
    position: absolute;
    height: 45%;
    width: 4px;
    top: 15%;
    left: calc(50% - 2px);
    background-color: #e74c3c;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    transform-origin: bottom center;
}

.needle-center {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Responsive Styles */
@media (max-width: 480px) {
    .gauge {
        width: 200px;
        height: 200px;
    }
    
    .gauge-value {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* Status-Farben */
.connected {
    color: #2ecc71;
}

.connecting {
    color: #f1c40f;
}

.disconnected {
    color: #e74c3c;
}

/* Responsive Styles */
@media (max-width: 480px) {
    .gauge {
        width: 200px;
        height: 200px;
    }
    
    .gauge-value {
        font-size: 2rem;
    }
      h1 {
        font-size: 1.5rem;
    }
}
