@font-face {
    font-family: 'Eurostile';
    src: url('fonts/Eurostile-Bold/Eurostile-Bold%20Regular/Eurostile-Bold%20Regular.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

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

body {
    font-family: 'Eurostile', system-ui, -apple-system, sans-serif;
    background: #121212;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 1rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.header-row .menu-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

h2 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #888;
}

/* Burger menu button - mobile only */
.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    flex-grow: 0;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    border-radius: 1px;
}

/* Tabs - hidden on mobile */
.gauge-tabs {
    display: none;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 250px;
    background: #1a1a1a;
    z-index: 100;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu.open + .mobile-menu-overlay,
.mobile-menu-overlay.open {
    display: block;
}

.mobile-menu .menu-item {
    width: 100%;
    padding: 0.625rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    flex: none;
}

.menu-item:hover {
    background: #252525;
}

.menu-item.active {
    background: #4a9eff;
    color: white;
}

main {
    max-width: 600px;
    margin: 0 auto;
}

#gauge-preview {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

#gauge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

#gauge-container svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

#gauge-value {
    font-size: 0.875rem;
    color: #888;
}

/* Glow toggle button */
.glow-toggle {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    flex: none;
}

.glow-toggle:hover {
    background: #444;
    border-color: #666;
}

.glow-toggle.active {
    background: #4a9eff;
    border-color: #4a9eff;
    color: white;
}

#gauge-preview {
    position: relative;
}

#controls,
#controls-indicators {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 1rem;
}

.control-section-header {
    font-size: 0.875rem;
    font-weight: 500;
    color: #888;
    margin: 1.25rem 0 0.75rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

#indicators-composite {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Wide viewport layout */
@media (min-width: 768px) {
    body {
        padding: 0;
        overflow: hidden;
        height: 100vh;
    }

    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #121212;
        padding: 0.75rem 1rem;
        margin-bottom: 0;
        z-index: 10;
    }

    .header-row {
        margin-bottom: 0;
    }

    .menu-btn {
        display: none;
    }

    .gauge-tabs {
        display: flex;
        justify-content: center;
        gap: 0.25rem;
        margin-top: 0.5rem;
    }

    .tab {
        padding: 0.5rem 1rem;
        background: transparent;
        border: 1px solid #333;
        border-radius: 4px;
        color: #888;
        font-size: 0.875rem;
        cursor: pointer;
    }

    .tab:hover {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .tab.active {
        background: #4a9eff;
        border-color: #4a9eff;
        color: white;
    }

    main {
        display: flex;
        max-width: none;
        height: 100vh;
        padding-top: 6rem;
    }

    #gauge-preview {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 0;
        border-radius: 0;
        background: #121212;
        position: relative;
    }

    #gauge-container {
        width: 100%;
        height: 100%;
        max-width: 80%;
        max-height: 80%;
    }

    #gauge-container svg {
        width: 100%;
        height: 100%;
        max-height: none;
    }

    #controls,
    #controls-indicators {
        width: 320px;
        flex-shrink: 0;
        border-radius: 0;
        height: 100%;
        overflow-y: auto;
        padding: 1.5rem;
    }
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #aaa;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="color"] {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #333;
    padding: 2px;
}

.control-group input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

#save-btn,
#save-btn-ind,
#save-btn-general {
    background: #4a9eff;
    color: white;
}

#reset-btn,
#reset-btn-ind,
#reset-btn-general {
    background: #333;
    color: #aaa;
}

/* General page gauge layout */
#general-gauge-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    max-height: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

.general-left-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.general-center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.general-right-column {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
}

.general-gauge-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.general-gauge-cell svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Standard gauge sizing in General page - use viewport-relative units */
.general-left-column .general-gauge-cell svg,
.general-right-column .general-gauge-cell svg {
    width: 8vw;
    min-width: 60px;
    max-width: 120px;
}

/* Main Gauge sizing - scale based on available space */
#general-main svg {
    width: 35vw;
    min-width: 200px;
    max-width: 500px;
}

/* Indicators sizing - match Main Gauge width */
#general-indicators svg {
    width: 35vw;
    min-width: 200px;
    max-width: 500px;
}

/* General controls section styling */
.controls-general {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 1rem;
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

@media (min-width: 768px) {
    .controls-general {
        width: 320px;
        flex-shrink: 0;
        border-radius: 0;
        height: 100%;
        overflow-y: auto;
        padding: 1.5rem;
    }

    /* General page layout fills available space properly */
    #gauge-container.general-page {
        max-width: 100%;
        max-height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile responsive for General page */
@media (max-width: 767px) {
    #general-gauge-layout {
        flex-direction: column;
        align-items: center;
        height: auto;
        gap: 1rem;
    }

    .general-left-column,
    .general-right-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        height: auto;
    }

    .general-left-column .general-gauge-cell svg,
    .general-right-column .general-gauge-cell svg {
        width: 20vw;
        min-width: 70px;
        max-width: 100px;
    }

    #general-main svg,
    #general-indicators svg {
        width: 80vw;
        min-width: 250px;
        max-width: 400px;
    }
}