/**
 * Industry Category Dropdown - Stripe-style
 */

/* Dropdown Container */
.industry-dropdown {
    position: relative;
    width: 100%;
    max-width: 600px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.industry-dropdown label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.industry-dropdown .dropdown-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 400;
}

/* Trigger Button */
.industry-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
}

.industry-dropdown-trigger:hover {
    border-color: #9ca3af;
}

.industry-dropdown-trigger:focus,
.industry-dropdown-trigger.active {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.industry-dropdown-trigger .trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.industry-dropdown-trigger .trigger-text.placeholder {
    color: #9ca3af;
}

.industry-dropdown-trigger .trigger-icon {
    flex-shrink: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
}

.industry-dropdown-trigger .trigger-icon svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.industry-dropdown-trigger.active .trigger-icon svg {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.industry-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 360px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    flex-direction: column;
}

.industry-dropdown-panel.open {
    display: flex;
}

/* Search Input */
.industry-dropdown-search {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.industry-dropdown-search .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
}

.industry-dropdown-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: #374151;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.industry-dropdown-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.industry-dropdown-search input::placeholder {
    color: #9ca3af;
}

/* Scrollable List */
.industry-dropdown-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

/* Category Group */
.industry-category {
    border-bottom: 1px solid #f3f4f6;
}

.industry-category:last-child {
    border-bottom: none;
}

/* Category Header */
.industry-category-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.1s ease;
    user-select: none;
}

.industry-category-header:hover {
    background-color: #f9fafb;
}

.industry-category-header .chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.industry-category-header .chevron svg {
    width: 14px;
    height: 14px;
    color: #6b7280;
}

.industry-category.expanded .industry-category-header .chevron svg {
    transform: rotate(90deg);
}

/* Category Items */
.industry-category-items {
    display: none;
    padding: 0;
}

.industry-category.expanded .industry-category-items {
    display: block;
}

/* Individual Item */
.industry-item {
    display: flex;
    align-items: center;
    padding: 8px 14px 8px 42px;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.industry-item:hover {
    background-color: #f3f4f6;
    color: #1a1a2e;
}

.industry-item.selected {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 500;
}

.industry-item .item-code {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-right: 8px;
    min-width: 36px;
}

.industry-item.selected .item-code {
    color: #6366f1;
}

/* No results message */
.industry-no-results {
    padding: 20px 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Search match highlight */
.industry-item.search-match,
.industry-category.has-search-match > .industry-category-header {
    /* Visible during search */
}

.industry-category.search-hidden {
    display: none;
}

.industry-item.search-hidden {
    display: none;
}
