/* =============================================================
   CF7 Map Address Picker – Frontend Styles (OpenStreetMap/Leaflet)
   ============================================================= */

/* ---- Input row ---- */
.cf7map-address-wrap { display: block; width: 100%; }

.cf7map-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.cf7map-address-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: #111;
    box-sizing: border-box;
}

.cf7map-address-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.cf7map-address-input.cf7map-has-location {
    background: #eff6ff;
    border-color: #3b82f6;
    cursor: pointer;
}

.cf7map-address-input.cf7map-has-location:hover { border-color: #2563eb; }

/* ---- Harita aç butonu ---- */
.cf7map-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .1s;
    flex-shrink: 0;
}
.cf7map-open-btn:hover  { background: #1d4ed8; }
.cf7map-open-btn:active { transform: scale(.97); }
.cf7map-open-btn svg    { pointer-events: none; flex-shrink: 0; }

/* ---- Modal overlay ---- */
.cf7map-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.cf7map-overlay.cf7map-active { opacity: 1; visibility: visible; }

/* ---- Modal box ---- */
.cf7map-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(.97);
    transition: transform .25s;
}
.cf7map-overlay.cf7map-active .cf7map-modal { transform: translateY(0) scale(1); }

/* ---- Modal header ---- */
.cf7map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.cf7map-modal-title { font-size: 16px; font-weight: 600; color: #111; margin: 0; }
.cf7map-close-btn {
    background: none; border: none; cursor: pointer;
    color: #6b7280; font-size: 20px; line-height: 1;
    padding: 4px 6px; border-radius: 4px; transition: color .15s, background .15s;
}
.cf7map-close-btn:hover { color: #111; background: #f3f4f6; }

/* ---- Arama satırı ---- */
.cf7map-modal-search {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.cf7map-search-wrapper {
    flex: 1;
    position: relative;
}

.cf7map-search-input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.cf7map-search-input:focus { border-color: #3b82f6; }

/* Öneri listesi */
.cf7map-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none;
    margin: 0; padding: 4px 0;
    z-index: 10;
    max-height: 220px;
    overflow-y: auto;
}
.cf7map-suggestions li {
    padding: 9px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    transition: background .1s;
}
.cf7map-suggestions li:hover { background: #eff6ff; color: #1d4ed8; }

.cf7map-locate-btn {
    padding: 9px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: background .15s;
    flex-shrink: 0;
    line-height: 1;
}
.cf7map-locate-btn:hover { background: #e5e7eb; }

/* ---- Harita ---- */
.cf7map-map-container {
    flex: 1;
    min-height: 360px;
    position: relative;
}
#cf7map-leaflet {
    width: 100%;
    height: 100%;
    min-height: 360px;
    z-index: 1;
}

/* ---- Seçili adres bilgisi ---- */
.cf7map-selected-info {
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 40px;
}
.cf7map-selected-info svg { flex-shrink: 0; }

/* ---- Footer ---- */
.cf7map-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.cf7map-btn-cancel {
    padding: 9px 20px; background: #f3f4f6; color: #374151;
    border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: 500; transition: background .15s;
}
.cf7map-btn-cancel:hover { background: #e5e7eb; }

.cf7map-btn-confirm {
    padding: 9px 20px; background: #2563eb; color: #fff;
    border: none; border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: 500; transition: background .15s;
}
.cf7map-btn-confirm:hover    { background: #1d4ed8; }
.cf7map-btn-confirm:disabled { background: #93c5fd; cursor: not-allowed; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .cf7map-open-btn span { display: none; }
    .cf7map-modal { max-height: 100vh; border-radius: 0; }
    .cf7map-map-container { min-height: 280px; }
    #cf7map-leaflet { min-height: 280px; }
}
