/* Teacher profile (/users/{id}/profile) in the Teachers page design. Loaded after teacher-categories.css,
   which gives the shell (.tc-page, .tc-panel, tabs, badges, cards) and the admin colours (--tc-*). */
.tp-page { padding-bottom: 64px; }

/* Hero */
.tp-hero { padding-bottom: 30px; }
[dir="rtl"] .tp-page .tc-back svg { transform: scaleX(-1); }
.tp-hero__grid {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
    margin-top: 24px;
}
.tp-hero__photo {
    position: relative;
    flex: none;
    animation: tc-rise .6s cubic-bezier(.2, .7, .2, 1) backwards;
}
.tp-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(150px, 18vw, 220px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 6px solid #fff;
    border-radius: 32px;
    background:
        radial-gradient(80% 70% at 30% 20%, rgba(255, 255, 255, .35), transparent 60%),
        linear-gradient(140deg, color-mix(in srgb, var(--tc-accent) 55%, #fff), color-mix(in srgb, var(--tc-badge-private) 45%, var(--tc-accent)));
    box-shadow: 0 26px 44px -22px color-mix(in srgb, var(--tc-accent) 60%, transparent);
}
.tp-photo .tc-initials { font-size: clamp(2.6rem, 5vw, 3.8rem); }
.tp-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: linear-gradient(180deg, #f7f9ff, #eaf0fb);
}
.tp-hero__badge { top: -10px; right: auto; inset-inline-end: -12px; font-size: .82rem; padding: 5px 13px; }
.tp-status {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
}
.tp-status svg { width: 15px; height: 15px; }
.tp-status--verified { background: #22b07d; }
.tp-status--offline { background: #e5484d; }

.tp-hero__info { flex: 1 1 auto; min-width: 0; }
.tp-name { font-size: clamp(2rem, 4.6vw, 3.6rem); overflow-wrap: anywhere; }
.tp-headline { margin-top: 10px !important; color: color-mix(in srgb, var(--tc-text) 65%, var(--tc-accent)) !important; }
.tp-hero__icon { margin-inline-end: clamp(0px, 3vw, 40px); margin-top: 0; }

/* Subject groups the teacher is in (links to the group pages) */
.tp-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tp-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 6px;
    border: 1.5px solid #fff;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tc-card-bg) 85%, transparent);
    box-shadow: 0 8px 18px -12px rgba(40, 100, 210, .5);
    font-size: .9rem;
    font-weight: 700;
    color: var(--tc-navy);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
[dir="rtl"] .tp-group { padding: 5px 6px 5px 14px; }
.tp-group img { width: 30px; height: 26px; object-fit: contain; }
.tp-group:hover { transform: translateY(-2px); color: var(--tc-blue-dark); text-decoration: none; box-shadow: 0 12px 22px -12px color-mix(in srgb, var(--tc-accent) 60%, transparent); }

/* Actions */
.tp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 22px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.tp-btn svg { width: 18px; height: 18px; }
.tp-btn:hover { transform: translateY(-2px); text-decoration: none; }
.tp-btn--book {
    background: linear-gradient(90deg, color-mix(in srgb, var(--tc-badge-private) 80%, #fff), var(--tc-badge-private));
    box-shadow: 0 12px 22px -12px color-mix(in srgb, var(--tc-badge-private) 85%, transparent);
    color: #fff;
}
.tp-btn--book:hover { color: #fff; filter: brightness(1.06); }
.tp-btn--follow.btn-primary {
    background: var(--tc-accent-grad);
    box-shadow: 0 12px 22px -12px color-mix(in srgb, var(--tc-accent) 80%, transparent);
    color: #fff;
}
.tp-btn--follow.btn-danger { border-color: #f1c4c6; background: #fff; color: #d6363c; }
.tp-btn--ghost { border-color: var(--tc-accent); background: #fff; color: var(--tc-blue-dark); }
.tp-btn--ghost:hover { color: var(--tc-blue-dark); }
.tp-btn.loadingbar { opacity: .7; }

/* Stats */
.tp-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 30px;
}
.tp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 12px;
    border: 1.5px solid #fff;
    border-radius: 18px;
    background: var(--tc-card);
    box-shadow: var(--tc-shadow);
    text-align: center;
    animation: tc-rise .6s cubic-bezier(.2, .7, .2, 1) backwards;
}
.tp-stat:nth-child(2) { animation-delay: 70ms; }
.tp-stat:nth-child(3) { animation-delay: 140ms; }
.tp-stat:nth-child(4) { animation-delay: 210ms; }
.tp-stat b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--tc-navy);
}
.tp-stat b svg { width: 22px; height: 22px; color: #f5a524; }
.tp-stat span { font-size: .88rem; font-weight: 600; color: var(--tc-muted); }

/* Body: tabs + panes */
.tp-body { max-width: 1240px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 48px) 0; }
.tp-tabs { margin-bottom: 26px; }
.tp-pane { display: none; }
.tp-pane.active { display: block; animation: tc-rise .45s cubic-bezier(.2, .7, .2, 1) backwards; }

/* Cards */
.tp-about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tp-about--single { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; }
.tp-about__main, .tp-about__side { display: grid; gap: 20px; }
.tp-card {
    padding: 22px 24px;
    border: 1.5px solid #fff;
    border-radius: 22px;
    background: var(--tc-card);
    box-shadow: var(--tc-shadow);
}
.tp-card + .tp-about { margin-top: 20px; }
.tp-card h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; color: var(--tc-navy); }
.tp-card--notice { margin-bottom: 20px; border-color: #ffd9a8; background: #fff8ee; }
.tp-card--notice p { margin: 0; color: #8a5a14; }
.tp-text { font-size: .98rem; line-height: 1.8; color: var(--tc-ink); overflow-wrap: anywhere; }
.tp-list { margin: 0; padding-inline-start: 20px; color: var(--tc-ink); line-height: 1.8; }

/* Subjects by board */
.tp-boards { display: grid; gap: 14px; }
.tp-board__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: .82rem; font-weight: 700; color: var(--tc-muted); }
.tp-board__private { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--tc-badge-private) 15%, #fff); color: var(--tc-badge-private); font-size: .72rem; }
.tp-board__subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-board__subjects span {
    padding: 5px 12px;
    border: 1px solid color-mix(in srgb, var(--tc-accent) 20%, #fff);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    font-size: .85rem;
    font-weight: 600;
    color: var(--tc-navy);
}

/* Courses / products */
.tp-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tp-course {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1.5px solid #fff;
    border-radius: 20px;
    background: var(--tc-card);
    box-shadow: var(--tc-shadow);
    color: var(--tc-navy);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: tc-rise .6s cubic-bezier(.2, .7, .2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 60ms);
}
.tp-course:hover { transform: translateY(-5px); box-shadow: 0 24px 40px -20px color-mix(in srgb, var(--tc-accent) 50%, transparent); color: var(--tc-navy); text-decoration: none; }
.tp-course__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(180deg, #f7f9ff, #eaf0fb); }
.tp-course__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.tp-course:hover .tp-course__media img { transform: scale(1.05); }
.tp-course__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.tp-course__cat {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tc-accent) 12%, #fff);
    font-size: .75rem;
    font-weight: 700;
    color: var(--tc-blue-dark);
}
.tp-course__title { font-size: 1.02rem; font-weight: 800; line-height: 1.35; }
.tp-course__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; font-size: .85rem; color: var(--tc-muted); }
.tp-course__price { font-weight: 800; color: var(--tc-blue-dark); }

/* Tablet */
@media (max-width: 991px) {
    .tp-hero__icon { display: none; }
    .tp-about { grid-template-columns: minmax(0, 1fr); }
}

/* Phone */
@media (max-width: 640px) {
    .tp-hero__grid { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 16px; }
    .tp-photo { width: 130px; border-width: 4px; border-radius: 26px; }
    .tp-hero__badge { inset-inline-end: -40px; }
    .tp-actions { width: 100%; }
    .tp-btn { flex: 1 1 auto; padding: 10px 16px; font-size: .9rem; }
    .tp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
    .tp-stat { padding: 12px 8px; border-radius: 16px; }
    .tp-stat b { font-size: 1.35rem; }
    .tp-body { padding-top: 24px; }
    .tp-card { padding: 18px; border-radius: 18px; }
    .tp-courses { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .tp-hero__photo, .tp-stat, .tp-course, .tp-pane.active { animation: none; }
    .tp-group, .tp-btn, .tp-course, .tp-course__media img { transition: none; }
}
