/* FF IP Map — Entry Display CSS */

/* ── Foreign Country Alert ──────────────────────────────────── */
.ff-meta-foreign-country {
    color: #b71c1c !important;
    font-weight: 700 !important;
}

.ff-ip-map-foreign-alert {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    padding: 8px 12px !important;
    color: #b71c1c;
    font-size: 0.85em;
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0;
}

/* ── Map Block ─────────────────────────────────────────────── */
.ff-ip-map-block {
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    margin: 16px 0 20px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.ff-ip-map-no-data {
    padding: 14px 18px;
    color: #888;
    font-style: italic;
}

.ff-ip-map-header-bar {
    background: linear-gradient(90deg, #1a3a5c, #2563a8);
    padding: 10px 16px;
}

.ff-ip-map-header-bar h3 {
    color: #fff;
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
}

/* ── Meta Row ──────────────────────────────────────────────── */
.ff-ip-map-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #eef0f3;
}

.ff-ip-map-meta-item {
    flex: 1 1 200px;
    padding: 10px 16px;
    border-right: 1px solid #eef0f3;
    min-width: 160px;
}

.ff-ip-map-meta-item:last-child {
    border-right: none;
}

.ff-meta-label {
    display: block;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin-bottom: 3px;
}

.ff-meta-value {
    font-size: 0.9em;
    font-weight: 600;
    color: #1a3a5c;
}

.ff-meta-ip {
    font-family: monospace;
    font-size: 0.88em;
}

.ff-method-gps {
    color: #2e7d32;
}

.ff-method-ip {
    color: #1565c0;
}

/* ── Thumbnail ──────────────────────────────────────────────── */
.ff-ip-map-thumbnail-wrap {
    padding: 12px 16px;
}

.ff-ip-map-thumbnail {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #dde3ec;
    transition: border-color .2s;
    max-width: 400px;
    width: 100%;
}

.ff-ip-map-thumbnail:hover {
    border-color: #2563a8;
}

.ff-ip-map-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}

.ff-ip-map-expand-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(26, 58, 92, 0.82);
    color: #fff;
    text-align: center;
    padding: 7px;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: .03em;
    opacity: 0;
    transition: opacity .2s;
}

.ff-ip-map-thumbnail:hover .ff-ip-map-expand-overlay {
    opacity: 1;
}

.ff-ip-map-pin-legend {
    font-size: 0.8em;
    color: #666;
    margin: 8px 0 0;
}

/* ── Modal ──────────────────────────────────────────────────── */
.ff-ip-map-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.ff-ip-map-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.ff-ip-map-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 860px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

.ff-ip-map-modal-header {
    background: linear-gradient(90deg, #1a3a5c, #2563a8);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ff-ip-map-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1em;
}

.ff-ip-map-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: .8;
    transition: opacity .15s;
}

.ff-ip-map-modal-close:hover {
    opacity: 1;
}

.ff-ip-map-modal-body {
    overflow-y: auto;
    flex: 1;
}

.ff-ip-map-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #eef0f3;
    background: #f8f9fc;
    font-size: 0.88em;
}

.ff-modal-meta-item {
    white-space: nowrap;
}

.ff-ip-map-modal-map-container {
    height: 420px;
    width: 100%;
}

/* ── Distance Banner ────────────────────────────────────────── */
.ff-ip-map-distance-banner {
    padding: 10px 18px;
    font-size: 0.9em;
    font-weight: 500;
    border-top: 1px solid transparent;
}

.ff-dist-close {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.ff-dist-medium {
    background: #fff8e1;
    color: #f57f17;
    border-color: #ffe082;
}

.ff-dist-far {
    background: #ffebee;
    color: #b71c1c;
    border-color: #ffcdd2;
}

/* ── Pre-Submit Stack (consent + GPS status above button) ──── */
.ff-ip-map-submit-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

.ff-ip-map-submit-btn {
    margin-top: 8px;
}

/* Override GF footer flex layout that puts button inline */
.gform_footer.top_label,
.gform_page_footer.top_label {
    display: block !important;
    padding-top: 0 !important;
}

/* ── GPS Status (front-end form) ────────────────────────────── */
.ff-ip-map-consent {
    background: #f0f4ff;
    border: 1px solid #c7d5f0;
    border-radius: 5px;
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 0.85em;
    color: #444;
    width: 100%;
    box-sizing: border-box;
}

.ff-ip-map-consent-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    margin-top: 1px;
}

.ff-ip-map-consent p {
    margin: 0;
    line-height: 1.5;
}

.ff-ip-map-gps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    background: #f5f5f5;
    border: 1px solid #ddd;
    transition: background .3s;
    width: 100%;
    box-sizing: border-box;
}

.ff-ip-map-gps-status.ff-gps-success {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.ff-ip-map-gps-status.ff-gps-error {
    background: #fff8e1;
    border-color: #ffe082;
    color: #795548;
}

.ff-ip-map-gps-status.ff-gps-pending {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1565c0;
}

/* ── Body lock when modal open ──────────────────────────────── */
body.ff-ip-map-modal-open {
    overflow: hidden;
}

/* Inline map */
.ff-ip-map-inline-wrap { margin: 12px 0 8px; }
.ff-ip-map-inline { height: 280px; width: 100%; border-radius: 6px; border: 1px solid #ddd; background: #f0f0f0; }
.ff-ip-map-pin-legend { font-size: 12px; color: #666; margin: 6px 0 0; }
.ff-ip-map-distance-banner { margin-top: 8px; font-size: 13px; font-weight: 600; }
.ff-ip-map-no-coords { color: #888; font-style: italic; padding: 10px 0; }

/* ── Force single-column in Gravity Flow entry editor ──────── */
.entry-detail-view .gform_wrapper.gravity-theme .gform_fields {
    display: block !important;
}
.entry-detail-view .gform_wrapper.gravity-theme .gfield {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
}
.entry-detail-view .gform_wrapper.gravity-theme .gfield[class*="gfield--width-"] {
    grid-column: 1 / -1 !important;
}

/* ── Match GF form labels to table-based entry detail style ── */
.entry-detail-view .gform_wrapper .gfield_label {
    display: block !important;
    width: 100% !important;
    background-color: #eaf2fa;
    border-bottom: 1px solid #fff;
    font-weight: 700 !important;
    line-height: 1.5;
    padding: 7px !important;
    margin: 0 0 0 0 !important;
    box-sizing: border-box;
}
.entry-detail-view .gform_wrapper .gravityflow-field-value {
    padding: 7px 7px 7px 40px;
    line-height: 1.8;
    border-bottom: 1px solid #dfdfdf;
}
.entry-detail-view .gform_wrapper .gfield {
    margin-bottom: 0 !important;
    padding: 0 !important;
}
