/* ============================================
   MUCA Map Component - Namespaced Styles
   Prefix: .muca-map
   ============================================ */

.muca-map__debug-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.muca-map__debug-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.muca-map__debug-toggle input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.muca-map__debug-toggle label {
    cursor: pointer;
    font-weight: bold;
    margin: 0;
}

.muca-map__copy-btn {
    width: 100%;
    padding: 10px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.muca-map__copy-btn:hover {
    background: #0052a3;
}

.muca-map__copy-btn--copied {
    background: #28a745;
}

/* Main map container */
.muca-map {
    position: relative;
    width: 100%;
    max-width: 2048px;
    margin: 0 auto;
}

.muca-map__img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hotspot base styles */
.muca-map__hotspot {
    position: absolute;
    display: block;
    background: rgba(255, 255, 255, 0);
    outline: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.muca-map__hotspot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Non-debug mode: animated staggered border */
.muca-map:not(.muca-map--debug-mode) .muca-map__hotspot {
    border: 2px solid rgb(255, 255, 4, 0.3);
    animation: muca-map-border-pulse 2s ease-in-out infinite;
    animation-delay: var(--muca-map-animation-delay, 0s);
}

@keyframes muca-map-border-pulse {
    0%, 100% {
        border-color: rgb(255, 255, 4, 0.2);
        box-shadow: 0 0 0 0 rgb(255, 255, 4, 0);
    }
    50% {
        border-color: rgb(255, 255, 4, 0.6);
        box-shadow: 0 0 8px 0 rgb(255, 255, 4, 0.3);
    }
}

/* Debug mode: interactive hotspot styles */
.muca-map--debug-mode .muca-map__hotspot {
    background: rgba(0, 255, 255, 0.12);
    border: 1px solid rgba(0, 255, 255, 0.5);
    cursor: grab;
}

.muca-map--debug-mode .muca-map__hotspot:hover {
    background: rgba(255, 255, 0, 0.15);
    border-color: rgba(255, 255, 0, 0.8);
}

.muca-map--debug-mode .muca-map__hotspot--dragging {
    cursor: grabbing;
    background: rgba(255, 100, 0, 0.2) !important;
    border-color: rgba(255, 100, 0, 0.8) !important;
}

.muca-map--debug-mode .muca-map__hotspot--selected {
    background: rgba(255, 255, 0, 0.15);
    border-color: rgba(255, 255, 0, 0.8);
}

/* Hotspot info tooltip */
.muca-map__hotspot-info {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5000;
    font-family: 'Courier New', monospace;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Resize handle */
.muca-map__resize-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 100, 0, 0.8);
    border: 2px solid rgba(255, 150, 0, 1);
    border-radius: 2px;
    cursor: se-resize;
    bottom: -10px;
    right: -10px;
    display: none;
    z-index: 6000;
}

.muca-map--debug-mode .muca-map__hotspot--selected .muca-map__resize-handle {
    display: block;
}
