/* Student card — extracted from surfaces.css, redesigned per Claude Design 2026-05-06 */

/* ── Card grid ── */
.students-directory-view #studentsList {
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-5);
}

/* ── Card shell ── */
.students-directory-view .student-card {
    position: relative;
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    transition: var(--transition-base);
}

.students-directory-view .student-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--border-strong);
}


/* ── Card head ── */
.students-directory-view .student-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.students-directory-view .student-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2563eb, #1a4fcf);
    color: var(--fg-on-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.students-directory-view .student-card-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.students-directory-view .student-card-avatar.has-image .student-card-avatar-initials {
    display: none;
}

.students-directory-view .student-card-avatar-initials {
    font-family: var(--font-headline);
    font-size: var(--text-h3);
    font-weight: var(--weight-bold);
}

.students-directory-view .student-card-identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.students-directory-view .student-card-name {
    margin: 0;
    color: var(--on-surface);
    font-size: 16px;
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-normal);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.students-directory-view .student-card-badge-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-1);
    align-self: flex-start;
}

.students-directory-view .student-card-grade-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    color: var(--primary);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    padding: 2px var(--space-2);
}

.students-directory-view .student-card-badge-row .student-card-grade-badge {
    align-self: center;
}

/* ── Subject pills ── */
.students-directory-view .student-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.students-directory-view .student-card-pill {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.students-directory-view .student-card-pill--math    { background: #e0ecff; color: #1a4fcf; }
.students-directory-view .student-card-pill--english { background: #d6f5e3; color: #047857; }
.students-directory-view .student-card-pill--science { background: #fef0d6; color: #b45309; }
.students-directory-view .student-card-pill--chinese { background: #ece4fb; color: #6d28d9; }
.students-directory-view .student-card-pill--unknown { background: #f1f5f9; color: #64748b; }

/* ── Divider ── */
.students-directory-view .student-card-divider {
    height: 1px;
    background: var(--color-neutral-100);
    margin: 0 -22px 16px;
}

/* ── Stats row ── */
.students-directory-view .student-card-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.students-directory-view .student-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.students-directory-view .student-card-metric-item {
    min-width: 0;
}

.students-directory-view .student-card-micro-label {
    margin: 0 0 4px;
    color: var(--fg-tertiary);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.students-directory-view .student-card-metric-value {
    margin: 0;
    color: var(--fg-primary);
    font-size: 20px;
    font-weight: var(--weight-bold);
    line-height: 1;
}

.students-directory-view .student-card-metric-value.muted {
    color: var(--color-neutral-300);
    font-weight: var(--weight-medium);
}

/* ── Footer buttons ── */
.students-directory-view .student-card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.students-directory-view .student-card-view-profile-btn,
.students-directory-view .student-card-start-session-btn {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.students-directory-view .student-card-view-profile-btn {
    background: var(--surface-container-lowest);
    color: var(--on-surface);
    border: 1px solid var(--border-default);
}

.students-directory-view .student-card-view-profile-btn:hover {
    background: var(--bg-page);
    border-color: var(--border-strong);
}

.students-directory-view .student-card-start-session-btn {
    background: var(--color-primary-700);
    color: var(--fg-on-primary);
    border: 1px solid var(--color-primary-700);
}

.students-directory-view .student-card-start-session-btn:hover {
    background: var(--color-primary-800);
    border-color: var(--color-primary-800);
}

/* ── Kebab menu ── */
.students-directory-view .student-card-kebab-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 1;
    padding: 0;
}

.students-directory-view .student-card-kebab-btn:hover,
.students-directory-view .student-card-kebab-btn:focus-visible {
    background: color-mix(in srgb, var(--on-surface) 8%, transparent);
    color: var(--on-surface);
}

.students-directory-view .student-card-kebab-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.students-directory-view .student-card-kebab-menu {
    position: absolute;
    top: calc(var(--space-2) + 28px + var(--space-1));
    right: var(--space-2);
    min-width: 168px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 20;
    display: none;
    flex-direction: column;
    padding: var(--space-1) 0;
}

.students-directory-view .student-card-kebab-menu.is-open {
    display: flex;
}

.students-directory-view .student-card-kebab-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--on-surface);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.students-directory-view .student-card-kebab-item:hover {
    background: color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.students-directory-view .student-card-kebab-item--danger {
    color: var(--error);
}

.students-directory-view .student-card-kebab-item--danger:hover {
    background: color-mix(in srgb, var(--error) 10%, transparent);
    color: var(--error);
}
