/* map.css - Scaled down responsive version */
#map-container {
    top: 4rem;
    position: absolute;
    width: 100%;
    height: calc(100% - 4rem); /* Account for top offset */
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    box-sizing: border-box;
    /* Remove flex centering to allow map-display to fill the space */
}

#map-container.hidden {
    display: none !important;
}

#map-display {
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: #1a1a1a;
    /* Add subtle grid pattern for visual feedback when dragging */
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    /* Remove flex centering to allow proper scrolling */
    /* Remove max-width/max-height constraints for flexibility */
    /* Prevent text selection during panning */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.map-grid {
    position: relative;
    transform-origin: center center;
    padding: 20px;
    /* Use CSS custom properties for responsive sizing */
    /* Remove viewport constraints to allow full scrolling */
    width: var(--map-width, 2600px);
    height: var(--map-height, 2600px);
    /* Ensure minimum size for usability - increased for better drag area */
    min-width: 1200px;
    min-height: 1200px;
}

/* Auto-scale the map to fit the container */
@media (max-width: 768px) {
    #map-display {
        width: 95%;
        height: 85%;
        max-width: none;
        max-height: none;
    }

    .map-grid {
        padding: 10px;
        /* Removed fixed scale - zoom controls handle this now */
    }

    /* Keep consistent room sizes - zoom handles scaling */
    .map-room {
        width: 300px;
        height: 300px;
    }

    .map-room-name {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .map-grid {
        /* Removed fixed scale - zoom controls handle this now */
    }

    /* Keep consistent room sizes - zoom handles scaling */
    .map-room {
        width: 300px;
        height: 300px;
    }

    .map-room-name {
        font-size: 24px;
    }
}

.map-room {
    position: absolute;
    width: 300px;  /* Large rooms */
    height: 300px; /* Large rooms */
    border: 3px solid #444; /* Thicker border for larger rooms */
    border-radius: 12px; /* Larger radius proportional to size */
    background-color: #222;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* Larger shadow */
    /* Reset cursor for rooms */
    cursor: pointer !important;
}

.map-room:hover {
    transform: scale(1.1); /* Slightly more hover effect */
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 10;
    border-color: #666;
}

.map-room.current {
    border: 2px solid #f66;
    background-color: #332222;
    box-shadow: 0 0 10px #f66; /* Smaller glow */
}

.map-room-name {
    font-size: 24px; /* Much larger text for 300px rooms */
    color: white;
    text-align: center;
    padding: 8px; /* More padding for larger rooms */
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8); /* Stronger shadow */
    line-height: 1.2;
    word-wrap: break-word;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: rgba(0,0,0,0.7); /* Slightly more opaque */
    border-radius: 8px; /* Larger radius */
    position: absolute;
    bottom: 8px; /* More space from bottom */
    left: 8px;   /* More space from sides */
    right: 8px;
    z-index: 2; /* Ensure text appears above background image */
    pointer-events: none; /* Prevent interference with room clicks */
}

/* Remove exit indicators since we're only showing names and lines */
.map-exit {
    display: none; /* Hide exit indicators completely */
}

#map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 2000;
}

/* Removed - positioning moved to main #exit-map rule below */

.map-control-btn {
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:hover {
    background-color: rgba(255,100,100,0.2);
    border-color: #f66;
}

#exit-map {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2000;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

#exit-map:hover {
    background-color: rgba(255,100,100,0.2);
    border-color: #f66;
}

/* Ensure the map scrolls smoothly */
#map-display::-webkit-scrollbar {
    width: 6px;  /* Thinner scrollbar */
    height: 6px;
}

#map-display::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

#map-display::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

#map-display::-webkit-scrollbar-thumb:hover {
    background: #888;
}