/* Interactive Stall Map Styling */
.map-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #f1f5f9;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
    .map-container {
        height: min(500px, 70vh);
        overflow: auto; /* Enable touch scroll */
        -webkit-overflow-scrolling: touch;
        min-width: 100%; /* Default */
    }
    
    /* Ensure the map has enough room to breathe on small screens */
    #stall-map-container {
        min-width: 800px; 
    }
    
    /* Parent of map-container needs to handle the overflow */
    .lg\:col-span-8 {
        overflow-x: auto;
        border-radius: 1.5rem;
    }
}

.stall-marker {
    position: absolute;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    user-select: none;
    z-index: 10;
    border: 2px solid rgba(0,0,0,0.1);
}

.stall-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 20;
}

.stall-marker.selected {
    border-color: #ec5b13;
    box-shadow: 0 0 15px rgba(236, 91, 19, 0.5);
    z-index: 21;
}

.stall-marker.booked {
    background: #ef4444 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Shapes — dimensions driven by --stall-size (default 1) */
.shape-square {
    width: calc(40px * var(--stall-size, 1));
    height: calc(40px * var(--stall-size, 1));
    border-radius: 0.5rem;
}

.shape-circle {
    width: calc(45px * var(--stall-size, 1));
    height: calc(45px * var(--stall-size, 1));
    border-radius: 50%;
}

.shape-rect {
    width: calc(60px * var(--stall-size, 1));
    height: calc(35px * var(--stall-size, 1));
    border-radius: 0.4rem;
}

/* Editor Mode */
.map-container.edit-mode .stall-marker {
    cursor: move;
}

/* Sidebar Details */
.stall-details-panel {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

@media (min-width: 1024px) {
    .stall-details-panel {
        position: sticky;
        top: 100px;
    }
}

.cat-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Filters */
.map-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #ec5b13;
    color: white;
    border-color: #ec5b13;
}

/* Layout Labels */
.stall-marker.stall-label {
    background: #ffffff !important;
    color: #475569 !important;
    border: 2px dashed #94a3b8 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 2px;
    z-index: 5; /* Behind stalls but on the map */
}

.stall-marker.stall-label span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    text-align: center;
}

.stall-marker.stall-label:hover {
    border-style: solid !important;
    border-color: #64748b !important;
    z-index: 20;
}

.stall-marker.stall-label.selected {
    border-color: #3b82f6 !important;
    border-style: solid !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
