/* EducationGuard — Watch History page */

.eg-wh-page {
    min-height: 100vh;
}

.eg-wh-page .eg-courses-main {
    padding-bottom: 4rem;
}

.eg-wh-hero-badge {
    background: linear-gradient(135deg, rgba(243, 147, 24, 0.2), rgba(70, 30, 56, 0.12));
}

.eg-wh-stats {
    margin-top: 1.25rem;
}

/* Filter chips */
.eg-wh-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.25rem 0 1.5rem;
}

.eg-wh-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 2rem;
    border: 1.5px solid rgba(70, 30, 56, 0.14);
    background: rgba(255, 255, 255, 0.72);
    color: var(--eg-secondary, #461E38);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-bs-theme="dark"] .eg-wh-chip {
    background: rgba(30, 22, 28, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3ebe8;
}

.eg-wh-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(243, 147, 24, 0.45);
}

.eg-wh-chip.is-active {
    background: linear-gradient(135deg, var(--eg-secondary, #461E38), #6b2f55);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(70, 30, 56, 0.28);
}

.eg-wh-chip__count {
    display: inline-grid;
    place-items: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(243, 147, 24, 0.18);
    color: var(--eg-primary-dark, #c46a0a);
    font-size: 0.72rem;
    font-weight: 800;
}

.eg-wh-chip.is-active .eg-wh-chip__count {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Timeline */
.eg-wh-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    transition: opacity 0.2s ease;
}

.eg-wh-timeline.is-paging {
    opacity: 0.55;
    pointer-events: none;
}

.eg-wh-group__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.eg-wh-group__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F39318, #461E38);
    box-shadow: 0 0 0 4px rgba(243, 147, 24, 0.18);
    flex-shrink: 0;
}

.eg-wh-group__head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--eg-secondary, #461E38);
    white-space: nowrap;
}

html[data-bs-theme="dark"] .eg-wh-group__head h2 {
    color: #f6f0f3;
}

.eg-wh-group__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(70, 30, 56, 0.22), transparent);
}

html[data-bs-theme="dark"] .eg-wh-group__line {
    background: linear-gradient(90deg, rgba(243, 147, 24, 0.28), transparent);
}

.eg-wh-group__list {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    position: relative;
    padding-inline-start: 0.35rem;
}

/* History cards */
.eg-wh-card {
    --eg-wh-accent: #F39318;
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(112px, 150px) 1fr;
    gap: 1rem;
    align-items: start;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: start;
    animation: eg-wh-rise 0.45s ease both;
}

.eg-wh-card.is-completed {
    --eg-wh-accent: #1f9d57;
}

@keyframes eg-wh-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.eg-wh-card__rail {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 1.35rem;
}

.eg-wh-card__rail::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -0.95rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(70, 30, 56, 0.18), rgba(70, 30, 56, 0.05));
}

html[data-bs-theme="dark"] .eg-wh-card__rail::before {
    background: linear-gradient(180deg, rgba(243, 147, 24, 0.25), rgba(243, 147, 24, 0.05));
}

.eg-wh-card:last-child .eg-wh-card__rail::before {
    bottom: 30%;
}

.eg-wh-card__node {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--eg-secondary, #461E38), #6b2f55);
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 8px 18px rgba(70, 30, 56, 0.25);
}

.eg-wh-card.is-completed .eg-wh-card__node {
    background: linear-gradient(145deg, #147a3d, #1f9d57);
}

html[data-bs-theme="dark"] .eg-wh-card__node {
    box-shadow: 0 0 0 4px rgba(28, 20, 26, 0.9), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.eg-wh-card__media,
.eg-wh-card__body {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 244, 0.94));
    border: 1px solid rgba(70, 30, 56, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

html[data-bs-theme="dark"] .eg-wh-card__media,
html[data-bs-theme="dark"] .eg-wh-card__body {
    background: linear-gradient(165deg, rgba(40, 28, 36, 0.96), rgba(28, 20, 26, 0.94));
    border-color: rgba(243, 147, 24, 0.16);
}

.eg-wh-card:hover .eg-wh-card__media,
.eg-wh-card:hover .eg-wh-card__body {
    border-color: rgba(243, 147, 24, 0.4);
    box-shadow: 0 16px 36px rgba(70, 30, 56, 0.12);
}

.eg-wh-card:hover .eg-wh-card__media {
    transform: translateY(-2px);
}

.eg-wh-card:hover .eg-wh-card__body {
    transform: translateY(-2px);
}

.eg-wh-card__media {
    position: relative;
    z-index: 0;
    overflow: hidden;
    isolation: isolate;
    border-radius: 1.15rem;
    width: 100%;
    height: 96px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.eg-wh-card__media img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.eg-wh-card:hover .eg-wh-card__media img {
    transform: scale(1.06);
}

.eg-wh-card__media-progress {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 3;
    height: 5px;
    background: rgba(0, 0, 0, 0.35);
}

.eg-wh-card__media-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--eg-wh-accent), #fb923c);
}

.eg-wh-card.is-completed .eg-wh-card__media-progress > span {
    background: linear-gradient(90deg, #147a3d, #4be08a);
}

.eg-wh-card__pct {
    position: absolute;
    inset-inline-end: 0.55rem;
    bottom: 0.75rem;
    z-index: 4;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(20, 12, 18, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.eg-wh-card__play {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: rgba(70, 30, 56, 0.28);
    color: #fff;
    font-size: 1.6rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.eg-wh-card:hover .eg-wh-card__play {
    opacity: 1;
}

.eg-wh-card__body {
    position: relative;
    z-index: 1;
    border-radius: 1.25rem;
    padding: 1rem 1.15rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.eg-wh-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.eg-wh-card__course {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8a7e86;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eg-wh-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

.eg-wh-status--done {
    background: rgba(20, 122, 61, 0.12);
    color: #147a3d;
}

.eg-wh-status--active {
    background: rgba(243, 147, 24, 0.16);
    color: #b86a08;
}

.eg-wh-card__title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--eg-secondary, #461E38);
}

html[data-bs-theme="dark"] .eg-wh-card__title {
    color: #f6f0f3;
}

.eg-wh-card__bar {
    height: 7px;
    border-radius: 999px;
    background: rgba(70, 30, 56, 0.1);
    overflow: hidden;
}

html[data-bs-theme="dark"] .eg-wh-card__bar {
    background: rgba(255, 255, 255, 0.1);
}

.eg-wh-card__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--eg-wh-accent), #fb923c);
    transition: width 0.4s ease;
}

.eg-wh-card.is-completed .eg-wh-card__bar > span {
    background: linear-gradient(90deg, #147a3d, #4be08a);
}

.eg-wh-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.95rem;
    font-size: 0.78rem;
    color: #8a7e86;
}

.eg-wh-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.eg-wh-card__meta i {
    color: var(--eg-wh-accent);
    opacity: 0.9;
}

.eg-wh-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

/* Buttons */
.eg-wh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    border-radius: 2rem;
    border: 1.5px solid transparent;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.eg-wh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.eg-wh-btn--primary {
    background: linear-gradient(135deg, var(--eg-primary, #F39318), var(--eg-primary-dark, #c46a0a));
    color: #fff;
    box-shadow: 0 8px 20px rgba(243, 147, 24, 0.32);
}

.eg-wh-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(243, 147, 24, 0.42);
}

.eg-wh-btn--ghost {
    background: transparent;
    border-color: rgba(70, 30, 56, 0.16);
    color: var(--eg-secondary, #461E38);
}

html[data-bs-theme="dark"] .eg-wh-btn--ghost {
    border-color: rgba(255, 255, 255, 0.14);
    color: #f3ebe8;
}

.eg-wh-btn--ghost:hover:not(:disabled) {
    border-color: rgba(243, 147, 24, 0.45);
    background: rgba(243, 147, 24, 0.08);
}

.eg-wh-btn--danger {
    background: #b42318;
    color: #fff;
}

.eg-wh-btn--icon {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 50%;
}

.eg-wh-confirm {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.55rem;
    border-radius: 1rem;
    background: rgba(180, 35, 24, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    color: #b42318;
}

/* Empty / error */
.eg-wh-empty {
    text-align: center;
    padding: 3rem 1.25rem 4rem;
    max-width: 460px;
    margin: 0.5rem auto 0;
}

.eg-wh-empty__art {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(243, 147, 24, 0.18), rgba(70, 30, 56, 0.12));
    color: var(--eg-primary, #F39318);
    font-size: 2.4rem;
}

.eg-wh-empty__pulse {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(243, 147, 24, 0.35);
    animation: eg-wh-pulse 2s ease infinite;
}

@keyframes eg-wh-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 0.2; }
}

.eg-wh-empty__title {
    margin: 0 0 0.5rem;
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--eg-secondary, #461E38);
}

html[data-bs-theme="dark"] .eg-wh-empty__title {
    color: #f6f0f3;
}

.eg-wh-empty__text {
    margin: 0 0 1.4rem;
    color: #8a7e86;
    line-height: 1.6;
}

.eg-wh-filter-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #8a7e86;
    font-weight: 700;
}

.eg-wh-filter-empty i {
    font-size: 1.8rem;
    color: var(--eg-primary, #F39318);
    display: block;
    margin-bottom: 0.6rem;
}

/* Pager */
.eg-wh-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 2rem 0 0.5rem;
}

.eg-wh-pager__label {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--eg-secondary, #461E38);
    min-width: 7rem;
    text-align: center;
}

html[data-bs-theme="dark"] .eg-wh-pager__label {
    color: #f3ebe8;
}

@media (max-width: 760px) {
    .eg-wh-card {
        grid-template-columns: 22px 1fr;
        gap: 0.75rem;
    }

    .eg-wh-card__media {
        grid-column: 2;
        height: 140px;
        max-height: 140px;
    }

    .eg-wh-card__body {
        grid-column: 2;
    }

    .eg-wh-card__rail {
        grid-row: 1 / span 2;
        padding-top: 1.1rem;
    }
}

@media (max-width: 520px) {
    .eg-wh-card__top {
        flex-direction: column;
        align-items: flex-start;
    }

    .eg-wh-toolbar {
        gap: 0.5rem;
    }

    .eg-wh-chip {
        padding: 0.45rem 0.8rem;
        font-size: 0.8rem;
    }
}
