/* General Styles */
html,
body {
    overflow-x: hidden;
    /* Disable horizontal scrolling */
    max-width: 100vw;
    /* Ensure the width never exceeds the viewport */
    position: relative;
    /* Prevent unwanted shifting */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full height of the viewport */
    font-family: Arial, sans-serif;
    background-color: #eaeaea;
    text-align: center;
}

/* Logo and Version */
#logo-container {
    position: relative;
    margin-top: 20px;
    /* Adds space at the top */
    text-align: center;
    /* Center-align the content inside the container */
}

#logo {
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    /* Center the logo horizontally */
}

#version {
    font-size: 12px;
    color: #20b2aa;
    /* Light Sea Green */
    margin-top: 5px;
}

#summaryContainer {
    display: none;
    /* Hide initially */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 10%;
    padding: 5px;
    box-sizing: border-box;
}


#summaryDisplay {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    /* Space between elements */
    padding-top: 1px;
}

/* Tracking Container */



/* ✅ Main Tracking Container */
#trackingContainer {
    display: none;
    /* Hide initially */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: auto;
    /* Ensure full height */
    padding: 5px;
    box-sizing: border-box;
}

/* ✅ Main Tracking Display */
#trackingDisplay {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    /* Space between elements */
    padding-top: 0px;
    width: 300px;
    max-width: 90%;
    /* Ensure responsiveness */
}






/* ✅ Second Tracking Display (Same Theme but 3x3 Grid Layout) */
#trackingDisplay2 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 10px;
    /* Same padding and width for consistency */
    padding-top: 0px;

    width: 300px;
    max-width: 90%;

    text-align: center;
    justify-content: center;
    align-items: center;
}



/* ✅ Individual Grid Items */
.grid-item {

    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

/* ✅ Stop Tracking Toggle */
#toggle-container {
    text-align: center;
    margin-top: 15px;
}

/* Speed Container */
#speed-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Keep speed value centered */
    text-align: center;
    padding-top: 10px;
    padding-bottom: 0px;
    gap: 10px;
    /* Controls spacing between "Current Speed: KM/H" and "0.0" */
    max-width: 300px;
    position: relative;
    /* Allows absolute positioning inside */
}

/* Speed Label Container */
#speed-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    font-size: 0.75em;
    gap: 5px;
    width: 100%;
    position: absolute;
    top: 0;

    /* Adjust alignment to match left edge of speed-container */
}

/* Speed Label */
#speed-label {
    font-weight: normal;
    line-height: 1;
    text-align: left;
}

/* Speed Unit */
#speed-unit {
    color: #00bfb5;
    font-weight: normal;
    line-height: 1;
    text-align: left;
}

/* Speed Value */
#speed-value {
    font-size: 9em;
    font-weight: bold;
    color: #000000;
    margin-top: -20px;
    margin-bottom: -30px;
    /* Ensures no extra space above the speed value */
}








#bearing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Ensures everything inside is centered */
    text-align: center;
    padding-top: 0px;
    padding-bottom: 10px;
    gap: 5px;
    /* Adjust space between elements */
    max-width: 300px;
}

#bearing-info {
    display: flex;
    justify-content: center;
    /* Center content inside */
    align-items: center;
    /* Align elements properly */
    width: 100%;
    max-width: 300px;
    margin-bottom: -30px;
}

#bearing-label {
    font-size: 1em;
    font-weight: normal;

    align-self: flex-start;
    /* Aligns to the top */
    line-height: 1;
    text-align: left;
    margin-top: 21px;
}

#bearing-value {
    font-size: 6em;
    font-weight: bold;
    color: #027c76;
    text-align: center;
    /* Ensures text inside is centered */
    width: 100%;
}


.true-north {
    font-size: .75em;

    align-self: flex-start;
    color: #00b2a9;



}

#trackingDisplay2 {
    display: flex;
    flex-direction: column;
    /* Stack children vertically */
    align-items: center;
    gap: 20px;
    /* Optional: adds space between rows */
}




/* Container for both times */
#time-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 350px;
    /* Adjust width as needed */
    margin: auto;
    padding-left: 10px;
    margin-bottom: -10px;
    margin-top: 10px;
    gap: 20px
}

#time-container2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 350px;
    /* Adjust width as needed */
    margin: auto;
    padding-left: 10px;
    margin-bottom: -10px;
    margin-top: -20px;
    gap: 20px
}



/* Make each time section a column */
#current-time,
#session-time {
    display: flex;
    flex-direction: column;
    /* Stack label above time */
    align-items: center;
    /* Center everything */
    text-align: center;
    max-width: 150px;
    margin-left: 10px
}

/* Labels (keep at the top) */
#time-label,
#session-label {
    font-size: 1em;
    font-weight: normal;
    text-align: center;
    margin-bottom: 1px;
    /* Space between label and time */
}

/* Time values (Ensure seconds stay on the same line) */
.time-display {
    display: flex;
    align-items: flex-end;
}

/* Main Time (HH:MM) */

#session-time-value {
    font-size: 3em;
    font-weight: bold;
    color: #be4f00;
    line-height: 1;
    text-align: center;
    margin-left: 0;
}


/* Main Time (HH:MM) */
#time-value {
    font-size: 3em;
    font-weight: bold;
    color: #027c76;
    ;
    line-height: 1;
    text-align: center;
    margin-left: 0;
}

/* Seconds */
#seconds {
    font-size: 1.5em;
    font-weight: bold;
    color: #027c76;
    ;
    margin-left: 2px;
    margin-bottom: 1px;
    align-self: flex-end;
}



#session-seconds {
    font-size: 1.5em;
    font-weight: bold;
    color: #be4f00;
    margin-left: 2px;
    margin-bottom: 1px;
    align-self: flex-end;
}


#tide-swing {
    padding: 5px;
    border-radius: 16px;

    display: block;
    font-size: .75em;
    margin-top: 05px;
    margin-bottom: 10px;
}

#tide-value {
    display: block;

    color: #be4f00;
    font-size: 3.5em;
    font-weight: bold;
}


/* Seconds */
#tide-seconds {
    font-size: 1.5em;
    font-weight: bold;
    color: #be4f00;
    ;
    margin-left: 2px;
    margin-bottom: 5px;
    align-self: flex-end;
}

#session-time-foiling {
    padding: 5px;
    border-radius: 16px;

    display: block;
    font-size: .75em;
    margin-top: 05px;
    margin-bottom: 10px;
}

#session-time-foiling-value {
    display: block;
    color: #00b2a9;
    font-size: 3.5em;
    font-weight: bold;
}

/* ✅ Third Tracking Display (Same Styling as Time Labels) */
#trackingDisplay3 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 7px;
    padding-top: 15px;
    width: 350px;
    max-width: 90%;
    text-align: center;
    justify-content: center;
    align-items: center;
    margin-bottom: -10px;
    margin-top: -5px;
}



/* ✅ Distance Labels */
#session-distance-label {
    font-size: 0.75em;
    font-weight: normal;
    text-align: center;
    margin-bottom: 5px;
}

/* ✅ Distance Values (Styled like Time Values) */
.session-distance-display,
.session-distance-foiling-label {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 3em;
    /* Match main time size */
    font-weight: bold;
    line-height: 1;
}


/* ✅ Fourth Tracking Display (Live Speed Performance Metrics) */
#trackingDisplay4 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 5px;
    padding-top: 0px;
    width: 350px;
    max-width: 90%;
    text-align: center;
    justify-content: center;
    align-items: center;


}

/* ✅ Individual Grid Items (Styled like Time Labels) */
.grid-item {
    padding: 5px;
    border-radius: 16px;
    border: 2px solid #00b2a9;
    text-align: center;

    /* Match time labels */
    font-weight: bold;
    margin-top: 0px;
    margin-bottom: 5px;
}

/* ✅ Speed Performance Metrics Labels (Ensuring Proper Sizing) */
#peakspeed-label,
#5Sspeed-label,
#maxspeed-100-label,
#maxaccel-label {
    font-size: 0.75em;
    /* Match time and session labels */
    font-weight: normal;
    text-align: center;
    display: block;

}

/* ✅ Adjusting Label-Top Class for Consistency */
.label-top {
    font-size: 0.75em;
    /* Ensure same as session labels */
    font-weight: normal;
    text-align: center;
    display: block;

}

/* ✅ Speed Performance Metrics Values */
.peakspeed-display,
.speed-5S-display,
.speed-100m-display,
.maxaccel-display {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 3em;
    /* Match main time size */
    font-weight: bold;
    line-height: 1;
}






/* Buttons */
button {
    padding: 15px 25px;
    font-size: 2em;
    border: none;
    border-radius: 10px;
    background-color: #d2691e;
    /* Orange */
    color: #eaeaea;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #20b2aa;
}

button:active {
    background-color: #eaeaea;
    color: #101010;
}




/* ====== General Slider Styling ====== */

/* Hide toggle container initially */
#toggle-container {
    position: fixed;
    bottom: 20px;
    /* Distance from bottom */
    left: 50%;
    transform: translateX(-50%);
    /* Center it horizontally */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    /* Ensure it spans full width if needed */
}


/* Adjust Stop Tracking text styling */
#toggle-label {
    padding: 10px;
    font-size: .75em;
    font-weight: bold;
    color: #d2691e;
    /* Burnt orange */
}

.highlight {
    background-color: #00b2a9;
    color: white;
    /* Ensures contrast */
    padding: 2px 5px;
    border-radius: 5px;
    font-weight: bold;
}

/* ====== Swipe-to-Stop Slider ====== */

/* Default track styling */
#slider-track {
    pointer-events: none;
    position: relative;
    width: 300px;
    height: 10px;
    background-color: white;
    border-radius: 10px;
    border: 4px solid #d2691e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease-in-out;
}

/* When the slider is being dragged */
#slider-track.active {
    border-color: #00b2a9 !important;
    /* Green border when dragging */
}

/* Prevent track from snapping unexpectedly */
#trackingToggle {
    -webkit-appearance: none;
    appearance: none;
    width: 300px;
    height: 10px;
    background: transparent;
    outline: none;
    transition: all 0.1s ease-in-out;
}

/* Allow only the thumb to be interactive */
#trackingToggle::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    cursor: grab;
    border: 4px solid #d2691e;
    position: relative;
    transition: background 0.2s ease-out, transform 0.2s ease-out;
}

/* Change to green when dragging */
#trackingToggle:active::-webkit-slider-thumb {
    background: #00b2a9;
    cursor: grabbing;
    border: 4px solid #00b2a9;
}

/* Hide and show fix for mobile browsers */
#trackingToggle.hidden {
    display: none !important;
}













#userInputs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 85%;

    width: 400px;
    margin: 10px auto;
    padding-left: 5px;
    padding-right: 5px;
    padding-bottom: 20px;
    border-radius: 20px;
    background-color: #dfe6e9;
    /* Soft light gray-blue for readability */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    /* Soft shadow */
}



/* Label and Input Container */
.input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0px;
    padding: 10px 5px;
}

/* Labels */
label {
    font-size: 1em;
    color: #20b2aa;
    /* Dark teal */
    flex: 1;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

/* Standard Inputs */
input[type="number"],
input[type="text"],
input[type="time"],
select {
    flex: 2;
    font-size: 1.8em;
    padding: 8px;
    border: 3px solid #d2691e;
    ;
    border-radius: 8px;
    background-color: #eaeaea;
    ;
    /* Dark gray */
    color: #000000;
    /* White text */
    text-align: center;
    max-width: 100px;
    min-width: 50px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
}



#primeContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 85%;
    width: 400px;
    margin: 10px auto;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 20px;
    background-color: #dfe6e9;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    /* ✅ Add this */
}

/* ✅ Ensures buttons are aligned side by side */
.button-group {
    display: flex;
    flex-direction: row;
    /* Arrange buttons in a row */
    justify-content: center;
    /* Center buttons horizontally */
    gap: 15px;
    /* Space between buttons */
    width: 80%;
    /* Ensure it takes full width */
    max-width: 300px;
    max-height: 110px;
    /* Restrict width */
    margin: 0 auto;
    /* Center group */
    margin-bottom: 20px;
}

/* ✅ Keep individual button styles unchanged */
#prime-gps,
#startButton {
    flex: 1;
    /* Buttons share space evenly */
    text-align: center;
    padding: 15px 20px;
    font-size: 1.5em;
    border-radius: 10px;
    color: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0px 0px 5px rgba(255, 255, 255, 0.2);
}

/* ✅ Keep Prime GPS button styling unchanged */
#prime-gps {
    background-color: #d2691e;
}

/* ✅ Keep Start Tracking button styling unchanged */
#startButton {
    background-color: #d2691e;
}

#export-button {
    background-color: #d2691e;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    max-width: 200px;
    max-height: 50px;
    display: block;
    margin: 20px auto;
    /* centers the button with margin */
    transition: background-color 0.3s ease;
}

#export-button:hover {
    background-color: #b55a17;
}


@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(34, 255, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 255, 0, 1);
    }

    100% {
        box-shadow: 0 0 10px rgba(34, 255, 0, 0.8);
    }
}

/* Apply animation while priming */
.priming {
    background-color: #00b2a9 !important;
    /* Orange while priming */
    animation: pulse 1.5s infinite;
    /* Pulsing glow */
}




/* Larger Input for Custom Phrase */
#phrase-input {
    flex: 2;
    font-size: 2em;
    padding: 12px;
    width: 100%;
    min-height: 60px;
    /* Adjust height for two lines */
    max-height: 120px;
    /* Prevent excessive height */
    text-align: center;
    resize: none;
    /* Prevent manual resizing */
    overflow: hidden;
    /* Hide overflow text */
    line-height: 1.4em;
    /* Improve readability */
    border: 3px solid #d2691e;
    ;
    border-radius: 8px;
    background-color: #eaeaea;
    color: #000000;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* Allow textarea to expand dynamically based on input */
#phrase-input:focus {
    min-height: 80px;
    /* Slightly expand on focus */
    border-color: #ff9f43;
    box-shadow: 0px 0px 10px rgba(255, 159, 67, 0.6);
}

/* Dropdown Styling */
select {
    appearance: none;
    background-color: #eaeaea;
    color: #000000;
    cursor: pointer;
    text-align: center;
}

/* Input Focus Styles */
input:focus,
select:focus {
    border-color: #ff9f43;
    /* Bright orange focus color */
    outline: none;
    box-shadow: 0px 0px 10px rgba(255, 159, 67, 0.6);
}


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

.modal-content {
    margin: 15% auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    width: 80%;
    text-align: center;
    color: #101010;
}

/* Bearing Display */
#bearing-display {
    font-size: 1rem;
    color: #20b2aa;
}

#bearing-value .degree-symbol {
    font-size: 50%;
    /* Smaller degree symbol */
    vertical-align: super;
    opacity: 0.8;
}





#gps-status-label {
    font-size: 1rem;
    color: #000000;
}

#gps-status {
    font-size: 1rem;
    color: #20b2aa;
    margin-left: 5px;
}



.slider-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* ✅ Ensure full centering */
    width: 100%;
    /* ✅ Ensure full width to prevent left-alignment */
    max-width: 80%;
    margin: 20px auto;
    /* ✅ Prevent left shift */
    gap: 10px;
    position: relative;
}

/* === SLIDER LABEL === */
.slider-label {
    padding: 10px;
    font-size: 0.85em;
    font-weight: bold;
    color: #00b2a9;
}

/* === Dual Handle Slider Styling Fix === */

/* Track Styling */
.slider-track {
    position: relative;
    width: 100%;
    height: 14px;
    background-color: transparent;
    border-radius: 10px;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    /*transition: border-color 0.2s ease-in-out;*/
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

/* Active State */
.slider-track.active {
    border-color: #00b2a9 !important;
}

/* Slider Fill */
.slider-fill {
    position: absolute;
    height: 14px;
    background-color: #00b2a9;
    /* Teal */
    border-radius: 10px;
    z-index: 0;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}


/* Specific Fills */
.takeoff-slider-fill,
.vario-slider-fill,
.high-speed-slider-fill {
    position: absolute;
    height: 14px;
    background-color: #00b2a9;
    border-radius: 10px;
    z-index: 0;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Slider Fill */
/* Ensure High-Speed Fill starts from the RIGHT */
.high-speed-slider-fill {
    right: 0;
    width: 0;
}

/* Slider Fill */
.vario-slider-fill {
    position: absolute;
    height: 14px;
    background-color: #00b2a9;
    /* Teal */
    border-radius: 10px;
    z-index: 0;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}




/* Hidden Native Input Sliders */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 14px;
    background: transparent;
    outline: none;
    pointer-events: none;
}

/* Thumb Styling */
.range-slider::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 50px;
    background: #00b2a9;
    border-radius: 50%;
    cursor: grab;
    border: 4px solid white;
    position: relative;
    transition: background 0.2s ease-out, transform 0.2s ease-out;
    z-index: 1;
    box-shadow:
        0px 6px 12px rgba(0, 0, 0, 0.4),
        inset 0px 0px 6px rgba(0, 0, 0, 0.4);

}

/* Thumb Hover Effect */
.range-slider::-webkit-slider-thumb:hover {
    background: #009688;
}

/* Value Inside Thumb */
.range-slider-thumb-value {
    position: absolute;
    top: calc(50% - 1px);
    left: calc(50% + 3px);
    transform: translate(-50%, -50%);
    font-family: Arial Black, Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: white;
    z-index: 30;
    user-select: none;
    /* Prevents text selection */
    pointer-events: none;
    /* Ensures clicks pass through */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3),
        0px 0px 5px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.infinity-symbol {
    position: absolute;
    top: calc(50% + 1px);
    left: calc(50% + 0px);
    transform: translate(-50%, -50%);


    font-family: "Cambria Math", "Times New Roman", serif;
    /* Use a serif font for a proper ∞ shape */
    font-size: 36px;
    /* Adjust size */
    font-weight: bold;
    font-style: normal;
    color: white;
    /* Match UI theme */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

#accuracy-display {
    display: block;
    /* Ensures it appears below "PRIME GPS" text */
    font-size: 0.7em;
    /* Smaller text */
    font-weight: normal;
    margin-top: 4px;
    /* Spacing from PRIME GPS text */
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3),
        0px 0px 5px rgba(255, 255, 255, 0.2);
    /* Slightly dimmed */
}


.off-mode {
    font-weight: bold;
    font-size: 16px;
    color: white;
    text-transform: uppercase;

    padding: 2px 6px;
    border-radius: 4px;

}




/* Remove focus glow */
.range-slider:focus {
    outline: none;
    box-shadow: none;
}

.range-slider::-webkit-slider-runnable-track {
    outline: none;
    box-shadow: none;
}

/* Also apply to the thumb */
.range-slider::-webkit-slider-thumb:focus {
    outline: none;
    box-shadow: none;
}


#g-force-container {
    display: none;
    /* Hides the element and removes it from the layout */
}

/* ===