/**
 * Coach Dashboard — Layout Components (Phase 0E Redesign)
 * Two-column layout, chart cards, side panel cards, at-risk students.
 * Split from coach-dashboard.css to keep files under 700 lines.
 */

/* --- Two-Column Dashboard Layout --- */

.cd-columns {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-top: 24px;
}

.cd-main-col {
    min-width: 0;
}

.cd-side-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

/* --- Chart Cards --- */

.coach-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
}

.coach-chart-card canvas {
    width: 100% !important;
    max-height: 260px;
}

/* --- Insights Card --- */

.coach-insights-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.coach-insights-card ul {
    margin: 8px 0;
    padding-left: 20px;
}

.coach-insights-card li {
    margin-bottom: 6px;
}

.coach-insights-card strong {
    color: var(--text-primary);
}

/* --- Side Column Cards --- */

.cd-side-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.cd-side-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.cd-side-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.cd-side-field {
    margin-bottom: 12px;
}

.cd-side-field:last-child {
    margin-bottom: 0;
}

.cd-side-field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.cd-side-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-team-pricing-nudge {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid rgba(34, 197, 94, 0.5);
    border-radius: 4px;
    line-height: 1.4;
}

.cd-team-pricing-nudge strong {
    color: rgb(34, 197, 94);
}

.cd-side-edit-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.12s ease;
}

.cd-side-edit-btn:hover {
    color: var(--accent);
}

.cd-invite-code {
    font-family: var(--font-family-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.cd-share-url {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

/* --- At-Risk Student Row --- */

.cd-at-risk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.cd-at-risk-row:last-child {
    border-bottom: none;
}

.cd-at-risk-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.cd-at-risk-days {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-danger);
    white-space: nowrap;
}

/* --- Chart Tabs (Overview / Over Time toggle) --- */

.cd-chart-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 3px;
}

.cd-chart-tab {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cd-chart-tab:hover {
    color: var(--text-secondary);
}

.cd-chart-tab--active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Chart Title (inside chart cards) --- */

.cd-chart-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    text-align: center;
}

/* --- Skill Tab Panels --- */

.cd-skill-tab {
    /* shown/hidden via JS */
}

/* Fixed height for skill trends chart area so switching tabs doesn't shift layout */
#skillOverviewContent,
#skillStruggleChart {
    min-height: 380px;
}

#skillOverviewContent canvas,
#skillStruggleChart canvas {
    max-height: 360px;
}

/* --- Dot Carousel Navigation --- */

.cd-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 4px;
}

.cd-carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.cd-carousel-arrow:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    color: var(--text-primary);
}

.cd-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
}

.cd-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.cd-dot:hover {
    background: var(--gray-5);
}

.cd-dot--active {
    background: var(--accent);
    transform: scale(1.25);
}

/* --- Category Filter Buttons (Struggle Ratio tab) --- */

.cd-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    justify-content: center;
}

.cd-category-btn {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cd-category-btn:hover {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.cd-category-btn--active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}

/* --- Unworked System Pills --- */

.cd-unworked-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    justify-content: center;
}

.cd-unworked-pill {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--gray-2);
    color: var(--text-quaternary);
    font-size: 11px;
    font-weight: 500;
}

/* --- Help GrapplingU Grow — Coach Review Card --- */

.cd-review-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
}

.cd-review-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.cd-review-status--pending {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: rgb(180, 130, 0);
}

.cd-review-status--approved {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: rgb(20, 140, 60);
}

/* --- Review Form (inside summary modal) --- */

/* Center the modal title only when the review form is the modal body.
   :has() scopes this to the review modal so other summary modals stay
   left-aligned. Close button is absolute so it doesn't push the title
   off the modal's center axis. */
.summary-modal-content:has(.coach-review-form) .summary-modal-header {
    position: relative;
}

.summary-modal-content:has(.coach-review-form) .summary-modal-title {
    flex: 1;
    text-align: center;
}

.summary-modal-content:has(.coach-review-form) .summary-modal-close {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.coach-review-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.coach-review-prompt {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.coach-review-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px 0;
}

.coach-review-star {
    background: transparent;
    border: none;
    font-size: 36px;
    line-height: 1;
    color: var(--border-medium);
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.coach-review-star:hover {
    transform: scale(1.1);
}

.coach-review-star--filled {
    color: #f5b942;
}

.coach-review-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-input, var(--bg-card));
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.coach-review-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.coach-review-counter {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
    margin-top: -8px;
}

.coach-review-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.coach-review-actions .btn {
    min-width: 120px;
}

/* --- Awaiting Your Review — sidebar card listing pending student completions --- */

.pending-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pending-review-row {
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
}

.pending-review-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.pending-review-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pending-review-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.pending-review-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-review-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.pending-review-title {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pending-review-quote {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
    padding: 6px 8px;
    border-left: 2px solid var(--accent);
    background: rgba(59, 130, 246, 0.06);
    border-radius: 4px;
    font-style: italic;
}

.pending-review-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.pending-review-btn {
    padding: 5px 10px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pending-review-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.pending-review-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pending-review-btn--accept {
    border-color: rgba(34, 197, 94, 0.5);
    color: rgb(34, 197, 94);
}

.pending-review-btn--accept:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgb(34, 197, 94);
}

.pending-review-btn--reassign {
    border-color: rgba(234, 179, 8, 0.5);
    color: rgb(234, 179, 8);
}

.pending-review-btn--reassign:hover {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgb(234, 179, 8);
}
