/* ============================================================
   My Travel Planner — Maps & Place Discovery Styles
   Covers: map container, place cards, place detail modal,
           "What editors say" enrichment panel, photo gallery.
   ============================================================ */

/* ── Map panel ─────────────────────────────────────────────── */

.mtp-map-panel {
    position: relative;
    width: 100%;
    border-top: 1px solid var(--mtp-border);
    overflow: hidden;
    transition: height 0.3s ease;
}

.mtp-map-panel.mtp-collapsed {
    height: 0;
    border-top: none;
}

#mtp-map-canvas {
    width: 100%;
    height: 320px;
    background: #e8eaed;
}

.mtp-map-toggle-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 10;
    background: var(--mtp-surface);
    border: 1px solid var(--mtp-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--mtp-text-secondary);
}

.mtp-map-toggle-btn:hover {
    background: var(--mtp-surface-hover);
}

/* ── Place search bar ──────────────────────────────────────── */

.mtp-place-search {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: var(--mtp-surface);
    border-bottom: 1px solid var(--mtp-border);
}

.mtp-place-search-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--mtp-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--mtp-bg);
    color: var(--mtp-text);
    outline: none;
    transition: border-color 0.15s;
}

.mtp-place-search-input:focus {
    border-color: var(--mtp-accent);
}

.mtp-place-search-btn {
    padding: 6px 14px;
    background: var(--mtp-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.mtp-place-search-btn:hover {
    background: var(--mtp-accent-hover);
}

/* ── Place results list ────────────────────────────────────── */

.mtp-place-results {
    padding: 8px 0;
    overflow-y: auto;
    max-height: 360px;
}

.mtp-place-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--mtp-border-subtle, rgba(0,0,0,0.05));
    transition: background 0.12s;
}

.mtp-place-result-item:hover {
    background: var(--mtp-surface-hover);
}

.mtp-place-result-photo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--mtp-border);
}

.mtp-place-result-photo-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--mtp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--mtp-text-secondary);
}

.mtp-place-result-body {
    flex: 1;
    min-width: 0;
}

.mtp-place-result-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--mtp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtp-place-result-address {
    font-size: 12px;
    color: var(--mtp-text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtp-place-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.mtp-place-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--mtp-text-secondary);
}

.mtp-place-rating .mtp-star {
    color: #f59e0b;
    font-size: 11px;
}

.mtp-place-open-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.mtp-place-open-badge.open {
    background: #d1fae5;
    color: #065f46;
}

.mtp-place-open-badge.closed {
    background: #fee2e2;
    color: #991b1b;
}

/* "Featured in" editorial badge */
.mtp-featured-badge {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #ede9fe;
    color: #5b21b6;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ── Place detail modal ────────────────────────────────────── */

.mtp-place-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 16px;
    animation: mtpFadeIn 0.15s ease;
}

.mtp-place-modal.mtp-hidden {
    display: none;
}

.mtp-place-modal-inner {
    background: var(--mtp-surface);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* ── Photo gallery ─────────────────────────────────────────── */

.mtp-place-photos {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--mtp-border);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.mtp-place-photo-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mtp-place-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: linear-gradient(135deg, #e0e7ff, #dbeafe);
}

.mtp-place-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.mtp-place-modal-close:hover {
    background: rgba(0,0,0,0.65);
}

/* ── Modal content ─────────────────────────────────────────── */

.mtp-place-modal-content {
    padding: 18px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mtp-place-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mtp-place-modal-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--mtp-text);
    line-height: 1.25;
    margin: 0;
}

.mtp-place-modal-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mtp-place-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.mtp-place-action-btn.primary {
    background: var(--mtp-accent);
    color: #fff;
}

.mtp-place-action-btn.primary:hover {
    background: var(--mtp-accent-hover);
}

.mtp-place-action-btn.secondary {
    background: var(--mtp-surface-hover);
    color: var(--mtp-text);
}

.mtp-place-action-btn.secondary:hover {
    background: var(--mtp-border);
}

.mtp-place-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mtp-place-modal-address {
    font-size: 13px;
    color: var(--mtp-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.mtp-place-modal-description {
    font-size: 13.5px;
    color: var(--mtp-text-secondary);
    line-height: 1.55;
}

.mtp-place-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 13px;
}

.mtp-place-detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mtp-place-detail-label {
    font-size: 11px;
    color: var(--mtp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.mtp-place-detail-value {
    color: var(--mtp-text);
    font-size: 13.5px;
}

.mtp-place-detail-value a {
    color: var(--mtp-accent);
    text-decoration: none;
}

.mtp-place-detail-value a:hover {
    text-decoration: underline;
}

/* ── Hours ─────────────────────────────────────────────────── */

.mtp-place-hours {
    font-size: 13px;
}

.mtp-place-hours-toggle {
    background: none;
    border: none;
    color: var(--mtp-accent);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
}

.mtp-place-hours-list {
    margin-top: 6px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mtp-place-hours-list li {
    font-size: 12.5px;
    color: var(--mtp-text-secondary);
}

/* ── Reviews ───────────────────────────────────────────────── */

.mtp-place-reviews {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtp-place-reviews-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--mtp-text);
}

.mtp-place-review {
    background: var(--mtp-bg);
    border-radius: 8px;
    padding: 10px 12px;
}

.mtp-place-review-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--mtp-text);
}

.mtp-place-review-text {
    font-size: 12.5px;
    color: var(--mtp-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── "What editors say" — Tavily enrichment ────────────────── */

.mtp-editors-say {
    border-top: 1px solid var(--mtp-border);
    padding-top: 14px;
}

.mtp-editors-say-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--mtp-text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mtp-editors-say-heading .mtp-badge-purple {
    font-size: 10px;
    background: #ede9fe;
    color: #5b21b6;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.mtp-editors-snippets {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtp-editorial-snippet {
    background: var(--mtp-bg);
    border-radius: 8px;
    padding: 10px 12px;
}

.mtp-editorial-source {
    font-size: 11px;
    font-weight: 600;
    color: var(--mtp-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mtp-editorial-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--mtp-text);
    margin-top: 2px;
}

.mtp-editorial-text {
    font-size: 12.5px;
    color: var(--mtp-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mtp-editorial-link {
    font-size: 12px;
    color: var(--mtp-accent);
    text-decoration: none;
    margin-top: 4px;
    display: inline-block;
}

.mtp-editorial-link:hover {
    text-decoration: underline;
}

/* Skeleton loader for async Tavily enrichment */
.mtp-editors-say-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mtp-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--mtp-border) 25%, var(--mtp-surface-hover) 50%, var(--mtp-border) 75%);
    background-size: 200% 100%;
    animation: mtpSkeletonShimmer 1.4s infinite;
}

.mtp-skeleton-line.w-60  { width: 60%; }
.mtp-skeleton-line.w-80  { width: 80%; }
.mtp-skeleton-line.w-full { width: 100%; }
.mtp-skeleton-line.h-16  { height: 16px; }

@keyframes mtpSkeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Map pin popups ────────────────────────────────────────── */

.mtp-map-popup {
    font-family: inherit;
    min-width: 160px;
    max-width: 240px;
}

.mtp-map-popup-name {
    font-weight: 700;
    font-size: 13.5px;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.mtp-map-popup-address {
    font-size: 11.5px;
    color: #6b7280;
    margin-bottom: 6px;
}

.mtp-map-popup-btn {
    display: block;
    width: 100%;
    padding: 5px 0;
    text-align: center;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 500;
}

.mtp-map-popup-btn:hover {
    background: #4f46e5;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 520px) {
    .mtp-place-modal-inner {
        max-height: 96vh;
        border-radius: 14px 14px 0 0;
        margin-top: auto;
    }

    .mtp-place-modal {
        align-items: flex-end;
        padding: 0;
    }

    .mtp-place-detail-grid {
        grid-template-columns: 1fr;
    }

    #mtp-map-canvas {
        height: 220px;
    }
}
