/**
 * GGV World Map - WordPress Plugin Styles
 * Scoped to .ggv-container to avoid theme conflicts
 */

/* Container Wrapper - Inherit from WordPress theme */
.ggv-container {
    font-family: inherit;
}

/* Headings - Inherit from WordPress theme */
.ggv-container h1,
.ggv-container h2,
.ggv-container h3,
.ggv-container h4,
.ggv-container h5,
.ggv-container h6 {
    font-family: inherit;
    color: #212592;
    font-weight: 600;
}

/* Map Container */
.ggv-map-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: 2px solid #0d6efd;
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

#ggv-main-map {
    width: 100%;
    height: 500px;
    border-radius: 6px;
}

/* Custom Leaflet Marker Styles */
.leaflet-custom-marker {
    background: none;
    border: none;
}

.leaflet-custom-marker svg {
    display: block;
    transition: all 0.2s ease;
}

.leaflet-custom-marker:hover svg {
    transform: scale(1.2);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.5;
    font-size: 14px;
}

.leaflet-popup-tip {
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

/* Popup Navigation */
.ggv-popup {
    min-width: 200px;
}

.ggv-popup-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ggv-nav-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.ggv-nav-btn:hover:not(:disabled) {
    background: #f4f4f4;
    border-color: #999;
}

.ggv-nav-btn:active:not(:disabled) {
    background: #e4e4e4;
}

.ggv-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ggv-nav-text {
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
}

/* Reset Button Control */
.leaflet-control-zoom-reset {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    display: block;
    background-color: #fff;
    border-radius: 4px;
}

.leaflet-control-zoom-reset:hover {
    background-color: #f4f4f4;
    color: #333;
}

.leaflet-control-zoom-reset:active {
    background-color: #e4e4e4;
}

/* Info Panel - Scrollable */
.ggv-info-panel {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 24px;
    height: 680px;
    overflow-y: auto;
}

.ggv-info-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.ggv-info-panel h5 {
    font-size: 1rem;
    font-weight: normal;
}

.ggv-info-panel #ggv-link-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #212529;
}

.ggv-info-panel #ggv-link-description p {
    margin-bottom: 1rem;
}

.ggv-info-panel #ggv-link-creator,
.ggv-info-panel #ggv-link-location {
    font-size: 1rem;
    line-height: 1.6;
}

.ggv-info-panel #ggv-link-creator strong,
.ggv-info-panel #ggv-link-location strong {
    font-weight: 600;
}

/* Image Preview */
.ggv-image-preview {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* External Links */
.ggv-external-links a {
    display: block;
    margin-bottom: 0.5rem;
    word-break: break-all;
    color: #0d6efd;
}

.ggv-external-links a:hover {
    text-decoration: underline;
}

/* Messages */
.ggv-messages {
    margin-bottom: 1rem;
}

/* Legend */
.ggv-legend {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ggv-legend h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.ggv-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ggv-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ggv-legend-color.blue { background-color: #0066CC; }
.ggv-legend-color.green { background-color: #00AA00; }
.ggv-legend-color.red { background-color: #CC0000; }
.ggv-legend-color.orange { background-color: #FF8800; }
.ggv-legend-color.yellow { background-color: #FFD700; }
.ggv-legend-color.black { background-color: #333333; }

/* Responsive */
@media (max-width: 991px) {
    .ggv-map-container,
    #ggv-main-map {
        height: 400px;
    }

    .ggv-info-panel {
        height: 580px;
        margin-top: 24px;
    }
}

@media (max-width: 767px) {
    .ggv-map-container,
    #ggv-main-map {
        height: 300px;
    }

    .ggv-info-panel {
        height: 480px;
        padding: 16px;
    }
}

/* Loading Spinner */
.ggv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.ggv-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: ggv-spin 1s linear infinite;
}

@keyframes ggv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
