/**
 * WP Distance Meter – Front-end Stylesheet
 *
 * Styles for the [distance_meter] shortcode output.
 * Uses a clean, accessible design that works on any WordPress theme.
 */

/* =========================================================
   Wrapper
   ========================================================= */
.wpdm-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    margin: 1.5em 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

/* =========================================================
   Address input section
   ========================================================= */
.wpdm-address-section {
    background: #f8f9fa;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.wpdm-address-inputs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wpdm-address-input-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wpdm-address-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #424242;
}

.wpdm-address-input {
    padding: 10px 12px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpdm-address-input:focus {
    outline: none;
    border-color: #0d47a1;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.wpdm-address-input::placeholder {
    color: #9e9e9e;
}

/* =========================================================
   Instruction bar
   ========================================================= */
.wpdm-instructions {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0d47a1;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.wpdm-instructions .wpdm-icon {
    color: #00e5ff;
    font-size: 10px;
    animation: wpdm-pulse 1.5s ease-in-out infinite;
}

@keyframes wpdm-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* =========================================================
   Map canvas
   ========================================================= */
.wpdm-map-container {
    position: relative;
    width: 100%;
}

.wpdm-map {
    width: 100%;
    display: block;
    cursor: grab;
}

.wpdm-map.wpdm-dragging {
    cursor: grabbing;
}

/* =========================================================
   Geolocation button
   ========================================================= */
.wpdm-geolocation-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d47a1;
    transition: all 0.2s ease;
    z-index: 10;
}

.wpdm-geolocation-btn:hover {
    background: #0d47a1;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.25);
    transform: scale(1.05);
}

.wpdm-geolocation-btn:active {
    transform: scale(0.95);
}

.wpdm-geolocation-btn:focus {
    outline: 2px solid #0d47a1;
    outline-offset: 2px;
}

.wpdm-geolocation-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* =========================================================
   Results panel
   ========================================================= */
.wpdm-results {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 16px;
}

.wpdm-coords-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================================
   Coordinate cards
   ========================================================= */
.wpdm-coord-card {
    flex: 1;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpdm-point-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #757575;
}

.wpdm-point-a .wpdm-point-label { color: #00838f; }
.wpdm-point-b .wpdm-point-label { color: #bf360c; }

.wpdm-coord-value {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    color: #424242;
    word-break: break-all;
}

.wpdm-coord-value.wpdm-has-value {
    color: #1a237e;
    font-weight: 600;
}

/* =========================================================
   Distance display (center)
   ========================================================= */
.wpdm-distance-display {
    flex: 1.5;
    min-width: 160px;
    background: #0d47a1;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.wpdm-distance-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
}

.wpdm-distance-feet {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.wpdm-distance-feet.wpdm-has-value {
    color: #00e5ff;
}

.wpdm-distance-miles {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    display: none;
}

/* =========================================================
   Radius section
   ========================================================= */
.wpdm-radius-section {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 16px;
    margin-top: 12px;
}

.wpdm-radius-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpdm-radius-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #424242;
}

.wpdm-radius-input-wrapper {
    display: flex;
    gap: 8px;
}

.wpdm-radius-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpdm-radius-input:focus {
    outline: none;
    border-color: #0d47a1;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.wpdm-radius-input::placeholder {
    color: #9e9e9e;
}

.wpdm-draw-radius-btn {
    padding: 10px 16px;
    background: #0d47a1;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wpdm-draw-radius-btn:hover:not(:disabled) {
    background: #0a3a7f;
}

.wpdm-draw-radius-btn:focus {
    outline: 2px solid #0d47a1;
    outline-offset: 2px;
}

.wpdm-draw-radius-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpdm-radius-hint {
    font-size: 12px;
    color: #757575;
    font-style: italic;
}

/* =========================================================
   Reset button
   ========================================================= */
.wpdm-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.wpdm-reset-btn {
    background: transparent;
    border: 1px solid #bdbdbd;
    color: #616161;
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.wpdm-reset-btn:hover {
    background: #0d47a1;
    border-color: #0d47a1;
    color: #ffffff;
}

.wpdm-reset-btn:focus {
    outline: 2px solid #0d47a1;
    outline-offset: 2px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 480px) {
    .wpdm-coords-row {
        flex-direction: column;
    }

    .wpdm-distance-display {
        order: -1;
    }

    .wpdm-distance-feet {
        font-size: 18px;
    }
}
