/* Exhibition Floor Plan - PHP Frontend Styles with Booth Click & Company Details */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    overflow: hidden;
}

/* App Container - Full Screen Canvas */
.app-container {
    display: block;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Canvas Container - Full Screen */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    overflow: hidden;
}

#floorPlanCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#floorPlanCanvas:active {
    cursor: grabbing;
}

#floorPlanCanvas.clickable {
    cursor: pointer;
}

/* Search Overlay */
.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
}

/* Minimal Search Box (Default State) */
.search-box-minimal {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: all;
    transition: all 0.3s ease;
}

.search-input-minimal {
    width: 280px;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid rgba(150, 150, 200, 0.9);
    border-radius: 25px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    color: #333;
}

.search-input-minimal::placeholder {
    color: #6c757d;
}

.search-input-minimal:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.search-input-minimal:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Expanded Search Panel */
.search-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    display: flex;
    flex-direction: column;
}

.search-panel.expanded {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.search-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.search-title h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-search {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-search:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.search-subtitle {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
    margin: 0;
}

/* Search Mode Content */
.search-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-box-expanded {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.search-menu-wrapper {
    position: relative;
    flex-shrink: 0;
}

.search-input-expanded {
    flex: 1;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input-expanded:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-menu-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.search-menu-btn span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #495057;
    display: block;
}

.search-menu-btn:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.search-menu-btn:focus-visible {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.search-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 150px;
    padding: 8px;
    border: 1px solid #dfe3e8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
}

.search-menu-dropdown.open {
    display: flex;
}

.search-menu-option {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: #f8f9fa;
    color: #212529;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-menu-option:hover,
.search-menu-option:focus-visible {
    background: #667eea;
    color: #fff;
}

.search-stats {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Company Details Mode */
.company-details {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.company-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.company-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.company-name {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.3;
}

.booth-id-large {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    background: #f8f9ff;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.company-data {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hashtag {
    background: #d8d9da;
    border-radius: 5px;
    padding: 5px;
    margin: 3px;
    font-size: 80%;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.data-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
}

.data-value {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.company-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.action-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.action-btn.secondary:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

/* Exhibitor List */
.exhibitor-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 200px;
}

.exhibitor-item {
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.exhibitor-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.exhibitor-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.2);
}

.exhibitor-item.selected::before {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 12px;
    color: #2196f3;
    font-weight: bold;
    font-size: 16px;
}

.booth-id {
    font-weight: 600;
    font-size: 14px;
    color: #667eea;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.booth-id::before {
    content: "🏢";
    margin-right: 6px;
}

.company-name {
    font-size: 14px;
    color: #212529;
    line-height: 1.4;
    margin-bottom: 6px;
    font-weight: 500;
}

.hall {
    font-size: 11px;
    color: #6c757d;
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 500;
}

.hall.H1 {
    background: #e3f2fd;
    color: #1976d2;
}

.hall.H2 {
    background: #e8f5e8;
    color: #388e3c;
}

.hall.H3 {
    background: #fff3e0;
    color: #f57c00;
}

.hall.H3A {
    background: #fce4ec;
    color: #c2185b;
}

.hall.FOOD {
    background: #fff8e1;
    color: #f57f17;
}

.hall.ENTRANCE {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Action Buttons (for search mode) */
.action-buttons {
    padding: 16px 20px;
    /* padding-bottom: env(safe-area-inset-bottom, 30px); */
    padding-bottom: 70px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
}

.waypoint-btn,
.clear-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.waypoint-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.waypoint-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.clear-btn {
    background: #6c757d;
    color: white;
}

.clear-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
}

/* Loading States */
.loading,
.canvas-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

.canvas-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    z-index: 5;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Canvas Controls */
.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* App Info */
.app-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-size: 12px;
    display: flex;
    gap: 16px;
    z-index: 10;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-item .label {
    color: #6c757d;
    font-weight: 500;
}

.info-item span:not(.label) {
    color: #495057;
    font-weight: 600;
}

/* Touch Instructions */
.touch-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 8;
    opacity: 0;
    animation: fadeInOut 5s ease-in-out;
    text-align: center;
    pointer-events: none;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
    }

    20%,
    80% {
        opacity: 1;
    }
}

/* The box styling */
.message-box {
    position: fixed;
    bottom: 20px;
    right: 100px;
    padding: 15px 25px;
    background-color: #333;
    color: white;
    border-radius: 8px;
    opacity: 0;
    /* Hidden by default */
    pointer-events: none;
}

/* The animation class */
.show-fade {
    animation: fadeInOut 5s ease-in-out;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-input-minimal {
        width: 240px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .search-panel {
        width: 100vw;
        height: 100vh;
        /* height: 100dvh; */
    }

    .canvas-controls {
        bottom: 70px;
        /* bottom: calc(30px + env(safe-area-inset-bottom)); */
        right: 15px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .app-info {
        bottom: 70px;
        /* bottom: calc(30px + env(safe-area-inset-bottom)); */
        left: 15px;
        /* flex-direction: column; */
        gap: 8px;
        font-size: 11px;
    }

    .touch-instructions {
        font-size: 12px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .search-box-minimal {
        top: 15px;
        left: 15px;
    }

    .search-input-minimal {
        width: 200px;
        padding: 8px 12px;
        font-size: 14px;
    }

    /* .app-info { */
    /* display: none; */
    /* Hide on very small screens */
    /* } */

    .touch-instructions {
        display: none;
    }

    .company-actions {
        gap: 8px;
    }

    .action-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .search-input-minimal {
        padding: 14px 16px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .search-input-expanded {
        padding: 16px 18px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .search-menu-btn {
        width: 52px;
        height: 52px;
    }

    .exhibitor-item {
        padding: 20px 16px;
        margin-bottom: 12px;
    }

    .waypoint-btn,
    .clear-btn {
        padding: 14px 18px;
        font-size: 16px;
    }

    .control-btn {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .action-btn {
        padding: 18px 20px;
        font-size: 16px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .search-input-minimal {
        border-color: #000;
        background: #fff;
    }

    .search-panel {
        box-shadow: 0 0 0 2px #000;
    }

    .exhibitor-item {
        border-color: #000;
    }
}

/* Print Styles */
@media print {

    .search-overlay,
    .canvas-controls,
    .app-info,
    .touch-instructions {
        display: none;
    }

    .canvas-container {
        position: static;
        width: 100%;
        height: 100%;
    }
}