/* ===== HH3D History / Follow pages ===== */
.hh3d-history-body #main,
.hh-library-page #main {
    background: #0b0b0c;
    color: #e8e8e8;
}

/* Căn #content — bỏ pad ngang Flatsome .col */
body.hh-library-page #main > #content.content-area,
body.hh3d-history-body #main > #content.content-area {
    width: 100%;
    max-width: var(--hh-site-width, 1140px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

body.hh-library-page #main .col,
body.hh-library-page #main .columns,
body.hh-library-page #main .gallery-item,
body.hh3d-history-body #main .col,
body.hh3d-history-body #main .columns,
body.hh3d-history-body #main .gallery-item {
    margin: 0 !important;
    padding: 0 0 30px !important;
    position: relative;
    width: 100%;
}

/* Ẩn breadcrumb trên trang lịch sử / theo dõi */
body.hh-library-page .rank-math-breadcrumb,
body.hh3d-history-body .rank-math-breadcrumb,
body.hh-library-page .container:has(> .rank-math-breadcrumb) {
    display: none !important;
}

.hh3d-history-page-wrap {
    --hh3d-hist-bg: #0b0b0c;
    --hh3d-hist-text: #e8e8e8;
    --hh3d-hist-line: rgba(255, 255, 255, 0.12);
    --hh3d-hist-pad: 16px;
    background: var(--hh3d-hist-bg);
    min-height: 60vh;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 0 24px;
    padding-inline: 24px;
    box-sizing: border-box;
}

.hh3d-history-page a,
.hh3d-history-page-wrap,
.hh3d-history-page-wrap a {
    color: inherit;
    text-decoration: none !important;
}

.hh3d-history-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    color: var(--hh3d-hist-text);
}

.hh3d-history-alert {
    background: rgba(240, 40, 73, .1);
    border: 1px solid rgba(240, 40, 73, .25);
    border-radius: 10px;
    color: #f9a8b0;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.hh3d-history-alert a,
.hh3d-history-alert b {
    color: #6ec8ff;
}

.hh3d-history-toolbar {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(22, 22, 24, 0.92);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.hh3d-history-toolbar--ambient {
    background:
        linear-gradient(180deg, rgba(18, 18, 20, 0.78), rgba(12, 12, 14, 0.92)),
        rgba(22, 22, 24, 0.9);
}

.hh3d-history-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hh3d-history-ambient__blur {
    position: absolute;
    inset: -20%;
    width: 140%;
    height: 140%;
    object-fit: cover;
    filter: blur(42px) saturate(1.15);
    opacity: 0.28;
    transform: scale(1.05);
}

.hh3d-history-ambient__grain {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.08), transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
    opacity: 0.9;
}

.hh3d-history-toolbar__inner {
    padding: 16px;
    position: relative;
    z-index: 2;
}

.hh3d-history-toolbar--ambient .hh3d-history-toolbar__inner {
    backdrop-filter: blur(10px);
    background: linear-gradient(115deg, rgba(24, 25, 26, .94), rgba(24, 25, 26, .82) 42%, rgba(24, 25, 26, .55));
}

@media (min-width: 768px) {
    .hh3d-history-toolbar__inner {
        padding: 18px 20px;
    }
}

.hh3d-history-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hh3d-history-page__title {
    color: var(--hh3d-hist-text);
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.hh3d-history-page__clear {
    appearance: none;
    -webkit-appearance: none;
    align-items: center;
    background: hsla(0, 0%, 100%, .06);
    border: 1px solid var(--hh3d-hist-line);
    border-radius: 8px;
    color: var(--hh3d-hist-text) !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    line-height: 1.2;
    margin: 0;
    padding: 8px 14px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.hh3d-history-page__clear:hover {
    background: hsla(0, 0%, 100%, .1);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fff !important;
}

.hh3d-history-search {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
}

.hh3d-history-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #9a9aa3;
    pointer-events: none;
}

.hh3d-history-search__icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.hh3d-history-page-wrap .hh3d-history-search__input,
.hh3d-history-search__input {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 14px 0 42px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 11px !important;
    background: rgba(0, 0, 0, 0.42) !important;
    color: #f2f2f2 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 44px !important;
    outline: none !important;
}

.hh3d-history-search__input::placeholder {
    color: #8a8a93 !important;
    opacity: 1 !important;
}

.hh3d-history-search__input:focus {
    border-color: rgba(59, 130, 246, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    background: rgba(0, 0, 0, 0.55) !important;
}

.hh3d-history-ip {
    margin: 0;
    color: #ff9f4a;
    font-size: 13px;
}

.hh3d-history-mount {
    min-height: 120px;
}

.hh3d-history-empty {
    margin: 0;
    padding: 42px 16px;
    text-align: center;
    color: #8d8d95;
    background: #141416;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.hh3d-history-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hh3d-history-group__title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8e8e96;
}

.hh3d-history-group__rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hh3d-history-row {
    position: relative;
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 12px 44px 12px 12px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #18181b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
}

.hh3d-history-row__ambient {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.hh3d-history-row__ambient-blur {
    position: absolute;
    inset: -40%;
    width: 180%;
    height: 180%;
    object-fit: cover;
    filter: blur(40px) saturate(1.25);
    opacity: 0.28;
    transform: scale(1.08);
}

.hh3d-history-row__ambient-grain {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(12, 12, 14, 0.15) 0%, rgba(12, 12, 14, 0.55) 38%, rgba(12, 12, 14, 0.82) 100%);
}

.hh3d-history-row__thumb {
    position: relative;
    z-index: 1;
    display: block !important;
    flex: 0 0 84px;
    width: 84px;
    height: 118px;
    border-radius: 10px;
    overflow: visible;
    background: #222;
    text-decoration: none !important;
}

.hh3d-history-row__thumb img,
.hh3d-history-row__thumb-ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    overflow: hidden;
}

.hh3d-history-row__ep {
    position: absolute;
    left: 5px;
    right: auto;
    bottom: 5px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: max-content;
    max-width: none;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.hh3d-history-row__body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.hh3d-history-row__title {
    margin: 0;
    padding-right: 4px;
    color: #fff !important;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hh3d-history-row__title:hover {
    color: #93c5fd !important;
}

.hh3d-history-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    color: #b4b4bc !important;
    font-size: 12.5px;
    line-height: 1.3;
}

.hh3d-history-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
}

.hh3d-history-row__meta svg {
    flex: 0 0 auto;
    opacity: 0.9;
}

.hh3d-history-row__progress {
    width: 100%;
    max-width: 420px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.hh3d-history-row__progress-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.hh3d-history-row__resume {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 2px 0 0;
    padding: 8px 14px;
    border-radius: 9px;
    background: #2563eb !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.hh3d-history-row__resume:hover {
    background: #1d4ed8 !important;
    color: #fff !important;
}

.hh3d-history-row__resume svg {
    flex: 0 0 auto;
}

.hh3d-history-row__delete {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #ddd;
    cursor: pointer;
    line-height: 1;
}

.hh3d-history-row__delete:hover {
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
}

.hh3d-history-foot {
    margin: 8px 0 0;
    text-align: center;
}

.hh3d-history-foot a {
    color: #ff9f4a;
    font-weight: 650;
    text-decoration: none;
}

.hh3d-history-foot a:hover {
    text-decoration: underline;
}

.hh3d-history-row__thumb-ph {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2a2a2e, #1a1a1d);
}

/* ===== Theo dõi — card dọc 5 cột ===== */
.hh3d-follow-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hh3d-follow-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .hh3d-follow-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .hh3d-follow-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }
}

.hh3d-follow-card {
    position: relative;
    width: 100%;
    margin: 0;
}

.hh3d-follow-card__link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #14161a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    text-decoration: none !important;
    color: inherit;
}

.hh3d-follow-card__img,
.hh3d-follow-card__ph {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.hh3d-follow-card__ph {
    background: linear-gradient(145deg, #2a2a2e, #1a1a1d);
}

@media (hover: hover) and (pointer: fine) {
    .hh3d-follow-card__link:hover .hh3d-follow-card__img {
        transform: scale(1.03);
    }
}

.hh3d-follow-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding: 36px 8px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
}

.hh3d-follow-card__title {
    display: block;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hh3d-follow-card__origin {
    display: block;
    margin: 0;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hh3d-follow-card__delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 26px !important;
    height: 26px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, 0.72) !important;
    color: #fff !important;
    box-shadow: none !important;
    line-height: 0 !important;
    cursor: pointer;
    appearance: none;
}

.hh3d-follow-card__delete svg {
    display: block;
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px;
    pointer-events: none;
}

.hh3d-follow-card__delete:hover {
    background: #dc2626 !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    .hh3d-history-page-wrap {
        padding: 12px 0 40px;
        padding-inline: 24px;
    }

    .hh3d-history-page__clear {
        background: #dc2626 !important;
        border-color: #dc2626 !important;
        color: #fff !important;
    }

    .hh3d-history-page__clear:hover,
    .hh3d-history-page__clear:active {
        background: #b91c1c !important;
        border-color: #b91c1c !important;
        color: #fff !important;
    }

    .hh3d-history-row {
        gap: 10px;
        padding: 10px 38px 10px 10px;
    }

    .hh3d-history-row__thumb {
        flex-basis: 72px;
        width: 72px;
        height: 102px;
    }

    .hh3d-history-row__ep {
        font-size: 10px;
        padding: 3px 5px;
    }

    .hh3d-history-row__resume {
        width: 100%;
    }
}
