:root {
    --primary-color: #e11d48;
    --primary-hover: #be123c;
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-bg: #ffffff;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --font-inter: 'Inter', sans-serif;
    --font-outfit: 'Outfit', sans-serif;
    --z-sidebar: 50;
    --z-header: 40;
}

.mobile-only {
    display: none;
}

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

body {
    font-family: var(--font-inter);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    height: 64px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-outfit);
}

.mwc-text {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.year-text {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-muted);
}

.dash-text {
    margin-left: 8px;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-main);
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin-left: 48px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

#search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #f1f5f9;
    font-size: 0.95rem;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    padding: 0 4px;
}

.search-clear-btn:hover {
    color: var(--primary-color);
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    /* Reduced vertical space for tags slicer */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

/* Custom Multi-select Dropdown */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-header {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Multi-select Clear Button */
.clear-link {
    font-size: 0.7rem;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    margin-left: auto;
    font-weight: 500;
}

.clear-link:hover {
    color: var(--primary-hover);
}

.multi-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
    display: none;
    box-shadow: var(--shadow-md);
}

.multi-select-container.open .multi-select-options {
    display: block;
}

.multi-select-option {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.multi-select-option:hover {
    background: #f8fafc;
}

.select-all-option {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.options-list {
    display: flex;
    flex-direction: column;
}

.filter-item:hover {
    background: #f1f5f9;
}

.filter-item.active {
    background: #fee2e2;
    color: var(--primary-color);
    font-weight: 500;
}

.filter-item input {
    cursor: pointer;
}

.stats {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.content {
    flex: 1;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-container {
    flex: 1;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: auto;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 5;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s;
}

th:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

th.sort-asc::after {
    content: ' ↑';
    color: var(--primary-color);
}

th.sort-desc::after {
    content: ' ↓';
    color: var(--primary-color);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

tr:hover td {
    background-color: #fcfcfc;
}

.col-name {
    width: 22%;
}

.col-location {
    width: 18%;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.col-hall {
    width: 10%;
}

.col-tags {
    width: 40%;
}

.col-info {
    width: 10%;
    text-align: center;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exhibitor-name {
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e2e8f0;
    color: #475569;
}

.badge-hall {
    background: #dbeafe;
    color: #1e40af;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.interest-tag {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Tag category coloring (Restored) */
.tag-cat-1 {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Green - AI/Tech */
.tag-cat-2 {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Blue - 5G/Network */
.tag-cat-3 {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fef08a;
}

/* Yellow - Business/Apps */
.tag-cat-4 {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

/* Pink - Media/Creative */
.tag-cat-5 {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

/* Purple - Security */
.tag-cat-6 {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* Orange - IoT */

/* Hall category coloring */
.hall-cat-1 {
    background: #fdf2f8;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

.hall-cat-2 {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.hall-cat-3 {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

.hall-cat-4 {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #cffafe;
}

.hall-cat-5 {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

.hall-cat-6 {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.hall-cat-7 {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #ffedd5;
}

.hall-cat-8 {
    background: #fff1f2;
    color: #9d174d;
    border: 1px solid #ffe4e6;
}

.hall-cat-other {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.exhibitor-name i {
    font-style: normal;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 4px;
}

.exhibitor-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.exhibitor-link:hover {
    color: var(--primary-color);
}

.btn-info {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    position: relative;
}

.btn-info:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fee2e2;
}

/* Floating Tooltip */
.floating-tooltip {
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    display: none;
    line-height: 1.4;
    white-space: normal;
}

/* Dialog */
.dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.dialog-content {
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header h2 {
    font-family: var(--font-outfit);
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.dialog-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-row {
    margin-bottom: 20px;
}

.detail-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.info-text {
    white-space: pre-line;
    color: #334155;
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.btn-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-link:hover {
    background: var(--primary-hover);
}

/* Loading overlay */
.table-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.loading-shimmer-s {
    height: 20px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mobile Refinements */
@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }

    header {
        padding: 0 12px;
        height: 56px;
    }

    .dash-text {
        display: none;
        /* Hide subtitle to save space */
    }

    .filter-toggle-btn {
        background: var(--bg-color);
        border: 1px solid var(--border-color);
        padding: 6px 12px;
        border-radius: var(--radius);
        margin-left: 8px;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        color: var(--text-main);
        cursor: pointer;
    }

    .search-container {
        margin-left: 8px;
        max-width: none;
    }

    #search-input {
        padding: 8px 10px 8px 34px;
        font-size: 0.85rem;
    }

    main {
        position: relative;
    }

    /* Transform Sidebar into a Drawer on Mobile */
    .sidebar {
        position: absolute;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100%;
        z-index: var(--z-sidebar);
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: calc(var(--z-sidebar) - 1);
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content {
        padding: 12px;
    }

    /* Table adjustments */
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
        /* Allow horizontal scroll instead of squishing */
    }

    .col-tags {
        display: table-cell;
        /* Keep tags visible, let user scroll horizontally */
        width: 250px;
    }

    .col-location {
        display: none;
        /* Keep location hidden on very small screens to simplify */
    }

    .col-name {
        width: 40%;
    }

    .col-hall {
        width: 20%;
    }

    .col-info {
        width: 15%;
    }
}