/* GRIM Map Tracker - Map Specific Styles */

/* Map Viewer Component */
.map-viewer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background-color: #0f0f23;
    border-radius: 4px;
    overflow: hidden;
}

.map-image {
    display: block;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.map-image-container.editor-mode {
    cursor: crosshair;
}

/* Map container with margins for grid labels */
.map-container {
    display: inline-block;
    position: relative;
    cursor: crosshair;
    margin-left: 25px;
    margin-top: 20px;
}

/* Map card container */
.map-card {
    display: flex;
    align-items: flex-start;
}

/* Constrain map image to fit container */
.map-container img,
.map-container img.img-fluid {
    max-height: calc(100vh - 300px) !important;
    max-width: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

.map-controls {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #16213e;
    border-radius: 4px;
}

.grid-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: #d1d5db;
}

.grid-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #e94560;
}

/* Pin Colors */
.pin-unknown { color: #6B7280; }
.pin-low { color: #22C55E; }
.pin-medium { color: #F59E0B; }
.pin-high { color: #EF4444; }

/* Threat Level Badges */
.threat-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.threat-unknown {
    background-color: #6B7280;
    color: white;
}

.threat-low {
    background-color: #22C55E;
    color: white;
}

.threat-medium {
    background-color: #F59E0B;
    color: #1a1a2e;
}

.threat-high {
    background-color: #EF4444;
    color: white;
}

/* Pin Marker Animation */
@keyframes pin-pulse {
    0%, 100% {
        transform: translate(-50%, -100%) scale(1);
    }
    50% {
        transform: translate(-50%, -100%) scale(1.1);
    }
}

/* Draggable pin styles */
.pin-marker.draggable {
    cursor: grab;
}

.pin-marker.draggable:active,
.pin-marker.dragging {
    cursor: grabbing;
    opacity: 0.8;
    z-index: 1000 !important;
    transform: translate(-50%, -100%) scale(1.2);
}

.pin-marker.new-pin {
    animation: pin-pulse 0.5s ease-in-out;
}

/* Pin Tooltip */
.pin-marker::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    pointer-events: none;
}

.pin-marker:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.grid-line {
    position: absolute;
    background-color: rgba(233, 69, 96, 0.25);
}

.grid-line.horizontal {
    left: 0;
    right: 0;
    height: 1px;
}

.grid-line.vertical {
    top: 0;
    bottom: 0;
    width: 1px;
}

.grid-label {
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    color: rgba(233, 69, 96, 0.8);
    background-color: rgba(26, 26, 46, 0.8);
    padding: 0.1rem 0.25rem;
    border-radius: 2px;
}

.column-label {
    top: 4px;
    transform: translateX(-50%);
}

.row-label {
    left: 4px;
    transform: translateY(-50%);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 0.5rem;
}

.zoom-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #374151;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.2s;
}

.zoom-btn:hover {
    background-color: #4b5563;
}

.zoom-btn:active {
    background-color: #e94560;
}

/* Responsive Map Adjustments */
@media (max-width: 768px) {
    .pin-marker {
        transform: translate(-50%, -100%) scale(0.85);
    }

    .pin-marker:hover {
        transform: translate(-50%, -100%) scale(1);
    }

    .grid-label {
        font-size: 0.5rem;
    }

    .map-container {
        margin-left: 20px;
        margin-top: 15px;
    }

    /* Pin Info Panel - bottom drawer on mobile */
    .pin-info-panel {
        position: fixed !important;
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 50vh;
        overflow-y: auto;
        border-radius: 1rem 1rem 0 0 !important;
        z-index: 1050;
    }
}

@media (max-width: 480px) {
    .map-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pin-label {
        display: none;
    }

    .map-container {
        margin-left: 15px;
        margin-top: 12px;
    }

    .grid-label {
        font-size: 0.4rem;
        padding: 0.05rem 0.15rem;
    }
}
