/**
 * POI Modal Styles - Google Maps-like design
 * Desktop: Left sidebar panel
 * Mobile: Bottom sheet
 */

/* === Modal Container === */
.poi-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.poi-modal.visible {
    visibility: visible;
    opacity: 1;
}

/* Backdrop */
.poi-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

/* === Container - Different layouts for mobile/desktop === */
.poi-modal-container {
    position: absolute;
    background: var(--ios-bg, #fff);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Desktop: Left sidebar (Google Maps style) */
@media (min-width: 769px) {
    .poi-modal {
        /* Don't block the entire screen on desktop */
        pointer-events: none;
    }

    .poi-modal-container {
        top: 0;
        left: 0;
        bottom: 0;
        width: 400px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: auto;
    }

    .poi-modal.visible .poi-modal-container {
        transform: translateX(0);
    }

    .poi-modal-backdrop {
        /* No dark backdrop on desktop - allow seeing map */
        display: none;
    }

    /* Header buttons more prominent on desktop */
    .poi-modal-header {
        top: 16px;
        right: 16px;
    }

    .poi-modal-close,
    .poi-modal-show-on-map,
    .poi-modal-add-photo {
        background: var(--ios-bg, #fff);
        color: var(--ios-text-secondary, #666);
    }

    .poi-modal-close:hover,
    .poi-modal-show-on-map:hover,
    .poi-modal-add-photo:hover {
        background: var(--ios-bg-secondary, #f2f2f7);
        color: var(--ios-text, #000);
    }
}

/* Mobile: Bottom sheet */
@media (max-width: 768px) {
    .poi-modal-container {
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Pull handle for bottom sheet */
    .poi-modal-container::before {
        content: '';
        display: block;
        width: 36px;
        height: 5px;
        background: var(--ios-separator, #d1d1d6);
        border-radius: 3px;
        margin: 8px auto 4px;
        flex-shrink: 0;
    }

    .poi-modal.visible .poi-modal-container {
        transform: translateY(0);
    }

    .poi-modal-backdrop {
        background: rgba(0, 0, 0, 0.5);
    }

    .poi-modal-header {
        top: 20px;
        right: 16px;
    }
}

/* === Content scrollable area === */
.poi-modal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* === Sticky footer close button === */
.poi-modal-footer {
    flex-shrink: 0;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--ios-separator, #e5e5ea);
    background: var(--ios-bg, #fff);
}

.poi-modal-footer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--ios-bg-secondary, #f2f2f7);
    color: var(--ios-text, #000);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.poi-modal-footer-close-btn:active {
    background: var(--ios-separator, #d1d1d6);
}

/* On desktop the top-right X is enough; footer close still works but less prominent */
@media (min-width: 769px) {
    .poi-modal-footer {
        padding: 8px 16px 10px;
    }
    .poi-modal-footer-close-btn {
        height: 40px;
        font-size: 14px;
        font-weight: 500;
        border-radius: 10px;
    }
}

/* Add safe-area padding for iOS home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .poi-modal-footer {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }
    }
}

/* === Incident modal helpers === */
.inc-modal-severity {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.inc-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--ios-text-secondary, #666);
}

.inc-modal-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Header with close button === */
.poi-modal-header {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
}

.poi-modal-close,
.poi-modal-show-on-map,
.poi-modal-add-photo {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background 0.2s;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.poi-modal-close:hover,
.poi-modal-show-on-map:hover,
.poi-modal-add-photo:hover {
    background: #fff;
    transform: scale(1.1);
}

.poi-modal-close:active,
.poi-modal-show-on-map:active,
.poi-modal-add-photo:active {
    transform: scale(0.95);
}

[data-theme="dark"] .poi-modal-close,
[data-theme="dark"] .poi-modal-show-on-map,
[data-theme="dark"] .poi-modal-add-photo {
    background: rgba(50, 50, 50, 0.9);
    color: #fff;
}

/* === Camera markers on map === */
.poi-cam-marker {
    background: transparent !important;
    border: none !important;
}

.poi-cam-marker-inner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 2px solid #fff;
}

.poi-cam-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #1a73e8;
    transform-origin: 6px 25px;
}

.poi-cam-popup-container .leaflet-popup-content-wrapper {
    padding: 4px;
    border-radius: 8px;
}

.poi-cam-popup-container .leaflet-popup-content {
    margin: 0;
}

.poi-cam-popup img {
    display: block;
    max-width: 200px;
    border-radius: 6px;
}

/* === Image Carousel === */
.poi-modal-images {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--ios-bg-secondary, #f2f2f7);
    overflow: hidden;
}

@media (min-width: 769px) {
    .poi-modal-images {
        aspect-ratio: 4 / 3;
    }
}

.poi-image-carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.poi-image-slides {
    width: 100%;
    height: 100%;
}

.poi-image-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poi-image-slide.active {
    opacity: 1;
}

.poi-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Shimmer skeleton while slide image loads */
.poi-image-slide.img-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: poi-shimmer 1.4s infinite;
    z-index: 1;
}
@media (prefers-color-scheme: dark) {
    .poi-image-slide.img-loading::before {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}
[data-theme="dark"] .poi-image-slide.img-loading::before,
.dark .poi-image-slide.img-loading::before {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}
.poi-image-slide.img-loading img {
    opacity: 0;
}
@keyframes poi-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image navigation buttons */
.poi-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 5;
}

.poi-image-carousel:hover .poi-image-nav {
    opacity: 1;
}

.poi-image-prev { left: 12px; }
.poi-image-next { right: 12px; }

.poi-image-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

/* Image counter */
.poi-image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Image source badge */
.poi-image-source {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mapillary/street view badge on image */
.poi-image-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 150, 136, 0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* No images state */
.poi-no-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ios-text-tertiary, #999);
    text-align: center;
    padding: 20px;
}

.poi-no-images i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.poi-no-images p {
    margin: 0 0 16px;
    font-size: 14px;
}

.poi-add-photo-btn {
    background: var(--ios-blue, #007AFF);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.poi-add-photo-btn:hover {
    background: #0056b3;
}

.poi-add-photo-btn:active {
    transform: scale(0.95);
}

/* On mobile: even larger touch target */
@media (max-width: 768px) {
    .poi-add-photo-btn {
        padding: 14px 28px;
        font-size: 16px;
        min-height: 48px;
    }
}

/* === POI Info Section === */
.poi-modal-info {
    padding: 20px;
}

.poi-name {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: var(--ios-text, #000);
    line-height: 1.3;
}

.poi-type {
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.poi-type i {
    color: var(--ios-blue, #007AFF);
}

/* Rating */
.poi-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.poi-rating-stars {
    color: #FFB800;
    font-size: 14px;
}

.poi-rating-stars i {
    margin-right: 1px;
}

.poi-rating-value {
    font-weight: 600;
    font-size: 15px;
    color: var(--ios-text, #000);
}

.poi-rating-count {
    color: var(--ios-text-secondary, #666);
    font-size: 13px;
}

/* Vote buttons */
.poi-vote-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.poi-vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--ios-separator, #e0e0e0);
    border-radius: 20px;
    background: var(--ios-bg, #fff);
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.poi-vote-btn:hover {
    background: var(--ios-fill, #f0f0f0);
}

.poi-vote-up:hover, .poi-vote-up.active, .poi-vote-up.poi-vote-active {
    border-color: #4CAF50;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.poi-vote-down:hover, .poi-vote-down.active, .poi-vote-down.poi-vote-active {
    border-color: #f44336;
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Address, contact, hours */
.poi-address,
.poi-hours {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
}
.poi-hours span {
    word-break: break-word;
    overflow-wrap: break-word;
    max-height: 4.5em;
    overflow: hidden;
    line-height: 1.5;
}

/* Clickable address - tap to copy */
.poi-address {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background 0.2s;
}

.poi-address:hover {
    background: var(--ios-fill, rgba(0,0,0,0.05));
}

.poi-address:active {
    background: var(--ios-fill-secondary, rgba(0,0,0,0.1));
}

.poi-address i,
.poi-hours i {
    color: var(--ios-blue, #007AFF);
    width: 16px;
    text-align: center;
    margin-top: 2px;
}

.poi-contact {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.poi-contact a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ios-blue, #007AFF);
    font-size: 14px;
    text-decoration: none;
}

.poi-contact a:hover {
    text-decoration: underline;
}

/* Description */
.poi-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ios-text, #333);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ios-separator, #e0e0e0);
}

/* Amenities */
.poi-amenities {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ios-separator, #e0e0e0);
}

.poi-amenities h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-text, #000);
}

.poi-amenities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.poi-amenity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ios-fill, #f0f0f0);
    border-radius: 16px;
    font-size: 13px;
    color: var(--ios-text-secondary, #666);
}

.poi-amenity i {
    color: #4CAF50;
    font-size: 10px;
}

/* === Action Buttons (mosaic grid) === */
.poi-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    padding: 0 4px;
}

.poi-actions .poi-loc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
}

/* Legacy compat — not used in grid mode */
.poi-action-btn {
    flex: 0 0 auto;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: none;
    border-radius: 12px;
    background: var(--ios-blue, #007AFF);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.poi-action-btn i {
    font-size: 18px;
}

.poi-action-btn:hover {
    background: #0056b3;
}

.poi-action-btn:active {
    transform: scale(0.95);
}

.poi-action-save {
    background: var(--ios-fill, #f0f0f0);
    color: var(--ios-text, #333);
}

.poi-action-save:hover {
    background: #e0e0e0;
}

/* Saved state */
.poi-action-save.saved {
    background: var(--ios-blue, #007AFF);
    color: #fff;
}

.poi-action-save.saved:hover {
    background: #0056b3;
}

.poi-action-share {
    background: var(--ios-fill, #f0f0f0);
    color: var(--ios-text, #333);
}

.poi-action-share:hover {
    background: #e0e0e0;
}

/* Share via Driver Connect button */
.poi-action-share-dc {
    background: #d0d0d5;
    color: #333;
    position: relative;
}

.poi-action-share-dc:hover {
    background: #bfbfc4;
}

.poi-dc-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0.3) saturate(0);
}

/* Ensure text is visible */
.poi-action-share-dc span {
    color: #333;
    font-weight: 500;
}

/* Dark mode - DC button - ensure visibility */
[data-theme="dark"] .poi-action-share-dc {
    background: #4a4a4f;
    color: #ffffff;
}

[data-theme="dark"] .poi-action-share-dc:hover {
    background: #5a5a5f;
    color: #ffffff;
}

[data-theme="dark"] .poi-action-share-dc span {
    color: #ffffff;
}

[data-theme="dark"] .poi-dc-icon {
    filter: brightness(0) invert(1);
}

/* === Reviews Section === */
.poi-modal-reviews {
    padding: 20px;
    border-top: 8px solid var(--ios-bg-secondary, #f2f2f7);
}

.poi-reviews-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.poi-reviews-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text, #000);
}

.poi-review-count {
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
}

/* Write review */
.poi-write-review {
    margin-bottom: 20px;
}

.poi-write-review-btn {
    width: 100%;
    padding: 14px;
    border: 1px dashed var(--ios-separator, #ccc);
    border-radius: 12px;
    background: transparent;
    color: var(--ios-blue, #007AFF);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.poi-write-review-btn:hover {
    background: var(--ios-fill, #f0f0f0);
}

.poi-review-form {
    margin-top: 12px;
}

.poi-review-name,
.poi-review-text {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ios-separator, #e0e0e0);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 10px;
    background: var(--ios-bg, #fff);
    color: var(--ios-text, #000);
}

.poi-review-text {
    min-height: 80px;
    resize: vertical;
}

.poi-review-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--ios-blue, #007AFF);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.poi-review-submit:hover {
    background: #0056b3;
}

/* Comment/Review item */
/* === Opinion Cards (Google Maps-style reviews) === */
.poi-opinion-card {
    padding: 14px 0;
    border-bottom: 1px solid var(--ios-separator, #e0e0e0);
}

.poi-opinion-card:last-child {
    border-bottom: none;
}

.poi-opinion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.poi-opinion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.poi-opinion-author-info {
    flex: 1;
    min-width: 0;
}

.poi-opinion-author {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--ios-text, #000);
}

.poi-opinion-time {
    display: block;
    font-size: 12px;
    color: var(--ios-text-tertiary, #999);
    margin-top: 1px;
}

.poi-opinion-stars {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

.poi-opinion-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ios-text, #333);
}

.poi-opinion-footer {
    display: flex;
    gap: 16px;
}

.poi-opinion-helpful,
.poi-comment-reply {
    background: none;
    border: none;
    padding: 4px 8px;
    color: var(--ios-text-secondary, #666);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.poi-opinion-helpful:hover,
.poi-comment-reply:hover {
    background: var(--ios-bg-secondary, #f2f2f7);
    color: var(--ios-blue, #007AFF);
}

.poi-opinion-helpful.voted {
    color: var(--ios-blue, #007AFF);
    font-weight: 600;
}

/* Nested replies */
.poi-comment-replies {
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid var(--ios-separator, #e0e0e0);
}

.poi-comment-replies .poi-opinion-card {
    padding: 12px 0;
}

.poi-no-reviews {
    text-align: center;
    color: var(--ios-text-tertiary, #999);
    font-size: 14px;
    padding: 20px;
}

/* Opinion (Review) — secondary grey style */
.poi-action-opinion {
    background: var(--ios-fill, #f0f0f0) !important;
    color: #F59E0B !important;
}
.poi-action-opinion:hover {
    background: #e4e4e4 !important;
}
.poi-action-opinion:active {
    background: #d8d8d8 !important;
}

/* Correction (Suggest edit) — secondary grey style */
.poi-action-correct {
    background: var(--ios-fill, #f0f0f0) !important;
    color: #3B82F6 !important;
}
.poi-action-correct:hover {
    background: #e4e4e4 !important;
}
.poi-action-correct:active {
    background: #d8d8d8 !important;
}

/* === Nearby Section === */
.poi-modal-nearby {
    padding: 20px;
    border-top: 8px solid var(--ios-bg-secondary, #f2f2f7);
}

.poi-modal-nearby h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text, #000);
}

.poi-nearby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poi-nearby-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ios-fill, #f0f0f0);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.poi-nearby-item:hover {
    background: var(--ios-fill-secondary, #e0e0e0);
}

.poi-nearby-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ios-blue, #007AFF);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
}

.poi-nearby-info {
    flex: 1;
}

.poi-nearby-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text, #000);
}

.poi-nearby-distance {
    font-size: 12px;
    color: var(--ios-text-secondary, #666);
}

/* === Loading State === */
.poi-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ios-bg, #fff);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.poi-modal.loading .poi-modal-loading {
    display: flex;
}

.poi-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ios-separator, #e0e0e0);
    border-top-color: var(--ios-blue, #007AFF);
    border-radius: 50%;
    animation: poi-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes poi-spin {
    to { transform: rotate(360deg); }
}

.poi-modal-loading p {
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
}

/* === Dark Mode === */
[data-theme="dark"] .poi-modal-container {
    background: var(--ios-bg, #1c1c1e);
}

[data-theme="dark"] .poi-image-nav {
    background: rgba(50, 50, 50, 0.9);
    color: #fff;
}

[data-theme="dark"] .poi-review-name,
[data-theme="dark"] .poi-review-text {
    background: var(--ios-bg-secondary, #2c2c2e);
    border-color: var(--ios-separator, #38383a);
}

/* === External POI Styles === */
/* Simplified view for external POIs (fuel stations, parking, etc.) */
.poi-modal.external-poi .poi-modal-images {
    /* Smaller or no image area for external POIs */
    min-height: auto;
}

/* Show loading/images placeholder for external POIs - they now fetch Mapillary */
.poi-modal.external-poi .poi-no-images {
    display: flex;
}

.poi-modal.external-poi .poi-modal-container {
    /* Slightly smaller modal for simple external POIs */
}

/* Image loading state */
.poi-image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ios-text-tertiary, #999);
}

.poi-image-loading i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--ios-blue, #007AFF);
}

/* External POI - compact amenities */
.poi-modal.external-poi .poi-amenities {
    margin-top: 8px;
}

.poi-modal.external-poi .poi-amenity {
    background: var(--ios-bg-secondary, #f2f2f7);
    color: var(--ios-text, #000);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 4px 4px 0 0;
}

.poi-modal.external-poi .poi-amenity i {
    color: var(--ios-green, #34c759);
    font-size: 10px;
}

[data-theme="dark"] .poi-modal.external-poi .poi-amenity {
    background: var(--ios-bg-secondary, #2c2c2e);
}

/* === Navigation Links (Coords, Waze, Google Maps) === */
.poi-nav-links {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ios-separator, #e0e0e0);
}

.poi-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid var(--ios-separator, #e0e0e0);
    border-radius: 10px;
    background: var(--ios-bg, #fff);
    color: var(--ios-text, #333);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.poi-nav-link:hover {
    background: var(--ios-fill, #f0f0f0);
}

.poi-nav-link:active {
    transform: scale(0.97);
}

.poi-nav-link svg {
    flex-shrink: 0;
}

[data-theme="dark"] .poi-nav-link {
    border-color: var(--ios-separator, #38383a);
    background: var(--ios-bg-secondary, #2c2c2e);
    color: var(--ios-text, #fff);
}

[data-theme="dark"] .poi-nav-link:hover {
    background: var(--ios-fill, #3a3a3c);
}

/* === SVG Icon Alignment === */
.poi-modal-info svg,
.poi-modal-reviews svg,
.poi-modal-nearby svg,
.poi-image-source svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.poi-address svg,
.poi-hours svg,
.poi-contact svg,
.poi-type svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Star rating SVGs */
.poi-rating-stars svg {
    color: #f5a623;
    vertical-align: middle;
}

.poi-star-half {
    display: inline-block;
    width: 7px;
    overflow: hidden;
    vertical-align: middle;
}

/* Spinner animation for SVG loaders */
.poi-spin {
    display: inline-flex;
    animation: poi-spin 1s linear infinite;
}

@keyframes poi-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Saved bookmark state — fill the SVG */
.poi-action-save.saved .poi-icon svg {
    fill: currentColor;
}

.poi-icon {
    display: inline-flex;
    align-items: center;
}

/* === Privacy Notice Dialog === */
.poi-privacy-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.poi-privacy-notice.visible {
    opacity: 1;
    visibility: visible;
}

.poi-privacy-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.poi-privacy-dialog {
    position: relative;
    background: var(--ios-bg, #fff);
    border-radius: 16px;
    padding: 24px;
    max-width: 380px;
    width: calc(100% - 40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.poi-privacy-notice.visible .poi-privacy-dialog {
    transform: scale(1);
}

.poi-privacy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.poi-privacy-header svg {
    color: var(--ios-blue, #007AFF);
    flex-shrink: 0;
}

.poi-privacy-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text, #000);
}

.poi-privacy-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.poi-privacy-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ios-text-secondary, #555);
}

.poi-privacy-list li svg {
    color: #4CAF50;
    flex-shrink: 0;
    margin-top: 2px;
}

.poi-privacy-actions {
    display: flex;
    gap: 10px;
}

.poi-privacy-cancel {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--ios-separator, #e0e0e0);
    border-radius: 10px;
    background: var(--ios-bg, #fff);
    color: var(--ios-text-secondary, #666);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.poi-privacy-cancel:hover {
    background: var(--ios-fill, #f0f0f0);
}

.poi-privacy-confirm {
    flex: 2;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--ios-blue, #007AFF);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.poi-privacy-confirm:hover {
    background: #0056b3;
}

/* Dark mode */
[data-theme="dark"] .poi-privacy-dialog {
    background: var(--ios-bg, #1c1c1e);
}

[data-theme="dark"] .poi-privacy-cancel {
    border-color: var(--ios-separator, #38383a);
    background: var(--ios-bg-secondary, #2c2c2e);
    color: var(--ios-text, #fff);
}

/* === Photo Upload === */

/* Add photo button in carousel — bottom-left, prominent on mobile */
.poi-add-photo-btn-carousel {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--ios-blue, #007AFF);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
    transition: all 0.2s ease;
    z-index: 5;
}

.poi-add-photo-btn-carousel:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.poi-add-photo-btn-carousel:active {
    transform: scale(0.95);
}

[data-theme="dark"] .poi-add-photo-btn-carousel {
    background: #0a84ff;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
}

/* On mobile: larger touch target */
@media (max-width: 768px) {
    .poi-add-photo-btn-carousel {
        padding: 10px 18px;
        font-size: 14px;
        bottom: 14px;
        left: 14px;
    }
}

/* Upload progress overlay */
.poi-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.poi-upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* Pending image overlay */
.poi-image-pending-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(2px);
}

/* My Photos in activity modal */
.poi-my-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px 0;
}

.poi-my-photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.poi-my-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poi-my-photo-status {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.poi-my-photo-status.approved {
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
}

.poi-my-photo-status.pending {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

.poi-my-photo-status.rejected {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.poi-my-photo-poi-name {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-my-photo-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Hover overlay with view + delete */
.poi-my-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.poi-my-photo-item:hover .poi-my-photo-overlay {
    opacity: 1;
}

.poi-my-photo-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.15s, background 0.15s;
}

.poi-my-photo-btn:hover {
    transform: scale(1.15);
}

.poi-my-photo-view {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.poi-my-photo-view:hover {
    background: #fff;
}

.poi-my-photo-delete {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.poi-my-photo-delete:hover {
    background: #dc3545;
}

/* Photo lightbox */
.nav-photo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: photoLightboxIn 0.2s ease;
}

@keyframes photoLightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-photo-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.nav-photo-lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.nav-photo-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.15s;
}

.nav-photo-lightbox-close:hover {
    background: #fff;
}

/* Mobile: always show overlay on touch devices */
@media (hover: none) {
    .poi-my-photo-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Dark mode */
[data-theme="dark"] .poi-my-photo-placeholder {
    background: #2c2c2e;
    color: #666;
}

/* === Mobile Optimizations === */
@media (max-width: 768px) {
    /* Larger touch targets on mobile */
    .poi-action-btn {
        min-height: 48px;
        font-size: 15px;
    }

    .poi-modal-close {
        width: 44px;
        height: 44px;
    }

    /* Better spacing for mobile */
    .poi-info {
        padding: 16px;
    }

    .poi-name {
        font-size: 22px;
    }

    /* Pull handle for bottom sheet */
    .poi-modal-container::before {
        content: '';
        display: block;
        width: 36px;
        height: 5px;
        background: var(--ios-separator, #e0e0e0);
        border-radius: 3px;
        margin: 8px auto;
    }

    /* Safe area for notched phones */
    .poi-actions {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* === Image Vote Overlay === */
.poi-img-vote-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 4px 12px;
    z-index: 3;
}

.poi-img-vote-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.poi-img-vote-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.poi-img-vote-btn.voted.up {
    color: #4ade80;
}

.poi-img-vote-btn.voted.down {
    color: #f87171;
}

.poi-img-vote-btn .count {
    font-size: 12px;
    font-weight: 600;
    min-width: 10px;
    text-align: center;
}

/* Gallery lightbox vote bar */
.v2-lightbox__vote-bar {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 6px 16px;
    z-index: 10;
}

.v2-lightbox__vote-bar .poi-img-vote-btn {
    font-size: 15px;
    padding: 6px 8px;
}

.v2-lightbox__vote-bar .poi-img-vote-btn .count {
    font-size: 14px;
}

/* Dark mode adjustments */
[data-theme="dark"] .poi-img-vote-bar {
    background: rgba(0, 0, 0, 0.7);
}

/* ============================================================
   LOCATION MODE — Map click actions (replaces context menu)
   ============================================================ */

/* Hide POI-specific sections, show location actions */
.poi-modal.location-mode .poi-rating,
.poi-modal.location-mode .poi-vote-buttons,
.poi-modal.location-mode .poi-contact,
.poi-modal.location-mode .poi-hours,
.poi-modal.location-mode .poi-description,
.poi-modal.location-mode .poi-amenities,
.poi-modal.location-mode .poi-actions,
.poi-modal.location-mode .poi-modal-reviews,
.poi-modal.location-mode .poi-modal-nearby,
.poi-modal.location-mode .poi-created-at,
.poi-modal.location-mode .poi-modal-add-photo {
    display: none !important;
}

.poi-location-actions {
    display: none;
}

.poi-modal.location-mode .poi-location-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 4px 8px;
}

/* Action buttons grid */
.poi-loc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
}

.poi-loc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px 10px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.poi-loc-btn:active {
    background: var(--ios-fill, rgba(120, 120, 128, 0.12));
}

.poi-loc-btn span {
    font-size: 11px;
    font-weight: 500;
    color: var(--ios-text, #1C1917);
    text-align: center;
    line-height: 1.3;
}

/* Icon circles */
.poi-loc-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    transition: transform 0.15s;
}

.poi-loc-btn:active .poi-loc-icon {
    transform: scale(0.92);
}

.poi-loc-icon--start {
    background: linear-gradient(135deg, #34C759, #30B350);
}

.poi-loc-icon--end {
    background: linear-gradient(135deg, #FF3B30, #E5342A);
}

.poi-loc-icon--via {
    background: linear-gradient(135deg, #FF9500, #E68600);
    color: #fff;
}

.poi-loc-icon--directions {
    background: linear-gradient(135deg, #007AFF, #0066D6);
    color: #fff;
}

.poi-loc-icon--ai {
    background: linear-gradient(135deg, #AF52DE, #9A42C8);
    color: #fff;
}

.poi-loc-icon--report {
    background: linear-gradient(135deg, #FF9500, #E68600);
    color: #fff;
}

.poi-loc-icon--share {
    background: linear-gradient(135deg, #5AC8FA, #4AB8EA);
    color: #fff;
}

.poi-loc-icon--save {
    background: linear-gradient(135deg, #FF9500, #E68600);
    color: #fff;
}

.poi-loc-icon--review {
    background: linear-gradient(135deg, #FFD60A, #E6C009);
    color: #fff;
}

.poi-loc-icon--edit {
    background: linear-gradient(135deg, #8E8E93, #7A7A7F);
    color: #fff;
}

.poi-loc-icon--dc {
    background: linear-gradient(135deg, #34C759, #28A745);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Saved state icon */
.poi-action-save.saved .poi-loc-icon--save {
    background: linear-gradient(135deg, #007AFF, #0066D6);
}

/* Divider */
.poi-loc-divider {
    height: 1px;
    background: var(--ios-separator, rgba(60, 60, 67, 0.12));
    margin: 8px 12px;
}

/* AI badge */
.poi-loc-badge {
    font-size: 9px;
    font-weight: 700;
    background: linear-gradient(135deg, #AF52DE, #5856D6);
    color: #fff;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] .poi-loc-btn span {
    color: var(--ios-text, #E7E5E4);
}

[data-theme="dark"] .poi-loc-btn:active {
    background: rgba(120, 120, 128, 0.24);
}

[data-theme="dark"] .poi-loc-divider {
    background: rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .poi-loc-icon--start {
    background: linear-gradient(135deg, #30D158, #28B94C);
}

[data-theme="dark"] .poi-loc-icon--end {
    background: linear-gradient(135deg, #FF453A, #E03E34);
}

[data-theme="dark"] .poi-loc-icon--directions {
    background: linear-gradient(135deg, #0A84FF, #0070E0);
}

[data-theme="dark"] .poi-loc-icon--ai {
    background: linear-gradient(135deg, #BF5AF2, #A845DB);
}
