.page-companies h2 {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #e6f0ff;
    text-align: left;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-title-row h2 {
    margin-bottom: 20px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #e6f0ff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Logout confirmation dialog */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirm-dialog {
    background: white;
    border-radius: 14px;
    padding: 36px;
    max-width: 460px;
    width: calc(100% - 40px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: dialog-in 0.15s ease-out;
}

@keyframes dialog-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.confirm-dialog h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 10px;
}

.confirm-dialog p {
    color: #666;
    font-size: 15px;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.confirm-cancel {
    background: #eef0f5;
    color: #333;
}

.confirm-cancel:hover {
    background: #e2e5ec;
}

.confirm-logout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.confirm-logout:hover {
    opacity: 0.9;
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 10px;
    padding: 10px 15px;
    border: 1px solid #d9eaff;
    gap: 15px;
}

.search-container input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 16px;
}

/* Filter Chips */
.chips {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.chip {
    padding: 8px 16px;
    background-color: #e6f0ff;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #c2d8ff;
}

.chip.active {
    background-color: #007bff;
    color: white;
}

/* Company Card */
.company-card {
    background: white;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #f59e0b;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 140px;
    max-height: 200px;
    overflow: hidden;
}

.company-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.company-card.no-tap {
    cursor: default;
}

.company-card.no-tap:hover {
    box-shadow: none;
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.company-title {
    font-weight: 700;
    font-size: 15px;
    color: #1d4ed8;
    flex: 1;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.company-desc {
    margin-top: 6px;
    font-size: 14px;
    color: #555;
}

.company-profile {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Expanded: card height stays fixed; text scrolls inside the profile area */
.company-profile.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow-y: auto;
    padding-right: 4px;
}

.read-more-link {
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    /* Safe area for notched devices */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.nav-item {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    white-space: nowrap;
    text-align: center;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}


#companyList {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    align-items: stretch;
}

#companyList > * {
    min-width: 0;
}

@media (max-width: 1100px) {
    #companyList {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    #companyList {
        grid-template-columns: 1fr;
    }

    .company-card {
        max-height: none;
    }

    .company-profile {
        -webkit-line-clamp: 3;
    }
}

.booth-number {
  background: #f0f4ff;
  color: #4f46e5;
  border: 1px solid #d4e0ff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-container {
  margin: 12px 0 20px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 0;
}

.tags-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

#tagsList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: white;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  border: 1px solid #d9eaff;
  transition: all 0.15s ease;
}

.tag-chip:hover {
  border-color: #667eea;
  background: #f8faff;
}

.tag-chip.active {
  background: #4338ca;
  color: white;
  border-color: #4338ca;
}


.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e1e9f6;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(26, 43, 75, 0.18);
    margin-top: 6px;
    z-index: 1000;
    overflow-y: auto;
    max-height: 320px;
}

.search-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #1a2b4b;
    border-bottom: 1px solid #f0f4ff;
    transition: background 0.15s ease;
}

.suggestion-kind {
    font-size: 11px;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-suggestion:hover {
    background: #f0f4ff;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.8;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
}

.empty-state p {
  margin: 0 0 24px;
  font-size: 15px;
  color: #555;
  max-width: 320px;
}

.reset-btn, .reset-btn2 {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    white-space: nowrap;
    flex-shrink: 0;
}

.reset-btn:hover, .reset-btn2:hover {
    opacity: 0.9;
}


/* Custom Dropdown */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px;
  border-radius: 10px;
  border: 1px solid #d9eaff;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background-color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #667eea;
  transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown.open .dropdown-selected {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #d9eaff;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-options::-webkit-scrollbar {
  width: 8px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f0f4ff;
  border-radius: 0 10px 10px 0;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.dropdown-selected input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
}

.dropdown-option {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4ff;
  transition: background 0.15s ease;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background: #f0f4ff;
}

.dropdown-option.selected {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}



@media (max-width: 768px) {
    .page-companies h2 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .nav-item {
        padding: 10px 18px;
        font-size: 13px;
    }

    .reset-btn, .reset-btn2 {
        padding: 10px 16px;
        font-size: 12px;
        font-weight: 500;
    }

    .search-container {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }

    .search-container input {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .company-card {
        padding: 14px 16px;
        min-height: 120px;
        max-height: 180px;
    }

    .company-title {
        font-size: 14px;
    }

    .company-profile {
        font-size: 12px;
        -webkit-line-clamp: 4;
    }

    .booth-number {
        font-size: 11px;
        padding: 2px 6px;
    }

    .chips {
        gap: 8px;
        padding-bottom: 8px;
    }

    .chip {
        padding: 6px 12px;
        font-size: 13px;
    }

    .dropdown-selected {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dropdown-option {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-companies h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .search-container {
        padding: 8px 10px;
        gap: 8px;
    }

    .search-container input {
        font-size: 14px;
    }

    .company-card {
        padding: 12px 14px;
    }

    .company-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .booth-number {
        margin-left: 0;
    }

    .nav-item {
        padding: 8px 14px;
        font-size: 12px;
    }

    .bottom-nav {
        padding: 12px 16px;
    }

    .reset-btn, .reset-btn2 {
        padding: 8px 14px;
        font-size: 11px;
        width: 100%;
    }

    .tag-chip {
        padding: 5px 10px;
        font-size: 12px;
    }
}

.company-card.company-full {
  opacity: 0.45;
  filter: grayscale(100%);
  pointer-events: none; /* disables clicks */
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  background: #9ca3af;
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.fully-booked-badge {
  background: #ef4444;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    opacity: 0.9;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: blink 1.4s infinite;
    animation-fill-mode: both;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.head-right {
    font-size: 18px;
    font-weight: 600;
    color: #0d6efd;
    background: #eef4ff;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #cfe0ff;
    white-space: nowrap;
}
#meetingCount {
    font-size: 18px;
    font-weight: 700;
    color: #083ea8;
}
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .head-right {
        width: 90%;
        text-align: center;
    }
}
/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 12px;
}

.page-btn {
    background: #ffffff;
    border: 1.5px solid #e4e7f2;
    border-radius: 10px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.08);
    border-color: #667eea;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-info {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* ---- Modern polish (companies page) ---- */
.page-companies h2 {
    color: #fff;
    font-size: 30px;
    letter-spacing: -0.3px;
}

.logout-btn {
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 9px 20px;
    color: #fff;
}

.search-container {
    border: none;
    border-radius: 14px;
    padding: 12px 14px 12px 20px;
    box-shadow: 0 8px 24px rgba(37, 0, 58, 0.18);
}

.search-container input {
    font-size: 15px;
    color: #2a2250;
    background: transparent;
}

.reset-btn, .reset-btn2 {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.filter-container { margin: 14px 0 22px; }

.dropdown-selected {
    border: none;
    border-radius: 14px;
    padding-top: 13px;
    padding-bottom: 13px;
    box-shadow: 0 8px 24px rgba(37, 0, 58, 0.14);
}

.dropdown-options {
    border: none;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(37, 0, 58, 0.28);
}

.dropdown-option.selected,
.dropdown-option:hover {
    background: #f3edff;
    color: #4a2a8a;
}

.tag-chip {
    border: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(37, 0, 58, 0.12);
}

.tag-chip.active {
    background: #4a2a8a;
}

/* Cards */
.company-card {
    border: none;
    border-left: 4px solid #764ba2;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 8px 22px rgba(37, 0, 58, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.company-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(37, 0, 58, 0.26);
}

.company-card.no-tap:hover {
    transform: none;
    box-shadow: 0 8px 22px rgba(37, 0, 58, 0.16);
}

.company-title {
    color: #3b2a7a;
    font-size: 16px;
}

.company-profile {
    color: #5b5876;
    font-size: 13.5px;
}

.booth-number {
    background: #f3edff;
    color: #5b2fa0;
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
}

.read-more-link { color: #764ba2; }

/* Pagination */
.page-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    color: #4a2a8a;
    box-shadow: 0 4px 12px rgba(37, 0, 58, 0.18);
}

.page-btn:hover:not(:disabled) {
    background: #f3edff;
}

.page-btn:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: none;
}

/* Bottom nav */
.bottom-nav {
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 24px rgba(37, 0, 58, 0.18);
}

/* ---- Companies page v2: roomier, cleaner ---- */
.page-companies { padding: 28px 48px 110px; }

.page-companies h2 {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 24px;
}

.page-title-row { margin-bottom: 4px; }

.search-container {
    padding: 8px 10px 8px 22px;
    border-radius: 16px;
}

.search-container input {
    font-size: 16px;
    padding: 10px 0;
}

.reset-btn2 { padding: 12px 22px; border-radius: 12px; }

.filter-container { margin: 16px 0 28px; }

.dropdown-selected {
    font-size: 15px;
    font-weight: 600;
    color: #3b2a7a;
    padding: 15px 20px;
    padding-right: 48px;
    border-radius: 16px;
}

#companyList { gap: 22px; }

.company-card {
    min-height: 170px;
    max-height: 230px;
    padding: 22px 24px;
    border-left: none;
    border-top: 4px solid transparent;
    border-image: none;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, #667eea, #764ba2) border-box;
    border-radius: 16px;
}

.company-header { margin-bottom: 12px; align-items: center; }

.company-title { font-size: 17px; font-weight: 700; }

.company-profile {
    font-size: 14px;
    line-height: 1.65;
    -webkit-line-clamp: 4;
}

.company-profile.empty {
    color: #a9a5c2;
    font-style: italic;
}

.booth-number { font-size: 12px; padding: 5px 12px; }

.meeting-count {
    display: block;
    font-size: 12px;
    color: #8a84ad;
    margin: -6px 0 10px;
}

.pagination { margin: 36px 0 16px; gap: 20px; }

.page-info { font-size: 15px; }

.bottom-nav { padding-top: 14px; }

@media (max-width: 768px) {
    .page-companies { padding: 18px 18px 100px; }
    .page-companies h2 { font-size: 26px; }
    #companyList { gap: 16px; }
}

/* ---- Navigation: sticky top bar (was fixed bottom) ---- */
.page-companies .bottom-nav,
.page-meetings .bottom-nav {
    position: sticky;
    top: 12px;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 900;
    width: fit-content;
    margin: 0 auto 20px;
    padding: 6px;
    gap: 4px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(37, 0, 58, 0.22);
}

.page-companies .nav-item,
.page-meetings .nav-item {
    padding: 10px 26px;
    font-size: 14px;
}

.page-companies,
.page-meetings {
    padding-bottom: 40px;
}
