html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: #2a2a2a;
    color: white;
    font-family: Arial, sans-serif;
}
body {
    padding: 20px;
    box-sizing: border-box;
}
h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}
.tab-container {
    display: grid;
    grid-template-columns: repeat(7, 120px);
    gap: 10px;
    justify-content: center;
    background-color: #1a1a1a;
    border-radius: 8px 8px 0 0;
    padding: 10px 20px;
    flex-shrink: 0;
    align-items: center;
}
.tab {
    padding: 12px 8px;
    background-color: #444;
    color: #ccc;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab:hover { background-color: #555; color: white; }
.tab.active { background-color: #666; color: white; }
.stop-button {
    position: absolute;
    right: -140px;
    bottom: 20px;
    width: 120px;
    height: 80px;
    background-color: #cc0000;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    border-radius: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}
.stop-button:hover { 
    background-color: #ff0000; 
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(7, 120px);
    grid-template-rows: repeat(4, 80px);
    gap: 10px;
    justify-content: center;
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
    margin: 0 auto;
    position: relative;
}
.button {
    position: relative; /* This is crucial for positioning the progress bar */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    cursor: pointer;
    transition: transform 0.1s;
    white-space: pre-line;
    line-height: 1.2;
    min-width: 80px;
}
.button:hover { transform: scale(1.05); }
.kvadrat { border-radius: 8px; }
.krug { border-radius: 50%; }
.trokut-desno { position: relative; background: transparent !important; }
.trokut-desno::before { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-bottom: 80px solid; border-left: 120px solid transparent; border-bottom-color: inherit; }
.trokut-lijevo { position: relative; background: transparent !important; }
.trokut-lijevo::before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 0; border-bottom: 80px solid; border-right: 120px solid transparent; border-bottom-color: inherit; }
.trokut-desno .button-text, .trokut-lijevo .button-text { position: relative; z-index: 2; margin-top: 20px; }
.narančasta { background-color: #ff8c00; }
.narančasta.trokut-desno::before, .narančasta.trokut-lijevo::before { border-bottom-color: #ff8c00; }
.roza { background-color: #ff1493; }
.roza.trokut-desno::before, .roza.trokut-lijevo::before { border-bottom-color: #ff1493; }
.zelena { background-color: #32cd32; }
.zelena.trokut-desno::before, .zelena.trokut-lijevo::before { border-bottom-color: #32cd32; }
.žuta { background-color: #ffd700; }
.žuta.trokut-desno::before, .žuta.trokut-lijevo::before { border-bottom-color: #ffd700; }
.plava { background-color: #4169e1; }
.plava.trokut-desno::before, .plava.trokut-lijevo::before { border-bottom-color: #4169e1; }
.ljubičasta { background-color: #9932cc; }
.ljubičasta.trokut-desno::before, .ljubičasta.trokut-lijevo::before { border-bottom-color: #9932cc; }
.info-box {
    margin-top: 20px;
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.info-box h3 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    flex-shrink: 0;
}
#mmsDataOutput {
    width: 100%;
    flex-grow: 1;
    background-color: #2b2b2b;
    border: 1px solid #444;
    color: #ddd;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
}
.highlight {
    background-color: #8B8000;
    color: white;
}
.playing {
    border: 3px solid #00ff00 !important;
    box-shadow: 0 0 10px #00ff00;
}
@keyframes blink-queued {
    50% {
        border-color: transparent;
        box-shadow: none;
    }
}
.queued {
    border: 3px solid #00FFFF !important; /* Cyan color */
    box-shadow: 0 0 12px #00FFFF;
    animation: blink-queued 1.2s infinite;
}
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 8px;
    background-color: rgba(0, 255, 0, 0.7);
    width: 0%;
    transition: width 0.1s linear;
}
.measure-zebra {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 8px;
    display: none;
}
.measure-block {
    position: absolute;
    height: 100%;
    border-right: 1px solid rgba(255,255,255,0.1);
}
