/**
 * UAZA Interactive Map Styles
 *
 * Responsive styles for the interactive Ukrainian heritage map
 * Includes marker styling, info card, and responsive layout
 *
 * @package UAZA_Blocks
 * @since 1.0.33
 */

/* Container and Map */
.uaza-map-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 800px;
    background: white;
    border-radius: 0;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.map-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 100;
}

.map-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #202124;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

.uaza-map {
    width: 100%;
    flex: 1;
    min-height: 700px;
    position: relative;
    overflow: visible;
}

/* Hide Google Maps marker label completely */
.gm-style-infowindow,
.gm-style .gm-style-mtc,
.gm-style label,
.gm-style-mtc label {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Marker wrapper - container for pin and label */
.marker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Marker label styling */
.marker-label {
    background: white;
    border-radius: 3px;
    padding: 6px 11px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    font-weight: 400;
    color: #202124;
    white-space: normal;
    word-break: break-word;
    max-width: 180px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    border: none;
    transition: box-shadow 0.15s ease;
}

.marker-label:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.marker-pin-container {
    width: 24px;
    height: 32px;
}

/* Info Card - Floating Window Anchored to Marker */
.info-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    pointer-events: auto;
}

/* Arrow pointer anchoring to marker */
.info-card::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Arrow points up when card is below marker */
.info-card.below-marker::before {
    border-top: 8px solid white;
    border-bottom: none;
    bottom: auto;
    top: -8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.info-card.hidden {
    display: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.card-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.card-close:hover {
    background: #f5f5f5;
    border-radius: 50%;
    color: #333;
}

.card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
    border-radius: 0 0 0 0;
}

.card-body {
    padding: 12px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.card-category {
    font-size: 12px;
    color: #EA4335;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.card-meta {
    font-size: 11px;
    color: #999;
    margin: 0 0 8px 0;
    display: flex;
    gap: 8px;
}

.card-description {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-address {
    font-size: 11px;
    color: #666;
    margin: 0 0 8px 0;
    display: flex;
    gap: 6px;
}

.card-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.card-button {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    background: white;
    color: #1f73db;
    text-decoration: none;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: inline-block;
}

.card-button:hover {
    background: #f8f9fa;
    border-color: #1f73db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .uaza-map-container {
        min-height: 400px;
    }

    .uaza-map {
        min-height: 400px;
    }

    .map-header h2 {
        font-size: 20px;
    }

    .info-card {
        width: 280px;
        max-height: 450px;
    }

    .card-image {
        height: 130px;
    }
}

@media (max-width: 480px) {
    .uaza-map-container {
        min-height: 350px;
        border-radius: 4px;
    }

    .uaza-map {
        min-height: 350px;
    }

    .map-header h2 {
        font-size: 18px;
        padding: 12px 16px;
    }

    .info-card {
        width: 260px;
        max-height: 400px;
    }

    .card-image {
        height: 120px;
    }

    .marker-label {
        font-size: 11px;
        padding: 4px 8px;
        max-width: 160px;
    }
}
