body {
    font-family: 'Inter', Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    flex-grow: 1;
    /* Add padding to the bottom to make space for the fixed tabs */
    padding-bottom: 70px;
}

.header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #4CAF50;
    /* margin-bottom: 20px; */ /* Removed this */
    text-align: center;
    /* Add margins to prevent overlap with absolute positioned button */
    margin-left: 30px;
    margin-right: 30px;
    /* Adjust font size to prevent wrapping/overlap */
    font-size: 1.6rem;
}

#infoButton {
    position: absolute;
    /* top: 0; */ /* Replaced with vertical centering */
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #aaa;
    transition: color 0.3s;
    /* Vertically center the button */
    top: 50%;
    transform: translateY(-50%);
}
#infoButton:hover {
    color: #333;
}
#infoButton svg {
    width: 20px;
    height: 20px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

.pace-inputs {
    display: flex;
    align-items: center;
}

.pace-select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="%23333"><polygon points="0,0 10,0 5,10"/></svg>') no-repeat right 10px center;
    background-size: 10px;
    padding-right: 25px;
}

.pace-inputs span {
    font-size: 20px;
    margin: 0 5px;
}

#results {
    font-size: 1em;
    font-weight: bold;
    color: #2e7d32;
    text-align: left;
}

#results h2, #results h3 {
    text-align: center;
    color: #4CAF50;
    margin-bottom: 10px;
}

/* Hide the custom input field by default */
#customDistance {
    margin-top: 10px;
}

/* New styles for the splits table */
#splits-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.8em;
    text-align: center;
}

#splits-table th, #splits-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

#splits-table th {
    background-color: #e8f5e9;
    color: #333;
    font-weight: normal;
}

/* Responsive table container */
.table-container {
    overflow-x: auto;
}

/* Tab styles - MODIFIED FOR FIXED POSITION */
#tabs {
    display: flex;
    width: 100%;
    background-color: #f4f4f9;
    border-top: 1px solid #ddd;
    /* New styles to lock it to the bottom */
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100; /* Ensure it's on top of other content */
}

.tab {
    flex: 1;
    padding: 15px 0;
    border: none;
    background-color: transparent;
    font-size: 1em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab.active {
    background-color: #e0e0e0;
    border-top: 2px solid #4CAF50;
    color: #4CAF50;
}

/* Page visibility */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* New styles for the Save and Load buttons/dropdown */
#plan-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px; /* Adjusted margin */
    gap: 10px;
    margin-bottom: 20px;
}

.action-button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.8em;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.action-button:hover {
    background-color: #43A047;
}

.delete-button {
    background-color: #f44336;
}

.delete-button:hover {
    background-color: #E53935;
}

#savedPlansSelect {
    flex: 1;
}

/* Toggle Switch Styles */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.separator {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin: 10px 0 20px 0;
}

/* New style for the result display */
.result-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #4CAF50;
    padding: 10px;
    background-color: #f4f4f9;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

/* New styles for the Unit Toggle */
.unit-toggle {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 10px; /* Adjusted margin */
    margin-top: -10px; /* Adjusted margin */
}
.unit-toggle > div {
    display: flex;
    align-items: center;
    gap: 8px;
}
.unit-label {
    font-weight: bold;
    color: #ccc;
    cursor: pointer;
    transition: color 0.3s;
}
.unit-label.active {
    color: #333;
}

/* New style for the credits */
#credits {
    text-align: center;
    margin-top: 25px;
    font-size: 0.8em;
    color: #aaa;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
}
.modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fefefe;
    padding: 25px 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 85%;
    max-width: 450px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001;
}
.modal-content h2 {
    margin-top: 0;
    color: #4CAF50;
    text-align: center;
    margin-bottom: 15px;
}
.modal-content p {
    font-size: 0.95em;
    line-height: 1.5;
    color: #333;
}
.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}
.modal-close:hover,
.modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
