/* Container cho tooltip */

.hot_jobs__item {
    position: relative;
    z-index: 1;
}

.hot_jobs__item:hover {
    z-index: 1000;
}


/* Wrapper tooltip */

.tooltip-wrapper {
    position: absolute;
    width: 450px;
    max-width: 90vw;
    max-height: 80vh;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* Ẩn thanh cuộn trên Chrome/Safari */

.tooltip-wrapper::-webkit-scrollbar {
    display: none;
}


/* Hiển thị khi hover */

.hot_jobs__item:hover .tooltip-wrapper {
    opacity: 0;
    visibility: hidden;
}


/* Mũi tên tooltip */

.tooltip-arrow,
.tooltip-arrow::before {
    position: absolute;
    width: 16px;
    height: 16px;
    background: inherit;
}

.tooltip-arrow {
    visibility: hidden;
}

.tooltip-arrow::before {
    visibility: visible;
    content: "";
    background: red;
    border: 1px solid #e0e0e0;
    transform: rotate(45deg);
}


/* Vị trí mũi tên theo placement */

[data-popper-placement^="right"] .tooltip-arrow {
    left: -8px;
}

[data-popper-placement^="left"] .tooltip-arrow {
    right: -8px;
}


/* Header styles */

.tooltip-header {
    padding: 16px 16px 0;
    background: #fff;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    padding: 16px;
}

.tooltip-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}


/* Company Logo */

.company-logo img {
    width: 50px;
	height:50px;
    object-fit: cover;
	
}

.company-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.job-title-block {
    flex: 1;
}


/* Title & Info */

.tooltip-title-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px;
}

.company-name {
    display: block;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.tooltip-wrapper .salary {
    color: #ff5722;
    font-size: 14px;
}


/* Info Items */

.tooltip-info {
    display: flex;
    gap: 16px;
    max-width: 100%;
}

.tooltip-info_item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.tooltip-title-text {
    line-height: 1.3;
    margin-top: 0.1em;
    margin-bottom: 0.1em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: red;
}

.tooltip-info_item.location {
    max-width: 60%;
    flex-shrink: 1;
}

.tooltip-info_item.location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.deadline.tooltip-info_item {
    color: rgba(253, 30, 86, 1);
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
}

.tooltip-info_item.expired {
    color: #dc3545;
    font-weight: 500;
}

.tooltip-info_item.expired i {
    color: #dc3545;
}


/* Content */

.tooltip-scroll {
    flex: 1;
    min-height: 0;
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 16px;
    margin: 0;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}


/* Tùy chỉnh thanh cuộn cho Chrome/Safari */

.tooltip-scroll::-webkit-scrollbar {
    width: 6px;
}

.tooltip-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tooltip-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.tooltip-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.tooltip-job-info_title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 12px 0 8px;
    color: var(--primary-color);
}

.tooltip-content-tab {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}


/* Footer */

.tooltip-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}

.tooltip-btn {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tooltip-footer .tooltip-apply-now {
    color: rgb(255, 248, 59);
    background-color: rgb(43, 50, 152);
}

.tooltip-footer .tooltip-view-detail {
    color: rgb(43, 50, 152);
    background-color: rgb(255, 248, 59);
}

.tooltip-footer .tooltip-apply-now:hover {
    color: rgb(43, 50, 152);
    background-color: rgb(255, 248, 59);
}

.tooltip-footer .tooltip-view-detail:hover {
    color: rgb(255, 248, 59);
    background-color: rgb(43, 50, 152);
}

.tooltip-footer:has(.expired) .tooltip-view-detail {
    flex: 1;
}


/* Responsive */

@media screen and (min-width: 768px) {
    .hot_jobs__item:nth-child(3n) .tooltip-wrapper {
        right: 0;
        left: auto;
    }
    .hot_jobs__item:nth-child(3n-2) .tooltip-wrapper {
        left: 0;
        right: auto;
    }
}


/* Responsive cho tooltip-scroll */

@media screen and (max-height: 768px) {
    .tooltip-scroll {
        height: 250px;
    }
}

@media screen and (max-height: 576px) {
    .tooltip-scroll {
        height: 200px;
    }
}


/* Thêm styles cho trạng thái */

.text-primary {
    color: #2196f3;
}

.text-success {
    color: #4caf50;
}

.text-danger {
    color: #dc3545;
}

.tooltip-info_item.expired {
    color: #dc3545;
    font-weight: 500;
}

.tooltip-info_item.expired i {
    color: #dc3545;
}


/* Khi hết hạn, nút view detail sẽ full width */

.tooltip-footer:has(.expired) .tooltip-view-detail {
    flex: 1;
}