/* Company Directory - Card Layout */

.directory-search-bar {
    background: var(--bs-body-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(var(--bs-body-color-rgb),0.08);
    padding: 12px 16px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.directory-search-bar .search-input-wrap {
    flex: 1;
    position: relative;
}

.directory-search-bar .search-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-tertiary-color);
    font-size: 14px;
}

.directory-search-bar .search-input-wrap input {
    width: 100%;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 10px 12px 10px 36px;
    font-size: 14px;
    color: var(--bs-body-color);
    background-color: var(--bs-tertiary-bg);
    outline: none;
    transition: border-color 0.2s;
}

.directory-search-bar .search-input-wrap input::placeholder {
    color: var(--bs-tertiary-color);
}

.directory-search-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}


/* Location sections */
.directory-location-section {
    margin-bottom: 32px;
}

.directory-location-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.directory-location-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.directory-location-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

.directory-location-flag {
    font-size: 18px;
    line-height: 1;
}

/* Card grid */
.directory-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Staff card */
.directory-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 14px;
    transition: box-shadow 0.2s;
}

.directory-card:hover {
    box-shadow: 0 2px 8px rgba(var(--bs-body-color-rgb),0.08);
}

.directory-card-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    background-color: #546E7A;
}

/* Avatar color classes */
.avatar-color-0 { background-color: #B71C1C; }
.avatar-color-1 { background-color: #E65100; }
.avatar-color-2 { background-color: #1B5E20; }
.avatar-color-3 { background-color: #0D47A1; }
.avatar-color-4 { background-color: #006064; }
.avatar-color-5 { background-color: #4E342E; }
.avatar-color-6 { background-color: #546E7A; }
.avatar-color-7 { background-color: #4A148C; }
.avatar-color-8 { background-color: #880E4F; }
.avatar-color-9 { background-color: #004D40; }

.directory-card-info {
    min-width: 0;
    flex: 1;
}

.directory-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-emphasis-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.directory-card-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--bs-secondary-color);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.directory-card-detail i {
    width: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--bs-tertiary-color);
    flex-shrink: 0;
}

.directory-card-detail span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* List view */
.directory-card-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

.directory-card-grid.list-view .directory-card {
    padding: 12px 20px;
    border-radius: 8px;
    align-items: center;
}

.directory-card-grid.list-view .directory-card-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 12px;
}

.directory-card-grid.list-view .directory-card-info {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.directory-card-grid.list-view .directory-card-name,
.directory-card-grid.list-view .directory-card-detail {
    flex: 1;
    margin-bottom: 0;
}

/* No results */
.directory-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--bs-tertiary-color);
    font-size: 15px;
}

.directory-no-results.hidden {
    display: none;
}

/* Location dot colors */
.location-dot-APAC { background-color: #8cbf53; }
.location-dot-EMEA { background-color: #006690; }
.location-dot-AMER { background-color: #95519e; }
.location-dot-PHP  { background-color: #fcd116; }
.location-dot-CAN  { background-color: #ea7125; }
.location-dot-CHINA { background-color: #ea7125; }
.location-dot-INDIA { background-color: #F78CAB; }

/* Override contentwrap for directory page */
.companydirectory-cards {
    max-width: 100%;
    padding: 24px 0;
}

/* Responsive */
@media (max-width: 991px) {
    .directory-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .directory-card-grid.list-view .directory-card-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .directory-card-grid.list-view .directory-card-name {
        min-width: auto;
    }
}

@media (max-width: 575px) {
    .directory-card-grid {
        grid-template-columns: 1fr;
    }

    .directory-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .directory-search-controls {
        justify-content: flex-end;
    }
}

/* Print styles */
@media print {
    .directory-search-bar {
        display: none;
    }

    .directory-card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .directory-card {
        box-shadow: none;
        border: 1px solid #ddd;
        padding: 12px;
        page-break-inside: avoid;
    }

    .directory-location-section {
        page-break-inside: avoid;
    }
}

/*============== Directory table (legacy print layout) ==============*/
.directory.table{
	color: #222;
	text-align: left;
	table-layout: fixed;
	width: 100%;
	border-right: 2px solid #000;
}
.directory.table td{
	border-left: 2px solid #000;
	padding: 5px 2px;
	font-size: 12px;
	width: 28%;
	border-bottom: 2px solid #000;
}
.directory.table tr:nth-child(1) td{
	border-top: 2px solid #000;
	font-weight: bold;
	font-size: 15px;
}
.directory.table tr:nth-child(1) td:nth-child(6){
	border-top: none;
}
.directory.table td:nth-child(1), .directory.table th:nth-child(1){
	width: 32%;
}
.directory.table td:nth-child(2), .directory.table th:nth-child(2){
	width: 15%;
	text-align: center;
}
.directory.table td:nth-child(6), .directory.table th:nth-child(6){
	width: 2%;
	border-top: none;
	border-bottom: none;
}
.directory.table td:nth-child(7), .directory.table th:nth-child(7){
	width: 30%;
	border-top: 2px solid #000;
}
#company_info_table td{
	border: 0;
	font-size: 12px;
}
#company_info_table td.company_title{
	font-size: 15px;
	padding-top: 0px;
}
#company_info_table td.item_info{
	padding: 5px;
	font-weight: normal;
}
#company_info_table td.item_title{
	padding-top: 5px;
}

@media print {
    .columnHead {
		font-size: 15px;
		font-weight: bold;
    }
    #contentcontainer table td{
		padding: 0.9px;
    }
	#company_info_table td.item_title{
	    padding-top: 1.5px;
	}
	#company_info_table td.item_info{
		padding: 1.5px;
		font-weight: normal;
	}
	.breakPage{
		page-break-before: always;
	}
	.directory.table td:nth-child(7), .directory.table th:nth-child(7){
		width: 20%;
	}
	.directory.table td:nth-child(1), .directory.table th:nth-child(1){
		width: 25%;
	}
	.directory.table td:nth-child(3), .directory.table th:nth-child(3),
	.directory.table td:nth-child(4), .directory.table th:nth-child(4){
		width: 20%;
	}
}

@media (max-width: 767.98px) {
	table.directory.table {
		min-width: 1130px;
	}
}
