/* ============================================================
   Teachers — t-* namespace, brand-consistent minimalism
   ============================================================ */

/* ── Variables (fall back to global if present) ─────────── */
:root {
    --t-primary:      var(--primary-color, #8a356a);
    --t-primary-dk:   var(--primary-dark,  #6f2a56);
    --t-primary-lt:   var(--primary-light, #a65485);
    --t-primary-bg:   rgba(138, 53, 106, 0.06);
    --t-card-top-1:   #faf5f8;
    --t-card-top-2:   #f3ebf0;
    --t-card-top-3:   #ebe0e8;
    --t-border:       var(--border-light, #e8eaef);
    --t-text:         #1a1a2e;
    --t-muted:        #6b7280;
    --t-bg:           #f8f9fc;
    --t-white:        #ffffff;
    --t-radius:       12px;
    --t-radius-sm:    8px;
    --t-radius-full:  999px;
}

/* ── Hero ────────────────────────────────────────────────── */
.t-hero {
    position: relative;
    background: linear-gradient(135deg, var(--t-primary) 0%, var(--t-primary-dk) 100%);
    padding: 2.5rem 0;
    overflow: hidden;
}

/* subtle dot pattern */
.t-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.t-hero--sm {
    padding: 1.75rem 0;
}

.t-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.t-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .9rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--t-radius-full);
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .03em;
    backdrop-filter: blur(6px);
    margin-bottom: .75rem;
}

.t-hero__title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 .4rem;
    line-height: 1.2;
}

.t-hero__sub {
    font-size: .9375rem;
    color: rgba(255,255,255,.85);
    margin: 0;
}

/* ── Page wrapper ────────────────────────────────────────── */
.t-page {
    background: var(--t-bg);
    padding: 2rem 0 4rem;
}

.t-page--detail {
    padding-top: 1.5rem;
}

/* ── Notice banner ───────────────────────────────────────── */
.t-notice {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    margin-bottom: 1.5rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: var(--t-radius-sm);
    font-size: .875rem;
    color: #92400e;
}

.t-notice i { color: #d97706; flex-shrink: 0; }

/* ── Grid ────────────────────────────────────────────────── */
.t-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ── Card ────────────────────────────────────────────────── */
.t-card {
    background: var(--t-white);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.t-card:hover {
    border-color: rgba(138, 53, 106, 0.28);
    box-shadow: 0 6px 24px rgba(138, 53, 106, 0.08);
}

/* top: soft header band + avatar */
.t-card__top {
    display: block;
    position: relative;
    background: linear-gradient(
        155deg,
        var(--t-card-top-1) 0%,
        var(--t-card-top-2) 55%,
        var(--t-card-top-3) 100%
    );
    height: 40px;
    text-decoration: none;
    flex-shrink: 0;
    overflow: visible;
    z-index: 2;
    border-radius: var(--t-radius) var(--t-radius) 0 0;
}

.t-card__top::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(138, 53, 106, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.t-card__top::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -16px;
    width: 120%;
    height: 32px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center top, rgba(138, 53, 106, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.t-card__avatar {
    position: absolute;
    bottom: -32px;
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--t-white);
    background: var(--t-bg);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(138, 53, 106, 0.12);
}

.t-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-card__avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: .9rem;
    font-weight: 700;
    color: var(--t-primary);
    background: var(--t-primary-bg);
    letter-spacing: .04em;
}

.t-card__rating {
    position: absolute;
    top: .35rem;
    right: .5rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .55rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(138, 53, 106, 0.12);
    border-radius: var(--t-radius-full);
    font-size: .75rem;
    font-weight: 700;
    color: var(--t-text);
    box-shadow: 0 1px 3px rgba(138, 53, 106, 0.08);
    backdrop-filter: blur(4px);
}

.t-card__rating .fa-star { color: #f59e0b; font-size: .65rem; }

/* body */
.t-card__body {
    position: relative;
    z-index: 1;
    padding: 2.5rem 1.25rem .75rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    background: var(--t-white);
    border-radius: 0;
}

.t-card__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--t-text);
    line-height: 1.3;
}

.t-card__name a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.t-card__name a:hover { color: var(--t-primary); }

.t-card__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
}

.t-card__pills span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    background: var(--t-primary-bg);
    color: var(--t-primary-dk);
    border-radius: var(--t-radius-full);
    font-size: .75rem;
    font-weight: 600;
}

.t-card__pills .fa-briefcase,
.t-card__pills .fa-users {
    font-size: .65rem;
    opacity: .8;
}

.t-card__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3rem;
}

.t-card__tags span {
    padding: .15rem .55rem;
    background: #f3f4f6;
    color: var(--t-muted);
    border-radius: var(--t-radius-sm);
    font-size: .72rem;
    font-weight: 500;
}

.t-card__tags-more {
    background: var(--t-primary-bg) !important;
    color: var(--t-primary) !important;
}

/* actions */
.t-card__actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: .5rem;
    padding: .75rem 1rem 1.25rem;
    background: var(--t-white);
    border-radius: 0 0 var(--t-radius) var(--t-radius);
}

.t-card__actions .t-btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    padding: .45rem .4rem;
    font-size: .75rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1rem;
    font-size: .8125rem;
    font-weight: 600;
    border-radius: var(--t-radius-sm);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}

.t-btn--block { width: 100%; }

.t-btn--ghost {
    color: var(--t-primary);
    background: var(--t-white);
    border-color: var(--t-primary-lt);
}
.t-btn--ghost:hover {
    background: var(--t-primary-bg);
    color: var(--t-primary-dk);
}

.t-btn--primary {
    color: #fff;
    background: var(--t-primary);
    border-color: var(--t-primary);
    box-shadow: 0 2px 8px rgba(168,85,163,.25);
}
.t-btn--primary:hover {
    color: #fff;
    background: var(--t-primary-dk);
    border-color: var(--t-primary-dk);
    box-shadow: 0 4px 14px rgba(168,85,163,.35);
}

.t-btn--muted {
    color: #9ca3af;
    background: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Empty state ─────────────────────────────────────────── */
.t-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 4rem 1.5rem;
    text-align: center;
    background: var(--t-white);
    border: 1px dashed var(--t-border);
    border-radius: var(--t-radius);
}

.t-empty > i {
    font-size: 2.25rem;
    color: var(--t-primary-lt);
}

.t-empty p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--t-text);
}

.t-empty small {
    color: var(--t-muted);
    font-size: .875rem;
    margin-bottom: .75rem;
}

/* ── Back link ───────────────────────────────────────────── */
.t-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: 1.25rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--t-primary);
    text-decoration: none;
    opacity: .85;
    transition: opacity .15s;
}
.t-back:hover { opacity: 1; color: var(--t-primary-dk); }

/* ── Detail layout ───────────────────────────────────────── */
.t-detail {
    display: grid;
    grid-template-columns: 256px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Profile card (aside) */
.t-profile-card {
    background: var(--t-white);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    padding: 1.75rem 1.25rem 1.25rem;
    text-align: center;
    position: sticky;
    top: 1.25rem;
}

.t-profile-card__photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid var(--t-primary-lt);
    background: var(--t-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.t-profile-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-profile-card__photo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--t-primary);
    letter-spacing: .04em;
}

.t-profile-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--t-text);
    margin: 0 0 .35rem;
    line-height: 1.3;
}

.t-profile-card__rating {
    margin: 0 0 .75rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--t-text);
}

.t-profile-card__rating .fa-star { color: #f59e0b; margin-right: .2rem; }

.t-profile-card__rating span {
    font-weight: 400;
    color: var(--t-muted);
    font-size: .8rem;
}

.t-profile-card__stats {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: .75rem 0;
    border-top: 1px solid var(--t-border);
    border-bottom: 1px solid var(--t-border);
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.t-profile-card__stats > div {
    text-align: center;
}

.t-profile-card__stats dt {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--t-primary);
    margin: 0;
}

.t-profile-card__stats dd {
    font-size: .75rem;
    color: var(--t-muted);
    margin: .1rem 0 0;
}

.t-profile-card__cta { margin-top: .25rem; }

/* Detail main */
.t-detail__main {
    background: var(--t-white);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    padding: 1.5rem 1.75rem;
}

.t-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--t-border);
}

.t-detail__tags span {
    padding: .3rem .75rem;
    background: var(--t-primary-bg);
    color: var(--t-primary-dk);
    border-radius: var(--t-radius-full);
    font-size: .8125rem;
    font-weight: 600;
}

.t-detail__section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.t-detail__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.t-detail__section h2 {
    margin: 0 0 .5rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--t-primary);
}

.t-detail__section p {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.75;
    color: #374151;
}

.t-detail__section--video .t-intro-video {
    border-radius: var(--t-radius);
    overflow: hidden;
    background: #0f0f0f;
    box-shadow: 0 4px 24px rgba(26, 26, 46, 0.08);
}

.t-intro-video__player {
    display: block;
    width: 100%;
    max-height: 420px;
    vertical-align: middle;
}

.t-intro-video__embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.t-intro-video__embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Reviews */
.t-detail__section--reviews h2 span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    background: var(--t-primary-bg);
    color: var(--t-primary);
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: .35rem;
}

.t-reviews {
    list-style: none;
    margin: 0;
    padding: 0;
}

.t-review {
    padding: .875rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.t-review:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.t-review__head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .4rem;
    font-size: .875rem;
}

.t-review__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--t-primary-bg);
    color: var(--t-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
}

.t-review__head strong { color: var(--t-text); font-size: .8125rem; }

.t-review__head time {
    font-size: .75rem;
    color: #9ca3af;
}

.t-review__stars { font-size: .7rem; color: #f59e0b; }
.t-review__stars .fa-star.far { color: #d1d5db; }

.t-review__comment,
.t-review p {
    margin: 0;
    font-size: .875rem;
    line-height: 1.6;
    color: var(--t-muted);
    padding-left: 2.1rem;
}

.t-review__comment--empty {
    color: #9ca3af;
    font-style: italic;
}

.t-review__admin-actions {
    display: flex;
    gap: .35rem;
    flex-shrink: 0;
}

.t-review__admin-btn {
    border: 1px solid var(--t-border);
    background: #fff;
    color: var(--t-muted);
    width: 28px;
    height: 28px;
    border-radius: var(--t-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.t-review__admin-btn:hover {
    color: var(--t-primary);
    border-color: var(--t-primary);
    background: var(--t-primary-bg);
}

.t-review__admin-btn--danger:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.t-admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.t-admin-modal[hidden] {
    display: none !important;
}

.t-admin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
}

.t-admin-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    background: #fff;
    border-radius: var(--t-radius);
    border: 1px solid var(--t-border);
    box-shadow: 0 20px 40px rgba(15, 23, 42, .15);
    padding: 1rem 1.1rem 1.1rem;
}

.t-admin-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.t-admin-modal__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--t-text);
}

.t-admin-modal__close {
    border: none;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 .15rem;
}

.t-admin-modal__close:hover {
    color: var(--t-text);
}

body.t-admin-modal-open {
    overflow: hidden;
}

/* Review form */
.t-review-form-wrap {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--t-bg);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
}

.t-review-form__title {
    margin: 0 0 .75rem;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--t-text);
}

.t-review-form__stars {
    display: flex;
    gap: .25rem;
    margin-bottom: .75rem;
}

.t-star-btn {
    border: none;
    background: transparent;
    padding: .15rem;
    cursor: pointer;
    color: #d1d5db;
    font-size: 1.35rem;
    line-height: 1;
    transition: color .15s ease, transform .1s ease;
}

.t-star-btn:hover,
.t-star-btn.is-active {
    color: #f59e0b;
}

.t-star-btn:hover {
    transform: scale(1.08);
}

.t-review-form__label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--t-text);
    margin-bottom: .35rem;
}

.t-review-form__textarea {
    width: 100%;
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-sm);
    padding: .6rem .75rem;
    font-size: .875rem;
    resize: vertical;
    min-height: 5rem;
    margin-bottom: .75rem;
}

.t-review-form__textarea:focus {
    outline: none;
    border-color: var(--t-primary);
    box-shadow: 0 0 0 3px var(--t-primary-bg);
}

.t-review-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.t-review-form .t-btn {
    margin-top: 0;
}

.t-btn--danger-outline {
    background: transparent;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.t-btn--danger-outline:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.t-btn--danger-outline:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.t-review-form__hint {
    margin: .5rem 0 0;
    font-size: .8125rem;
}

.t-review-form__hint.is-error { color: #dc2626; }
.t-review-form__hint.is-success { color: #059669; }

.t-review-login-hint,
.t-reviews-empty {
    font-size: .875rem;
    color: var(--t-muted);
    margin: 0 0 1rem;
}

.t-review-login-hint a {
    color: var(--t-primary);
    font-weight: 600;
    text-decoration: none;
}

.t-review-login-hint a:hover {
    text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
    .t-detail {
        grid-template-columns: 1fr;
    }

    .t-profile-card {
        position: static;
        max-width: 320px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .t-grid {
        grid-template-columns: 1fr 1fr;
    }

    .t-card__avatar {
        width: 52px;
        height: 52px;
        bottom: -26px;
    }

    .t-card__body {
        padding-top: 2rem;
    }

    .t-card__actions {
        flex-direction: column;
    }

    .t-card__actions .t-btn {
        font-size: .8125rem;
        padding: .5rem .75rem;
    }
}

@media (max-width: 400px) {
    .t-grid { grid-template-columns: 1fr; }
}
