/**
 * Coach Student Profile Styles
 * Layout, header, actions, assignments, stats, section titles.
 * Detail styles (systems, sessions, events) → coach-student-detail.css
 */

/* Page Base */
body.coach-student-page {
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.006em;
}

.student-main {
    padding: 3rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
    transition: color var(--duration-fast) var(--ease-out);
}

.back-link:hover {
    color: var(--accent);
}

/* ==========================================================================
   Profile Header
   ========================================================================== */

.student-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.student-header-loading {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.header-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    background-position: center;
}

.header-info {
    flex: 1;
    min-width: 0;
}

.header-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.student-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.action-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.action-btn--primary:hover {
    opacity: 0.9;
    background: var(--accent);
}

/* Inline assignment forms */
.assignment-form {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
}

.assignment-form.visible {
    display: block;
}

.assignment-form-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.875rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.form-toggle-group {
    display: flex;
    gap: 0.5rem;
}

.form-toggle {
    padding: 0.375rem 0.75rem;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.form-toggle.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.form-submit {
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-cancel {
    padding: 0.625rem 1rem;
    background: none;
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    cursor: pointer;
}

.form-success {
    color: var(--accent-success, #22c55e);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Active Assignments
   ========================================================================== */

.assignments-section {
    margin-bottom: 1.5rem;
}

.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assignment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.assignment-top-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.assignment-type {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent, #9c40ff);
    background: rgba(156, 64, 255, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.assignment-type--pending {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
}

.assignment-type--expired {
    color: var(--text-quaternary);
    background: rgba(255, 255, 255, 0.04);
}

.assignment-date {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

.assignment-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.assignment-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Student's "tell your coach" reflection on a pending-review focus. */
.assignment-student-note {
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: rgba(var(--accent-rgb), 0.07);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
}

.assignment-student-note__label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.assignment-student-note__text {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.assignment-expiry {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.assignment-expiry--soon {
    color: #f59e0b;
}

.assignment-card--pending {
    border-color: rgba(96, 165, 250, 0.3);
}

.assignment-card--expired {
    opacity: 0.6;
}

.assignment-card--completed {
    opacity: 0.7;
    border-style: dashed;
}

.assignment-type--completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success, #22c55e);
}

/* Focus History (collapsible) */
.focus-history-section {
    margin-bottom: 1.5rem;
}

.focus-history-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    text-align: left;
}

.focus-history-toggle:hover {
    color: var(--text-secondary);
}

.focus-history-arrow {
    font-size: 0.75rem;
    width: 0.75rem;
    text-align: center;
}

.focus-history-count {
    font-size: 0.6875rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.focus-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.375rem;
}

/* Action row: edit + remove buttons */
.assignment-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    justify-content: flex-end;
}

.assignment-edit-btn {
    padding: 0.3rem 0.75rem;
    background: rgba(156, 64, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--accent, #9c40ff);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}

.assignment-edit-btn:hover {
    background: rgba(156, 64, 255, 0.2);
}

.assignment-remove-btn {
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary, #666);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}

.assignment-remove-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning, #f59e0b);
}

/* Pending review action buttons */
.assignment-review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.assignment-accept-btn,
.assignment-reassign-btn {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
}

.assignment-accept-btn {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.assignment-accept-btn:hover {
    background: rgba(16, 185, 129, 0.25);
}

.assignment-reassign-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.assignment-reassign-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Section Titles
   ========================================================================== */

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.systems-section {
    margin-bottom: 2rem;
}

.sessions-section {
    margin-bottom: 2rem;
}

/* --- Multi-video focus links (coach focus form) ----------------------- */
.focus-videos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.focus-video-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.focus-video-row .focus-video-input {
    flex: 1 1 auto;
    min-width: 0;
}
.focus-video-remove {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
}
.focus-video-remove:hover {
    color: var(--accent-danger, #ef4444);
    border-color: var(--accent-danger, #ef4444);
}
.focus-add-video {
    align-self: flex-start;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light, rgba(37, 99, 235, 0.12));
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
}
.focus-add-video:hover { border-color: var(--accent); }

/* Attach-a-game button + selected chip (assign-focus form) */
.focus-add-game {
    align-self: flex-start;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light, rgba(37, 99, 235, 0.12));
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
}
.focus-add-game:hover { border-color: var(--accent); }
/* The attached game shows its full mechanics card + an actions row; the card
   carries its own border, so the wrapper is just a column. */
.focus-game-chip {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.focus-game-chip__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #f5f5f7);
}
.focus-game-actions {
    display: flex;
    gap: 0.5rem;
}
.focus-game-change,
.focus-game-remove {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-subtle, #2a2a35);
    background: var(--bg-card, #16161d);
    cursor: pointer;
}
.focus-game-change { color: var(--accent, #2563eb); }
.focus-game-change:hover { border-color: var(--accent, #2563eb); }
.focus-game-remove { color: var(--text-tertiary, #9a9aa5); }
.focus-game-remove:hover { color: var(--accent-danger, #ef4444); border-color: var(--accent-danger, #ef4444); }

/* Attached-game mechanics card (rendered on the assignment) */
.assignment-game-card {
    margin-top: 0.6rem;
    padding: 0.6rem 0.7rem;
    background: var(--bg-card, #16161d);
    border: 1px solid var(--border-subtle, #2a2a35);
    border-left: 3px solid var(--accent, #2563eb);
    border-radius: var(--radius-md, 8px);
}
.assignment-game-card__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.assignment-game-card__name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #f5f5f7);
}
.assignment-game-card__system {
    font-size: 0.72rem;
    text-transform: capitalize;
    color: var(--text-tertiary, #9a9aa5);
}
.assignment-game-card__row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.5;
}
.assignment-game-card__label {
    flex: none;
    min-width: 80px;
    font-weight: 600;
    color: var(--text-secondary, #c5c5cf);
}
.assignment-game-card__value { color: var(--text-primary, #f5f5f7); }

/* ─── Back to Students ───────────────────────────────────────────────────
   Detail -> list affordance, mirroring coach-kid-detail's .ck-back-link.
   This is NOT the pattern leaderboard.html rejects: that is peer navigation
   between top-level pages (the sidebar already covers it); this is a
   drill-down, where the sidebar's "Students" reads as fresh navigation
   rather than "back to the list I was just on".

   Unlike .ck-back-link this meets the a11y floor: a 44px touch target
   (WCAG 2.2 SC 2.5.8) and a visible keyboard focus ring (SC 2.4.7). The
   icon is aria-hidden; the accessible name is the anchor's aria-label. */
.cs-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-right: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
}

.cs-back-link:hover {
    color: var(--accent);
}

/* Pointer focus stays quiet; keyboard focus is explicit. */
.cs-back-link:focus {
    outline: none;
}

.cs-back-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
