::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
    height: 3px;
}

::-webkit-scrollbar-track {
    height: 5px !important;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px !important;
    height: 3px;
    background: #7d5241 !important;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5) !important;
}

/* Onboarding Overlay */
#onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Courier New', monospace;
    padding-top: env(safe-area-inset-top);
}

#onboarding-content {
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    text-align: left;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.onboarding-page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.onboarding-page.active {
    display: flex;
}

.onboarding-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.onboarding-content-scroll::-webkit-scrollbar {
    width: 6px;
}

.onboarding-content-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.onboarding-content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.onboarding-content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.onboarding-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ff4500;
    text-align: center;
    flex-shrink: 0;
}

.onboarding-text {
    font-size: 14pt;
    line-height: 1.7;
    color: #f0f0f0;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.onboarding-text p {
    margin-bottom: 16px;
    text-indent: 0;
}

.onboarding-text ul {
    margin: 16px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.onboarding-text li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.onboarding-text strong {
    color: #ff6347;
    font-weight: bold;
}

.onboarding-text em {
    color: #ffd700;
    font-style: italic;
}

.onboarding-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-top: 15px;
}

.onboarding-button {
    background: #ff4500;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

.onboarding-button:hover {
    background: #ff6347;
}

.onboarding-button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.onboarding-button.secondary {
    background: transparent;
    border: 1px solid #666;
    color: #ccc;
}

.onboarding-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #999;
}

.onboarding-progress {
    margin: 15px 0 10px 0;
    color: #ccc;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 15px 0;
    flex-shrink: 0;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: background-color 0.3s ease;
}

.onboarding-dot.active {
    background: #ff4500;
}

.onboarding-button:has(img) {
    padding: unset;
    overflow: clip;
}

.onboarding-button img {
    max-width: 50%;
    padding: unset;
    mix-blend-mode: darken;
    rotate: 180deg;
}

@media (max-width: 600px) {
    #onboarding-content {
        padding: 30px 20px;
        margin: 10px auto;
    }

    .onboarding-title {
        font-size: 24px;
    }

    .onboarding-text {
        font-size: 14pt;
    }

    /* 
    .onboarding-nav {
        flex-direction: column;
        gap: 15px;
    } */

    .onboarding-button {
        width: 100%;
        padding: 15px;
    }

    /* Mobile styles for checklist */
    .checklist-item {
        padding: 12px;
    }

    .checklist-checkbox {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        font-size: 12px;
    }

    .checklist-label {
        font-size: 14px;
    }

    .popover-content {
        padding: 20px;
        margin: 20px;
    }

    .popover-title {
        font-size: 18px;
    }

    .popover-text {
        font-size: 13px;
    }
}

/* Checklist Styles */
.onboarding-checklist {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.checklist-instructions {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #ff4500;
}

.checklist-instructions p {
    margin: 0;
    color: #f0f0f0;
    font-size: 16px;
    line-height: 1.5;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.checklist-item.checked {
    background: rgba(0, 255, 0, 0.1);
    border-color: rgba(0, 255, 0, 0.3);
}

.checklist-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #666;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #00ff00;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checklist-item.checked .checklist-checkbox {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.checklist-label {
    flex: 1;
    color: #f0f0f0;
    font-size: 16px;
    line-height: 1.4;
}

.checklist-label.clickable {
    cursor: pointer;
    color: #ff6347;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.checklist-label.clickable:hover {
    color: #ff4500;
}

.checklist-label.placeholder {
    cursor: pointer;
    color: #ffd700;
    font-style: italic;
    position: relative;
}

.checklist-label.placeholder:hover {
    color: #ffed4e;
}

.checklist-label.placeholder::after {
    content: " (click for info)";
    font-size: 12px;
    opacity: 0.7;
}

/* Placeholder Popover Styles */
.placeholder-popover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.popover-content {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    backdrop-filter: blur(10px);
}

.popover-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 15px;
}

.popover-text {
    color: #f0f0f0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.popover-close {
    background: #ff4500;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

.popover-close:hover {
    background: #ff6347;
}

/* Enhanced Location Permission Popover Styles */
.permission-status {
    margin-bottom: 20px;
    text-align: left;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.permission-granted .status-indicator {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.permission-denied .status-indicator {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.permission-prompt .status-indicator {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.permission-unsupported .status-indicator {
    background: rgba(158, 158, 158, 0.2);
    border: 1px solid rgba(158, 158, 158, 0.5);
}

.permission-unknown .status-indicator {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.status-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.status-text {
    color: #f0f0f0;
    font-weight: 500;
}

.popover-troubleshooting {
    text-align: left;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popover-troubleshooting h4 {
    color: #ffd700;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.troubleshooting-steps p {
    color: #f0f0f0;
    margin: 15px 0 8px 0;
    font-weight: bold;
}

.troubleshooting-steps ol {
    margin: 8px 0 0 20px;
    color: #e0e0e0;
}

.troubleshooting-steps li {
    margin: 5px 0;
    line-height: 1.4;
}

.popover-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.popover-actions button {
    background: #ff4500;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 100px;
}

.popover-test-location {
    background: #2196F3 !important;
}

.popover-test-location:hover {
    background: #1976D2 !important;
}

.popover-request-permission {
    background: #4CAF50 !important;
}

.popover-request-permission:hover {
    background: #388E3C !important;
}

.popover-actions button:hover {
    background: #ff6347;
    transform: translateY(-1px);
}

.popover-actions button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar styling for troubleshooting section */
.popover-troubleshooting::-webkit-scrollbar {
    width: 6px;
}

.popover-troubleshooting::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.popover-troubleshooting::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.popover-troubleshooting::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#onboarding-overlay .starter-area {
    background: rgba(0, 0, 0, 0.9);
    /* border-radius: 15px; */
    /* backdrop-filter: blur(10px); */
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
}

/* Form Styling */
.onboarding-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: scroll;
}

.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

.form-description {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
}

.form-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 12px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 50px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input:invalid {
    border-color: #ff6b6b;
}

.form-input:valid {
    border-color: #4caf50;
}

/* Select element specific styles */
.form-input select,
select.form-input {
    min-height: 45px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-input select:focus,
select.form-input:focus {
    outline: none;
    border-color: #4a90e2;
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

/* Option elements (for browsers that support styling) */
.form-input select option,
select.form-input option {
    background-color: #2a2a2a;
    color: white;
    padding: 8px 12px;
}

/* Required field indicator */
.required {
    color: #ff6b6b;
    font-weight: bold;
    margin-left: 2px;
}

/* Enhanced form field group spacing for multi-field forms */
.form-field-group {
    margin-bottom: 20px;
}

.form-field-group:last-of-type {
    margin-bottom: 10px;
}

/* Special styling for feedback form with many fields */
.onboarding-form-container .onboarding-form .form-field-group {
    margin-bottom: 24px;
}

/* Improved textarea sizing for different field types */
.form-input[rows="3"] {
    min-height: 80px;
}

.form-input[rows="4"] {
    min-height: 100px;
}

.form-input[rows="6"] {
    min-height: 140px;
}

.form-submit {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

.form-submit:hover {
    background: #45a049;
}

/* Form Feedback States */
.form-success-message {
    text-align: center;
    padding: 40px 20px;
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    margin: 20vh 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.success-text {
    color: #4CAF50;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.form-error-message,
.form-validation-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    animation: slideInDown 0.3s ease-out;
}

.form-error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.form-validation-error {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.error-text {
    color: #f0f0f0;
    font-size: 14px;
    line-height: 1.4;
}

.form-validation-error .error-text {
    color: #fff3cd;
}

/* Error state for form inputs */
.form-input.error {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2) !important;
    animation: shake 0.4s ease-in-out;
}

/* Button states */
.form-submit-button:disabled {
    background: #666 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* SubPages Styles */
.subpages-scroll {
    scroll-behavior: smooth;
}

.subpage-section {
    margin-bottom: 1rem;
    /* padding-bottom: 1rem; */
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
}

.subpage-section:last-child {
    border-bottom: none;
    margin-bottom: 40px;
    padding-bottom: 0;
}

.subpage-spacer {
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hagstone-spacer-image {
    max-width: 60px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: invert(100%);
    transition: all 0.3s ease;
    mix-blend-mode: color-burn;
}

.subpage-spacer:hover .hagstone-spacer-image {
    opacity: 1;
    transform: scale(1.1);
}

#dynamic-title {
    transition: all 0.3s ease;
}

/* Enhanced scroll behavior for subpages */
.onboarding-content-scroll.subpages-scroll {
    scroll-snap-type: y proximity;
}

.subpage-section {
    scroll-snap-align: start;
    scroll-margin-top: 2rem;
}

/* Responsive improvements for mobile devices */
@media (max-width: 768px) {
    #onboarding-content {
        width: 95%;
        padding: 20px;
        max-height: 80vh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .hagstone-spacer-image {
        max-width: 50px;
        max-height: 35px;
    }

    .form-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 14px 12px;

        &[type="text"],
        &[type="email"] {
            padding: 10px 8px;
        }
    }

    .form-input select,
    select.form-input {
        min-height: 50px;
        font-size: 16px;
        padding: 14px 40px 14px 12px;
    }

    .form-field-group {
        margin-bottom: 18px;
    }

    .onboarding-form-container .onboarding-form .form-field-group {
        margin-bottom: 20px;
    }

    /* Adjust textarea sizing for mobile */
    .form-input[rows="3"] {
        min-height: 90px;
    }

    .form-input[rows="4"] {
        min-height: 110px;
    }

    .form-input[rows="6"] {
        min-height: 150px;
    }
}

/* High-resolution device improvements */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx) {

    .form-input select,
    select.form-input {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    }
}

#openLocationOnBoardingButton {
    margin-top: 1em;
}

#walkingLocationForm {
    padding-bottom: 30px;
}