* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Main Content */
.map-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex: 1;
    min-height: calc(100vh - 120px);
    margin: 1rem;
    touch-action: none;
}

.map-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
}

.map-canvas.dragging {
    cursor: grabbing;
}

.floor-plan {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    touch-action: none;
    user-select: none;
}

#boothOverlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* This container will transform exactly with the image */
}

.booth-overlay {
    position: absolute;
    background: transparent;
    border: 0px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
}

.booth-overlay:hover {
    opacity: 1;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid #2563eb;
}

.booth-overlay.has-exhibitor:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #16a34a;
}

.booth-overlay.no-exhibitor:hover {
    background: rgba(156, 163, 175, 0.3);
    border-color: #6b7280;
}

.booth-overlay.active {
    opacity: 1;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid #dc2626;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 1rem;
}

/* Controls */
.controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 20;
}

.control-btn {
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: #475569;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.control-btn:active {
    transform: scale(0.95);
}

/* Drawer */
.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 80vh;
    overflow: hidden;
}

.drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.close-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.drawer-content {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 4rem);
}

/* Booth Information */
.booth-number {
    font-size: 0.875rem;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exhibitor-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.location {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.description {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.contact-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.contact-info p {
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.contact-email a,
.contact-website a {
    color: #2563eb;
    text-decoration: none;
}

.contact-email a:hover,
.contact-website a:hover {
    text-decoration: underline;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (min-width: 768px) {
    .map-container {
        margin: 2rem;
        min-height: calc(100vh - 160px);
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .drawer {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: 20px;
        max-height: 70vh;
    }
    
    .drawer.open {
        transform: translateX(-50%) translateY(0);
    }
}

@media (min-width: 1024px) {
    .map-container {
        min-height: calc(100vh - 180px);
    }
}

/* Touch and Interaction */
@media (hover: none) and (pointer: coarse) {
    .control-btn:hover {
        background: white;
        border-color: #e2e8f0;
        color: #475569;
    }
    
    .close-btn:hover {
        color: #64748b;
        background: none;
    }
    
    /* Mobile touch improvements */
    .booth-overlay {
        /* Make overlays slightly more visible on mobile */
        opacity: 0.2;
        background: rgba(37, 99, 235, 0.15);
        border: 1px solid rgba(37, 99, 235, 0.3);
    }
    
    .booth-overlay.has-exhibitor {
        background: rgba(34, 197, 94, 0.15);
        border-color: rgba(22, 163, 74, 0.3);
    }
    
    .booth-overlay.no-exhibitor {
        background: rgba(156, 163, 175, 0.1);
        border-color: rgba(107, 114, 128, 0.3);
    }
    
    /* Active/pressed state for mobile */
    .booth-overlay:active {
        opacity: 1;
        background: rgba(37, 99, 235, 0.4);
        border-color: #2563eb;
        transform: scale(1.05);
    }
    
    .booth-overlay.has-exhibitor:active {
        background: rgba(34, 197, 94, 0.5);
        border-color: #16a34a;
    }
    
    .booth-overlay.no-exhibitor:active {
        background: rgba(156, 163, 175, 0.5);
        border-color: #6b7280;
    }
}

/* Handle notch on newer iPhones */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .drawer,
    .overlay {
        transition: none;
    }
}
