/* app.css - Main application styling */

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

/* Apply Exo 2 font to all elements, including buttons and inputs */
button,
input,
select,
textarea,
body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Faster tooltip appearance */
[title] {
    position: relative;
}

[title]:hover::after {
    animation: fadeIn 0.1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top header bar */
.top-header-bar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-header-bar h1 {
    font-size: 20px;
    color: #7c3aed;
    margin: 0;
}

.top-nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #edf2f7;
    color: #7c3aed;
    border-color: #7c3aed;
}

.nav-btn i {
    font-size: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Profile picture button */
.profile-picture-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    padding: 0;
}

.profile-picture-btn:hover {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-picture-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Main content area */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 380px;
    height: 100%;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar h3 {
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 12px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #718096;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: #2d3748;
}

/* Routing options in sidebar */
.routing-options-sidebar {
    border-bottom: 0.5px solid #e2e8f0;
    background: #fafbfc;
}

.routing-options-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    transition: background 0.2s;
}

.routing-options-header:hover {
    background: #f0f2f5;
}

.routing-options-header i {
    color: #718096;
    font-size: 12px;
    transition: transform 0.3s;
    transform: rotate(180deg);
}

.routing-options-header.collapsed i {
    transform: rotate(90deg);
}

.routing-options-content {
    padding: 0 16px 12px 16px;
    overflow: visible;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 500px;
    opacity: 1;
}

.routing-options-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.compact-row-layout {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* Styled select wrapper */
.select-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.select-wrapper.mini {
    flex: 1;
}

.select-icon {
    position: absolute;
    left: 12px;
    color: #7c3aed;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.select-arrow {
    position: absolute;
    right: 12px;
    color: #a0aec0;
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
}

.styled-select {
    flex: 1;
    width: 100%;
    padding: 10px 32px 10px 38px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.styled-select.mini {
    padding: 10px 28px 10px 32px;
    font-size: 13px;
}

.styled-select:hover {
    border-color: #7c3aed;
    background: #f7fafc;
}

.styled-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.adventure-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
}

.adventure-row.visible {
    max-height: 100px;
    opacity: 1;
    margin-bottom: 8px;
    overflow: visible;
}

/* Generic dropdown styles */
.dropdown-wrapper {
    position: relative;
    flex: 1;
}

.dropdown-wrapper.mini {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-label {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 2px;
}

.dropdown-btn {
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.dropdown-btn span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d3748;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
}

/* Only route type dropdown should have no max-height */
#route-type-dropdown-menu {
    max-height: none;
}

/* Other dropdowns can scroll if needed */
#vehicle-dropdown-menu,
#hilliness-dropdown-menu,
#windingness-dropdown-menu,
#avoid-dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-option {
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dropdown-option i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    color: #718096;
    padding-top: 2px;
}

.dropdown-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.dropdown-option-title {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
}

.dropdown-option-description {
    font-size: 12px;
    color: #718096;
    line-height: 1.3;
    white-space: normal;
}

.dropdown-option:hover {
    background: #f7fafc;
    border-radius: 8px;
}

.dropdown-option:hover i {
    color: #7c3aed;
}

.dropdown-option:hover .dropdown-option-title {
    color: #7c3aed;
}

.dropdown-option.selected {
    background: #edf2f7;
    border-radius: 8px;
}

.dropdown-option.selected i {
    color: #7c3aed;
}

.dropdown-option.selected .dropdown-option-title {
    color: #7c3aed;
    font-weight: 600;
}

.dropdown-option.hidden {
    display: none;
}

/* Avoid dropdown specific */
.avoid-dropdown-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.avoid-dropdown-btn {
    text-align: left;
    cursor: pointer;
}

#avoid-dropdown-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avoid-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.avoid-dropdown-menu.open {
    display: block;
}

.avoid-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.avoid-option:hover {
    background: #f7fafc;
}

.avoid-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.avoid-option input[type="checkbox"]:checked ~ .checkmark {
    background: #7c3aed;
    border-color: #7c3aed;
}

.avoid-option input[type="checkbox"]:checked ~ .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    color: white;
    font-size: 10px;
    left: 1px;
    top: 0px;
}

.avoid-option-label {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

/* Traffic toggle */
.traffic-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

.traffic-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.traffic-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    position: relative;
    padding-left: 28px;
}

.traffic-toggle-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
}

.traffic-toggle input[type="checkbox"]:checked ~ .traffic-toggle-label::before {
    background: #7c3aed;
    border-color: #7c3aed;
}

.traffic-toggle input[type="checkbox"]:checked ~ .traffic-toggle-label::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 10px;
}

/* Waypoints */
.waypoints-section {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.waypoints-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.waypoints-section h3 {
    font-size: 16px;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
}

.btn-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #718096;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-clear:hover:not(:disabled) {
    color: #e53e3e;
}

.btn-clear:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.waypoints-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #718096;
    font-size: 14px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.btn-icon:hover:not(:disabled) {
    color: #4a5568;
}

.btn-icon.active {
    color: #7c3aed;
}

/* Toggle legs button - reverse colors */
#toggle-leg-info-btn {
    color: #7c3aed;
}

#toggle-leg-info-btn:hover:not(:disabled) {
    color: #6d28d9;
}

#toggle-leg-info-btn.active {
    color: #718096;
}

#toggle-leg-info-btn.active:hover:not(:disabled) {
    color: #4a5568;
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.waypoints-container {
    margin-bottom: 12px;
}

.waypoints-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.waypoints-empty-state p {
    margin: 0;
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.5;
}

.waypoint-item {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.waypoint-item-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 8px;
    align-items: start;
}

.waypoint-item input {
    cursor: text;
}

.waypoint-item button {
    cursor: pointer;
}

.waypoint-item-content {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafbfc;
    transition: background 0.2s, border-color 0.2s;
}

.waypoint-content-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Waypoint type-based backgrounds */
.waypoint-item[data-type="origin"] .waypoint-item-content {
    background: #f0fdf4;
}

.waypoint-item[data-type="destination"] .waypoint-item-content {
    background: #fef2f2;
}

.waypoint-item[data-type="stop"] .waypoint-item-content {
    background: #fefce8;
}

.waypoint-item[data-type="shaping"] .waypoint-item-content {
    background: #fafbfc;
}


.waypoint-coordinates {
    font-size: 11px;
    color: #718096;
    font-family: monospace;
    padding: 4px 8px;
    text-align: left;
    letter-spacing: 0.3px;
}

.waypoint-arrival-info {
    font-size: 11px;
    color: #7c3aed;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    text-align: right;
}

.waypoint-arrival-info i {
    font-size: 10px;
    color: #7c3aed;
}

.waypoint-item-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.waypoint-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.waypoint-expand-btn {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.waypoint-expand-btn:hover {
    color: #4a5568;
}

.waypoint-expand-btn i {
    transition: transform 0.3s ease;
    transform: rotate(-90deg);
}

.waypoint-item.expanded .waypoint-expand-btn i {
    transform: rotate(0deg);
}

.waypoint-expandable {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.waypoint-item.expanded .waypoint-expandable {
    grid-template-rows: 1fr;
}

.waypoint-expandable > div {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px
}

.waypoint-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.waypoint-name-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.waypoint-name-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: #2d3748;
    transition: all 0.2s ease;
    pointer-events: none;
}

.waypoint-name-confirm-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: #22c55e;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: none;
}

.waypoint-name-confirm-btn:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.waypoint-name-confirm-btn:active {
    transform: scale(0.95);
}

.waypoint-item.expanded .waypoint-name-input {
    border: 1px solid #e2e8f0;
    background: #f7fafc;
    pointer-events: auto;
}

.waypoint-item.expanded .waypoint-name-input:hover {
    border-color: #cbd5e0;
    background: #ffffff;
}

.waypoint-name-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.waypoint-description-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.waypoint-description-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #718096;
    background: #f7fafc;
    transition: all 0.2s ease;
}

.waypoint-description-input:hover {
    border-color: #cbd5e0;
    background: #ffffff;
}

.waypoint-description-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.waypoint-description-confirm-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: #22c55e;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: none;
}

.waypoint-description-confirm-btn:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.waypoint-description-confirm-btn:active {
    transform: scale(0.95);
}

.waypoint-stop-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
}

.waypoint-stoptime-confirm-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: #22c55e;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: none;
}

.waypoint-stoptime-confirm-btn:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.waypoint-stoptime-confirm-btn:active {
    transform: scale(0.95);
}

.stop-time-label {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.stop-time-hours,
.stop-time-minutes {
    width: 50px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    background: #f7fafc;
    color: #2d3748;
    transition: all 0.2s ease;
}

.stop-time-hours:hover,
.stop-time-minutes:hover {
    border-color: #cbd5e0;
    background: #ffffff;
}

.stop-time-hours:focus,
.stop-time-minutes:focus {
    outline: none;
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.waypoint-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.waypoint-delete-btn {
    padding: 6px 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    font-size: 12px;
    color: #c53030;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.waypoint-delete-btn:hover {
    background: #fdd;
    border-color: #faa;
    color: #9b2c2c;
}

.waypoint-delete-btn i {
    font-size: 11px;
}

.waypoint-convert-btn {
    padding: 6px 12px;
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 12px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.waypoint-convert-btn:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
    color: #2d3748;
}

.waypoint-convert-btn i {
    font-size: 11px;
}

.waypoint-handle {
    grid-column: 2;
    grid-row: 1;
    cursor: move;
    color: #cbd5e0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    user-select: none;
    align-self: stretch;
}

.waypoint-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    width: 24px;
    align-self: center;
}

.origin-icon {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #2e7d32;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.origin-icon .icon-oval {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: rotate(45deg);
}

.destination-icon {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #d81b60;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.destination-icon .icon-oval {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: rotate(45deg);
}

.stop-icon {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #f9a825;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.stop-icon span {
    transform: rotate(45deg);
    display: block;
}

.shaping-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7c3aed;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.waypoint-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

.waypoint-input:focus {
    outline: none;
    border-color: #7c3aed;
}

.waypoint-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #cbd5e0;
    cursor: pointer;
    padding: 4px 8px;
}

.waypoint-remove:hover {
    color: #e53e3e;
}

/* Add waypoint buttons */
.add-waypoint-buttons {
    padding: 16px 0;
    display: flex;
    gap: 8px;
}

.add-waypoint-buttons button {
    width: 100%;
}

/* Routing options */
.routing-options {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.routing-options h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2d3748;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 4px;
}

.form-group select,
.form-group input[type="range"] {
    width: 100%;
}

.form-group select {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 13px;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    user-select: none;
    padding: 8px 0;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-text {
    user-select: none;
    position: relative;
    padding-left: 28px;
}

.checkbox-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-text::before {
    background: #7c3aed;
    border-color: #7c3aed;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-text::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 10px;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    user-select: none;
    padding: 8px 0;
    position: relative;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-text {
    user-select: none;
    position: relative;
    padding-left: 28px;
}

.radio-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    background: white;
    transition: all 0.2s;
}

.radio-label input[type="radio"]:checked ~ .radio-text::before {
    background: #7c3aed;
    border-color: #7c3aed;
}

.radio-label input[type="radio"]:checked ~ .radio-text::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Range slider */
.form-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
}

.form-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: none;
}

/* Export route info */
.export-route-info {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* Standalone buttons need full width (not in flex containers) */
.side-panel-content .btn-primary,
.side-panel-content .btn-secondary {
    width: 100%;
}

.btn-primary {
    background: #7c3aed;
    color: white;
}

.btn-primary:hover {
    background: #6b21a8;
}

.btn-primary:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    color: #7c3aed;
    border-color: #7c3aed;
}

.btn-secondary:disabled {
    background: #f7fafc;
    color: #cbd5e0;
    border-color: #f7fafc;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: #7c3aed;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #6d28d9;
}

/* Profile alerts section */
.profile-alerts-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.profile-alerts-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2d3748;
}

/* Route summary */
.route-summary {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

.route-summary h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2d3748;
}

#route-details {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
}

.route-actions {
    display: flex;
    gap: 8px;
}

.route-name-input {
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

/* Saved route items */

.saved-route-item {
    padding: 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-route-item:hover {
    background: #edf2f7;
    border-color: #7c3aed;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.saved-route-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 6px;
}

.saved-route-info {
    font-size: 13px;
    color: #718096;
    margin-bottom: 4px;
}

.saved-route-description {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 8px;
    font-style: italic;
}

/* Map */
.map-container {
    flex: 1;
    height: 100%;
    position: relative;
}

/* Map cursor states */
.maplibregl-canvas-container.maplibregl-interactive {
    cursor: default;
}

.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {
    cursor: pointer;
}

.maplibregl-canvas-container.maplibregl-interactive:active {
    cursor: grab;
}

.maplibregl-canvas-container.maplibregl-interactive.maplibregl-drag-pan {
    cursor: grab;
}

.maplibregl-canvas-container.maplibregl-interactive.maplibregl-drag-pan:active {
    cursor: grabbing;
}

/* Marker cursor states */
.maplibregl-marker {
    cursor: grab;
}

.maplibregl-marker:active {
    cursor: grabbing;
}

/* Remove padding from MapLibre attribution control */
.maplibregl-ctrl.maplibregl-ctrl-attrib {
    padding: 3px !important;
    border-radius: 12px !important;
}

/* Style MapLibre controls with rounded corners */
.maplibregl-ctrl-group {
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

.maplibregl-ctrl-group button {
    border-radius: 0 !important;
}

.maplibregl-ctrl-group button:first-child {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.maplibregl-ctrl-group button:last-child {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.maplibregl-ctrl-group button:hover {
    background-color: #f7fafc !important;
}

/* Attribution control rounded corners */
.maplibregl-ctrl-attrib {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Floating search box on map */
.map-search-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 150px;
    max-width: calc(100vw - 40px);
    transition: width 0.2s ease;
}

.map-search-container.expanded {
    width: 380px;
}

.map-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.map-search-icon {
    position: absolute;
    left: 16px;
    color: #718096;
    font-size: 16px;
    pointer-events: none;
}

.map-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    background: transparent;
}

.map-search-input::placeholder {
    color: #a0aec0;
}

.map-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1001;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.map-search-suggestions .suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f7fafc;
    transition: background 0.2s;
}

.map-search-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.map-search-suggestions .suggestion-item:hover {
    background: #f7fafc;
    border-radius: 12px;
}

.map-search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #718096;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.map-search-clear-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Search Results Panel */
.search-results-panel {
    position: absolute;
    left: 20px;
    top: 80px;
    bottom: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.search-results-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2d3748;
}

.search-results-list {
    overflow-y: auto;
    flex: 1;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f7fafc;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f7fafc;
    border-radius: 12px;
}

.search-result-item.active {
    background: #edf2f7;
    border-left: 3px solid #7c3aed;
    padding-left: 9px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-size: 15px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
}

.search-result-address {
    font-size: 13px;
    color: #718096;
    line-height: 1.4;
}

.search-result-distance {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 4px;
}

/* Map style control */
.map-style-control {
    position: relative;
    overflow: visible !important;
}

.maplibregl-ctrl-group {
    overflow: visible !important;
}

.map-style-button {
    width: 29px;
    height: 29px;
    background: white !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
    border-radius: 12px !important;
}

.map-style-button:hover {
    background: #f7fafc !important;
    border-radius: 12px !important;
}

.maplibregl-ctrl button.map-style-button {
    background: white !important;
    border-radius: 12px !important;
}

.maplibregl-ctrl button.map-style-button:hover {
    background: #f7fafc !important;
    border-radius: 12px !important;
}

.map-style-menu {
    position: absolute;
    bottom: 0;
    right: calc(100% + 8px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 180px;
    max-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000;
}

/* Triangle pointer pointing to the button */
.map-style-menu::before {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

.map-style-menu::-webkit-scrollbar {
    width: 6px;
}

.map-style-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.map-style-menu::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.map-style-menu::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.map-style-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    padding: 12px 16px !important;
    background: white !important;
    border: none !important;
    text-align: left;
    cursor: pointer !important;
    font-size: 13px;
    color: #2d3748 !important;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box !important;
    height: 40px !important;
}

.map-style-item:first-child {
    border-radius: 8px 8px 0 0 !important;
}

.map-style-item:last-child {
    border-radius: 0 0 8px 8px !important;
    border-bottom: none !important;
}

.map-style-item:hover {
    background: #f7fafc !important;
}

.map-style-checkmark {
    display: none;
    color: #7c3aed;
    font-size: 12px;
    width: 14px;
}

.map-style-item.active .map-style-checkmark {
    display: block;
}

.map-style-item.active {
    background: white !important;
    color: #2d3748 !important;
    font-weight: 500;
}

.map-style-item.active:hover {
    background: #f7fafc !important;
}

.map-style-section-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* Autocomplete suggestions */
.suggestions {
    position: absolute;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f7fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f7fafc;
    border-radius: 12px;
}

/* Radio buttons styled as cards */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.radio-content i {
    font-size: 20px;
    color: #718096;
}

.radio-content span {
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}

.radio-card input[type="radio"]:checked + .radio-content {
    border-color: #7c3aed;
    background: #f7fafc;
}

.radio-card input[type="radio"]:checked + .radio-content i {
    color: #7c3aed;
}

.radio-card input[type="radio"]:checked + .radio-content span {
    color: #7c3aed;
}

.radio-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.radio-card.disabled .radio-content {
    background: #f7fafc;
    border-color: #e2e8f0;
}

/* Inline radio buttons for hilliness/windingness */
.radio-group-inline {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.radio-inline {
    flex: 1;
    cursor: pointer;
}

.radio-inline input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-inline span {
    display: block;
    padding: 8px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: white;
    transition: all 0.2s;
}

.radio-inline input[type="radio"]:checked + span {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

/* Button container for proper alignment */
.button-container {
    padding: 0 16px;
    margin-bottom: 12px;
}

.button-container .btn-primary,
.button-container .btn-secondary {
    width: 100%;
    margin: 0;
}

/* Map click menu - styled as MapLibre popup content */
.map-context-popup .maplibregl-popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    width: 240px;
}

/* Hide close button for search result popups */
.map-context-popup .maplibregl-popup-close-button {
    display: none;
}

.map-click-menu {
    width: 240px;
    overflow: hidden;
}

.map-menu-address-container {
    padding: 12px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-right-radius: 8px;
    border-top-left-radius: 8px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.map-menu-address {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-word;
    margin-bottom: 4px;
    opacity: 0.5;
    transition: opacity 0.3s ease-out;
}

.map-menu-address.fade-in {
    opacity: 1;
}

.map-menu-coordinates {
    font-size: 11px;
    font-weight: 400;
    color: #718096;
    line-height: 1.2;
    margin-top: 4px;
    font-family: monospace;
}

.map-menu-options {
    padding: 4px 0;
}

.map-menu-option {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.map-menu-option .menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.map-menu-option .menu-icon.origin-icon,
.map-menu-option .menu-icon.destination-icon,
.map-menu-option .menu-icon.stop-icon {
    font-size: 10px;
}

.map-menu-option .menu-icon.shaping-icon {
    font-size: 9px;
}

.map-menu-option:hover {
    background: #f7fafc;
}

.map-menu-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.save-location-option i {
    width: 20px;
    text-align: center;
    color: #7c3aed;
}

/* Routing row */
.routing-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.routing-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compact-label {
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.radio-row {
    display: flex;
    gap: 4px;
}

.radio-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.radio-compact input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-compact i {
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    color: #718096;
    background: white;
    transition: all 0.2s;
    min-height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-compact span {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #4a5568;
    background: white;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-compact input[type="radio"]:checked + i,
.radio-compact input[type="radio"]:checked + span {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

.radio-compact.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Radio compact with text (icon + label in same button) */
.radio-compact-with-text {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.radio-compact-with-text input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-compact-with-text span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #4a5568;
    background: white;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 36px;
}

.radio-compact-with-text span i {
    font-size: 12px;
}

.radio-compact-with-text input[type="radio"]:checked + span {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

.radio-compact-with-text.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Mini radio buttons for hilliness/windingness */
.radio-row-mini {
    display: flex;
    gap: 4px;
    align-items: center;
}

.radio-mini {
    cursor: pointer;
    position: relative;
}

.radio-mini input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-mini span {
    display: block;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #4a5568;
    background: white;
    transition: all 0.2s;
}

.radio-mini input[type="radio"]:checked + span {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

.mini-sep {
    font-size: 10px;
    color: #cbd5e0;
    padding: 0 2px;
}

/* Compact checkboxes */
.checkbox-row {
    display: flex;
    gap: 4px;
}

.checkbox-compact {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.checkbox-compact input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-compact span {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #4a5568;
    background: white;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-compact input[type="checkbox"]:checked + span {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

/* Compact buttons */
.btn-compact {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: #7c3aed;
    color: white;
}

.btn-compact:hover {
    background: #5568d3;
}

.btn-compact.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-compact.btn-secondary:hover {
    background: #f7fafc;
}

/* Route summary in sidebar */
.route-summary-sidebar {
    padding: 12px 16px 16px 16px;
    border-top: 0.5px solid #e2e8f0;
    border-bottom: 0.5px solid #e2e8f0;
    background: #fafbfc;
}

.route-info {
    margin-bottom: 12px;
}

.route-info #route-details {
    font-size: 14px;
    color: #4a5568;
}

.route-info #route-details p {
    margin: 4px 0;
}

.route-actions {
    display: flex;
    gap: 8px;
}

.route-actions button {
    flex: 1;
}

/* Side panels (My Routes, Save Route) */
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.side-panel.closing .side-panel-overlay {
    animation: fadeOut 0.3s ease-out;
}

.side-panel.closing .side-panel-content {
    animation: slideOutRight 0.3s ease-out;
}

.side-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.side-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 500px;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.side-panel-header h2 {
    font-size: 20px;
    color: #2d3748;
    margin: 0;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}


/* Drag and drop states */
.waypoint-item.dragging {
    opacity: 0.5;
}

.waypoint-item.drag-over {
    border-top: 2px solid #7c3aed;
}


/* Profile panel */

.profile-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.profile-picture-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    overflow: hidden;
}

.profile-picture-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed 0%, #764ba2 100%);
    color: white;
    font-size: 32px;
    font-weight: 600;
}

/* OAuth Info Box */
.oauth-info-box {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.oauth-info-box i {
    color: #4299e1;
    font-size: 20px;
    margin-top: 2px;
}

.oauth-info-content {
    flex: 1;
}

.oauth-info-content strong {
    display: block;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.oauth-info-content p {
    color: #4a5568;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input[readonly] {
    background-color: #f7fafc;
    color: #718096;
    cursor: not-allowed;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .map-container {
        height: 60vh;
    }

    .radio-grid.vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .routing-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .route-summary-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .summary-actions {
        flex-direction: column;
    }

    .route-name-compact {
        width: 100%;
    }
}

/* Custom Alert */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.2s ease;
}

.custom-alert-overlay.show {
    display: flex;
}

.custom-alert-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.2s ease;
}

.custom-alert-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

.custom-alert-icon.info {
    color: #7c3aed;
}

.custom-alert-icon.warning {
    color: #f59e0b;
}

.custom-alert-icon.error {
    color: #ef4444;
}

.custom-alert-icon.success {
    color: #10b981;
}

.custom-alert-icon.question {
    color: #7c3aed;
}

.custom-alert-message {
    font-size: 16px;
    color: #2d3748;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1;
    white-space: pre-line;
}

.custom-alert-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-alert-buttons button {
    min-width: 100px;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Map loading spinner */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    animation: fadeIn 0.2s ease;
    pointer-events: none;
}

.map-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.map-loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* MapLibre waypoint popup styling */
.waypoint-maplibre-popup .maplibregl-popup-content {
    padding: 0px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: 400px;
}

.waypoint-maplibre-popup .maplibregl-popup-tip {
    border-top-color: white;
}

.waypoint-maplibre-popup .maplibregl-popup-close-button {
    font-size: 20px;
    padding: 8px;
    color: #718096;
    border-radius: 6px;
    right: auto;
    top: -6px;
}

.waypoint-maplibre-popup .maplibregl-popup-close-button:hover {
    color: #2d3748;
}

.waypoint-popup-content {
    max-height: 500px;
    overflow-y: auto;
}

/* Make popup content look consistent with sidebar */
.waypoint-maplibre-popup .waypoint-item-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.waypoint-maplibre-popup .waypoint-icon {
    flex-shrink: 0;
}

.waypoint-maplibre-popup .waypoint-item-inner {
    flex: 1;
}

.waypoint-maplibre-popup .waypoint-expandable {
    display: block !important;
    max-height: none !important;
}

.waypoint-maplibre-popup .waypoint-expand-btn {
    display: none;
}

.waypoint-maplibre-popup .waypoint-handle {
    display: none;
}

/* Routes Browser - Folder Tree and Routes List */
.routes-browser {
    display: flex;
    height: 100%;
    gap: 0;
}

.routes-sidebar {
    width: 200px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
}

.routes-sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
}

.routes-sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.folders-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
    gap: 6px;
}

.folder-item:focus {
    outline: none;
}

.folder-item:hover {
    background: #edf2f7;
}

.folder-item.selected {
    background: #7c3aed;
    color: white;
}

.folder-item.selected .folder-icon {
    color: white;
}

.folder-expand {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #718096;
    cursor: pointer;
}

.folder-expand.empty {
    visibility: hidden;
}

.folder-expand i {
    transition: transform 0.2s;
}

.folder-item.expanded > .folder-expand i {
    transform: rotate(90deg);
}

.folder-icon {
    font-size: 14px;
    color: #7c3aed;
}

.folder-name {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-children {
    padding-left: 16px;
    display: none;
}

.folder-item.expanded + .folder-children {
    display: block;
}

.folder-item.dragover {
    background: #e6f2ff;
    border: 1px dashed #7c3aed;
}

.routes-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.routes-content-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
    min-height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.routes-content-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.routes-table-container {
    flex: 1;
    overflow-y: auto;
}

.routes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.routes-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.routes-table thead {
    position: sticky;
    top: 0;
    background: #fafbfc;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1;
}

.routes-table th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    color: #4a5568;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.routes-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.routes-table th.sortable:hover {
    background: #f1f5f9;
}

.routes-table th.sortable span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.routes-table .sort-icon {
    font-size: 10px;
    color: #cbd5e0;
    transition: color 0.2s;
}

.routes-table th.sort-asc .sort-icon {
    color: #7c3aed;
}

.routes-table th.sort-desc .sort-icon {
    color: #7c3aed;
}

.routes-table th.sort-asc .sort-icon::before {
    content: "\f0de";
}

.routes-table th.sort-desc .sort-icon::before {
    content: "\f0dd";
}


.routes-table tbody tr:hover {
    background: #f8fafc;
}

.routes-table tbody tr.dragging {
    opacity: 0.5;
}

.routes-table td {
    padding: 10px 16px;
    color: #2d3748;
    vertical-align: middle;
}

.routes-table .name-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.routes-table .item-icon {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
    font-size: 14px;
    gap: 4px;
}

.routes-table .item-kind-text {
    font-size: 11px;
    color: #718096;
    text-transform: capitalize;
}

.routes-table .item-name {
    font-weight: 500;
}

.routes-table .item-description {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.routes-table .item-distance,
.routes-table .item-duration {
    color: #2d3748;
    font-size: 13px;
}

.routes-table .item-date {
    color: #718096;
    font-size: 12px;
    white-space: nowrap;
}

.routes-table .item-kind {
    color: #718096;
    text-transform: capitalize;
}

.routes-table .item-time {
    color: #a0aec0;
    font-size: 11px;
    margin-top: 2px;
}

.routes-table .item-more {
    color: #7c3aed;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}

.routes-table .item-more:hover {
    text-decoration: underline;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 10000;
    padding: 4px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #2d3748;
}

.context-menu-item:hover {
    background: #f7fafc;
}

.context-menu-item i {
    width: 16px;
    font-size: 13px;
    color: #718096;
}

.context-menu-item-danger {
    color: #e53e3e;
}

.context-menu-item-danger i {
    color: #e53e3e;
}

.context-menu-item-danger:hover {
    background: #fff5f5;
}

/* Route item dragging */
.route-item.dragging {
    opacity: 0.5;
}

.route-item.dragover {
    border-top: 2px solid #7c3aed;
}

/* My Data panel specific styles */
#saved-routes-panel .side-panel-content {
    width: 900px;
    max-width: 90vw;
}

#saved-routes-panel .side-panel-body {
    padding: 0;
}

/* Route details modal */
.route-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
}

.route-details-content {
    position: absolute;
    background: white;
    border-radius: 6px;
    min-width: 240px;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.route-info-section {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.route-info-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.route-info-description {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
    line-height: 1.4;
}

.route-info-item {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-info-item i {
    font-size: 12px;
    width: 14px;
}

.route-info-item.route-info-meta {
    font-size: 11px;
    color: #718096;
}

.route-info-item:last-child {
    margin-bottom: 0;
}

.route-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.route-details-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2d3748;
}

.route-details-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.route-details-close:hover {
    color: #2d3748;
}

.route-details-row {
    margin-bottom: 16px;
}

.route-details-label {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.route-details-value {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.5;
}

.route-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.route-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #4a5568;
}

.route-info-label {
    font-weight: 500;
    min-width: 110px;
}

.route-info-row i {
    font-size: 12px;
    color: #4a5568;
}

.route-dates {
    margin-bottom: 16px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
}

.route-date-item {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #718096;
    margin-bottom: 4px;
}

.route-date-item:last-child {
    margin-bottom: 0;
}

.route-date-label {
    font-weight: 500;
    min-width: 65px;
}

.route-details-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.route-delete-btn {
    background: rgba(229, 62, 62, 0.5) !important;
    color: white !important;
    border-color: #e53e3e !important;
}

.route-delete-btn:hover {
    background: rgba(197, 48, 48, 0.5) !important;
    border-color: #c53030 !important;
}

.route-load-btn {
    margin-left: auto;
}

/* Leg Sections */
.leg-section {
    background: #f9f7ff;
    border-left: 4px solid #7c3aed;
    border-radius: 0 8px 8px 0;
    margin: 8px 23px 8px 19px;
    padding: 12px;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.leg-section.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0 23px 0 19px;
    padding: 0 12px;
}


.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.leg-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.leg-title i {
    color: #7c3aed;
    font-size: 12px;
}

.leg-custom-badge {
    font-size: 10px;
    font-weight: 600;
    background: #7c3aed;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leg-custom-badge i {
    color: white;
}

.leg-avoid-badge {
    background: #ea580c;
    margin-left: 4px;
}

.leg-expand-btn {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.leg-expand-btn:hover {
    color: #4a5568;
}

.leg-expand-btn i {
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.leg-section.expanded .leg-expand-btn i {
    transform: rotate(0deg);
}

.leg-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
}

.leg-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.leg-stats i {
    font-size: 10px;
}

.leg-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
    overflow: hidden;
}

.leg-section.expanded .leg-body {
    grid-template-rows: 1fr;
}

.leg-body-inner {
    min-height: 0;
}

.leg-section.expanded .leg-body-inner {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.leg-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.leg-supporting-points {
    margin-bottom: 16px;
}

.leg-empty-message {
    font-size: 12px;
    color: #a0aec0;
    font-style: italic;
    padding: 8px;
    text-align: center;
}

.supporting-points-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.supporting-point-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.supporting-point-icon {
    color: #7c3aed;
    font-size: 8px;
    flex-shrink: 0;
}

.supporting-point-coords {
    flex: 1;
    color: #4a5568;
    font-family: monospace;
}

.supporting-point-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.supporting-point-delete:hover {
    opacity: 1;
}

.leg-routing-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leg-param-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leg-param-row label {
    font-size: 12px;
    color: #4a5568;
    min-width: 85px;
    font-weight: 500;
}

.leg-param-row select {
    flex: 1;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s;
    height: 32px; /* Slightly less than routing-options which is 36px */
}

.leg-param-row select:hover {
    border-color: #a0aec0;
}

.leg-param-row select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.leg-param-row select option[value=""] {
    color: #a0aec0;
    font-style: italic;
}

.leg-avoid-section {
    flex-direction: column;
    align-items: flex-start;
}

.leg-avoid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.leg-avoid-toggle {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s, transform 0.3s ease;
}

.leg-avoid-toggle:hover {
    color: #4a5568;
}

.leg-avoid-toggle i {
    transition: transform 0.3s ease;
    transform: rotate(-90deg);
}

.leg-avoid-section:has(.leg-avoid-checkboxes.expanded) .leg-avoid-toggle i {
    transform: rotate(0deg);
}

.leg-avoid-checkboxes {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
    overflow: hidden;
    width: 100%;
}

.leg-avoid-checkboxes.expanded {
    grid-template-rows: 1fr;
    margin-top: 8px;
}

.leg-avoid-checkboxes-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leg-avoid-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-radius: 4px;
}

.leg-avoid-option:hover {
    background: #f7fafc;
}

.leg-avoid-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.leg-avoid-option .checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.leg-avoid-option input[type="checkbox"]:checked ~ .checkmark {
    background: #7c3aed;
    border-color: #7c3aed;
}

.leg-avoid-option input[type="checkbox"]:checked ~ .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    color: white;
    font-size: 10px;
    left: 1px;
    top: 0px;
}

.leg-avoid-option .avoid-option-label {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

/* Dropdown divider */
.dropdown-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 4px 0;
}

/* User Location Marker */
.user-location-marker {
    width: 0;
    height: 0;
    position: relative;
}

.user-location-dot {
    width: 16px;
    height: 16px;
    background: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.user-location-accuracy {
    background: rgba(66, 133, 244, 0.15);
    border: 1px solid rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    transition: width 0.3s ease, height 0.3s ease;
}

/* Location Help Modal */
.location-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.location-help-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Code Input Styles (for email verification, password reset, etc.) */
.code-digit,
.code-digit-email {
    width: 48px;
    height: 56px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Exo 2', monospace;
    font-weight: 600;
    transition: border-color 0.2s;
}

.code-digit:focus,
.code-digit-email:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.code-digit.error,
.code-digit-email.error {
    border-color: #fc8181;
}

.btn-link {
    background: none;
    border: none;
    color: #4299e1;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

.btn-link:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.btn-link:disabled {
    color: #a0aec0;
    cursor: not-allowed;
}

/* Email Verification Banner */
.verification-banner {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.verification-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.verification-banner-content i {
    font-size: 20px;
}

.verification-banner-content span {
    font-size: 14px;
}

.verification-banner-content strong {
    font-weight: 600;
}

.verification-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 8px;
}

.verification-link:hover {
    opacity: 0.9;
}

.verification-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.verification-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .verification-banner {
        top: 50px;
        padding: 10px 16px;
    }

    .verification-banner-content span {
        font-size: 13px;
    }
}

/* Change Email Modal Error Messages */
#change-email-error,
#change-email-verify-error {
    color: #c53030;
    background: #fee;
    padding: 12px;
    padding-bottom: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Round Trip Panel - Inside sidebar */
.round-trip-panel {
    flex: 1;
    overflow-y: auto;
    background: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none; /* Hidden by default */
}

.round-trip-panel.active {
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease forwards;
}

.round-trip-panel.closing {
    display: flex;
    flex-direction: column;
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.round-trip-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.round-trip-panel-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
}

.round-trip-panel-body {
    padding: 20px;
}

/* Range slider styling for round trip panel */
.round-trip-panel input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.round-trip-panel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #7c3aed;
    border-radius: 50%;
    cursor: pointer;
}

.round-trip-panel input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #7c3aed;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Radio button styling for round trip panel */
.round-trip-panel input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.round-trip-panel input[type="radio"]:checked {
    border-color: #7c3aed;
    background: #7c3aed;
}

.round-trip-panel input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Checkbox styling for round trip panel */
.round-trip-panel input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.round-trip-panel input[type="checkbox"]:checked {
    border-color: #7c3aed;
    background: #7c3aed;
}

.round-trip-panel input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Segmented Control for Round Trip Direction */
.segmented-control {
    display: inline-flex;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    min-width: 44px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 18px;
    background: transparent;
}

.segmented-control label:hover {
    color: #374151;
}

.segmented-control input[type="radio"]:checked + label {
    background: #ffffff;
    color: #7c3aed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* GPX Import Panel */
.gpx-import-panel {
    flex: 1;
    overflow-y: auto;
    background: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none; /* Hidden by default */
}

.gpx-import-panel.active {
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease forwards;
}

.gpx-import-panel.closing {
    display: flex;
    flex-direction: column;
    animation: slideOut 0.3s ease forwards;
}

.gpx-import-panel-body {
    padding: 20px;
}

/* GPX Drop Zone */
.gpx-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gpx-drop-zone:hover {
    border-color: #7c3aed;
    background: #faf5ff;
}

.gpx-drop-zone.dragover {
    border-color: #7c3aed;
    background: #ede9fe;
    border-style: solid;
}

.gpx-file-select-link {
    color: #7c3aed;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.gpx-file-select-link:hover {
    color: #6d28d9;
}

/* Custom Import Icon (arrow down to bracket) */
.import-icon-container {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.import-icon-container::before {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 1px;
    right: 1px;
    height: 4px;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 3px 3px;
}

.import-icon-container .fa-arrow-down {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
}
