/* --- Modal Container --- */
#nh-challenge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
}

.nh-modal-box {
    background: #fff;
    width: 90%;
    max-width: 800px;
    margin: 5vh auto;
    padding: 25px;
    border-radius: 8px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* --- Google Autocomplete Fix --- */
.pac-container {
    z-index: 100000 !important;
}

/* --- Typography & Layout --- */
.nh-challenge-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.nh-description {
    font-size: 0.95em;
    margin-bottom: 15px;
    color: #666;
}

/* --- Auto-Calc Message (Explicitly Scoped) --- */
#nh-auto-msg-container-lawn_size, #nh-auto-msg-container-snow_size {
    background: #e8f0fe;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #4285f4;
}

#nh-auto-msg-lawn_size, #nh-auto-msg-snow_size {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

/* --- Map & Inputs (Explicitly Scoped) --- */
#nh-address-input-lawn_size, #nh-address-input-snow_size {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    box-sizing: border-box;
    font-size: 1rem;
}

/* --- MOBILE TOUCH SCROLLING FIX --- */
#nh-map-lawn_size, #nh-map-snow_size {
    height: 400px;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #eee;
    touch-action: none; /* Prevents mobile browser from scrolling when user tries to draw on map */
}

/* --- Result Bar (Bottom of Map) --- */
.nh-result-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.nh-result-text {
    margin: 0;
    font-size: 1.1rem;
}

#nh-result-area-lawn_size, #nh-result-area-snow_size {
    font-size: 1.3em;
    color: #d63638;
}

.nh-map-controls {
    display: flex;
    gap: 10px;
}

/* --- Warning Step --- */
#nh-step-warning-lawn_size, #nh-step-warning-snow_size {
    display: none;
    text-align: center;
    padding: 20px 10px;
}

.nh-warning-icon {
    font-size: 60px;
    color: #f0ad4e;
    margin-bottom: 15px;
    line-height: 1;
}

.nh-warning-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.nh-btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

/* Specific style for 'Return to Cart' */
.nh-text-link {
    background: none;
    border: none;
    color: #777;
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
    font-size: 0.9rem;
    box-shadow: none !important;
}

.nh-text-link:hover {
    color: #333;
    text-decoration: none;
}

/* --- MOBILE FIX: Raise Window --- */
@media (max-width: 480px) {
    #nh-challenge-modal {
        padding: 0;
        align-items: flex-end; /* Bottom sheet style */
    }

    .nh-modal-box {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 85dvh;
    }

    .nh-result-bar {
        flex-direction: column;
        gap: 10px;
    }

    .nh-map-controls {
        width: 100%;
    }

    .nh-map-controls button {
        flex: 1;
        padding: 12px;
    }
}

/* --- UI MAP GUIDE (STATIC BAR) --- */
.nh-static-guide {
    background-color: #17b348;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Soft Gate Skip Actions --- */
.nh-measure-skip-actions {
    width: 100%; 
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px !important;
    padding-top: 15px;
    border-top: 1px solid #d1d1d1;
}

.nh-measure-skip-actions a {
    color: #777 !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nh-measure-skip-actions a:hover {
    color: #17b348 !important; 
    text-decoration: underline !important;
}

/* --- Mobile Fix for Skip Actions --- */
@media (max-width: 480px) {
    .nh-measure-skip-actions {
        flex-direction: column;
        gap: 10px;
        padding-top: 20px;
        margin-bottom: 10px;
        border-top: 1px solid #ccc;
    }

    .nh-measure-skip-actions a {
        display: block;
        padding: 8px 0;
        font-size: 1rem; 
    }
}