/* ===================================================================
   COACH NOTES — Premium Redesign
   =================================================================== */

/* ── Page Header ── */
.cn-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cn-page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cn-page-title i {
    background: var(--gradient-primary, linear-gradient(135deg, #ff9f1c, #f72585));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cn-page-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* ── Stats Row ── */
.cn-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cn-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.cn-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.3);
}

.cn-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.cn-stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cn-stat-card.total  .cn-stat-value { color: var(--accent-primary, #ff9f1c); }
.cn-stat-card.noted  .cn-stat-value { color: #22c55e; }
.cn-stat-card.empty  .cn-stat-value { color: rgba(255,255,255,0.4); }

/* ── Toolbar (search + filters) ── */
.cn-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.cn-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.cn-search-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#coachNotesSearch {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#coachNotesSearch:focus {
    outline: none;
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.5);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 255, 159, 28), 0.12);
}

#coachNotesSearch::placeholder { color: var(--text-muted); }

.cn-filter-group {
    display: flex;
    gap: 0.4rem;
}

.cn-filter-btn {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cn-filter-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.cn-filter-btn.active {
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.15);
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.4);
    color: var(--accent-primary, #ff9f1c);
}

/* ── Player Note Card ── */
.cn-player-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    backdrop-filter: blur(10px);
}

.cn-player-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.cn-player-card.has-notes {
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.15);
}

/* Card header row */
.cn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.cn-card-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex: 1;
    min-width: 0;
}

.cn-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.cn-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.cn-avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 17px;
    height: 17px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg-primary, #0d1117);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: white;
}

.cn-member-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cn-member-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cn-member-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cn-card-actions {
    flex-shrink: 0;
}

.cn-edit-btn {
    padding: 0.45rem 1.1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 159, 28), 0.4);
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.1);
    color: var(--accent-primary, #ff9f1c);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cn-edit-btn:hover {
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.2);
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.6);
    transform: scale(1.03);
}

.cn-add-btn {
    padding: 0.45rem 1.1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

/* Tags row */
.cn-tags-row {
    padding: 0 1.25rem 0.75rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cn-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.12);
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 159, 28), 0.3);
    color: var(--accent-primary, #ff9f1c);
}

/* Note sections inside card */
.cn-notes-body {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    background: rgba(0, 0, 0, 0.15);
}

.cn-note-section {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    position: relative;
    overflow: hidden;
}

.cn-note-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.cn-note-section.perf   { background: rgba(59, 130, 246, 0.08); }
.cn-note-section.perf::before { background: #3b82f6; }

.cn-note-section.train  { background: rgba(34, 197, 94, 0.08); }
.cn-note-section.train::before { background: #22c55e; }

.cn-note-section.comm   { background: rgba(168, 85, 247, 0.08); }
.cn-note-section.comm::before { background: #a855f7; }

.cn-note-sec-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cn-note-section.perf  .cn-note-sec-title { color: #3b82f6; }
.cn-note-section.train .cn-note-sec-title { color: #22c55e; }
.cn-note-section.comm  .cn-note-sec-title { color: #a855f7; }

.cn-note-sec-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

/* Empty state within card */
.cn-empty-card {
    padding: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Full page empty state */
.cn-empty-page {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.cn-empty-page i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    display: block;
}

/* ── Player view (own notes) ── */
.cn-own-notes-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.cn-own-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg,
        rgba(var(--accent-primary-rgb, 255, 159, 28), 0.07) 0%,
        rgba(var(--accent-secondary-rgb, 247, 37, 133), 0.05) 100%);
}

.cn-own-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cn-own-updated {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cn-own-body {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

/* ── Modal overrides ── */
.cn-modal .modal-content {
    background: var(--bg-secondary, #1a1f2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
}

.cn-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.2rem 1.5rem;
}

.cn-modal .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.cn-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.5rem;
}

.cn-modal textarea,
.cn-modal input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.cn-modal textarea:focus,
.cn-modal input[type="text"]:focus {
    outline: none;
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.5);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 255, 159, 28), 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.cn-modal .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.4rem;
}

.cn-modal .form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cn-tip-banner {
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.08);
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 159, 28), 0.2);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cn-tip-banner i { color: var(--accent-primary, #ff9f1c); margin-top: 1px; flex-shrink: 0; }

/* Player selection list */
.cn-player-pick-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.cn-player-pick-item:hover {
    background: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.08);
    border-color: rgba(var(--accent-primary-rgb, 255, 159, 28), 0.3);
    transform: translateX(3px);
}

.cn-player-pick-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.cn-player-pick-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.1rem;
}

.cn-player-pick-email {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Create Note Button ── */
.cn-create-btn {
    padding: 0.6rem 1.4rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: var(--gradient-primary, linear-gradient(135deg, #ff9f1c, #f72585));
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb, 255, 159, 28), 0.25);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cn-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--accent-primary-rgb, 255, 159, 28), 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .cn-stats-row { grid-template-columns: 1fr 1fr 1fr; }
    .cn-notes-body { grid-template-columns: 1fr; }
    .cn-own-body   { grid-template-columns: 1fr; }
    .cn-page-title { font-size: 1.4rem; }
}


@media (max-width: 480px) {
    .cn-stats-row { grid-template-columns: 1fr; }
    .cn-toolbar    { flex-direction: column; align-items: stretch; }
}

/* ══════════════════════════════════════════════════════════
   COACH NOTES — Library Tab Styles
   ══════════════════════════════════════════════════════════ */

/* ── Tab Bar ── */
.cn-tabs-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cn-tab-btn {
    padding: 0.65rem 1.4rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -1px;
}

.cn-tab-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.cn-tab-btn.active {
    color: #ff9f1c;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    border-bottom-color: transparent;
}

/* ── Library Toolbar ── */
.cn-library-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
}

.cn-library-categories { display: flex; gap: 0.4rem; flex-wrap: wrap; flex: 1; }

.cn-cat-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: #a1a1a1;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cn-cat-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.cn-cat-btn.active {
    background: rgba(255,159,28,0.15);
    border-color: rgba(255,159,28,0.4);
    color: #ff9f1c;
}

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

.cn-lib-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}
.cn-lib-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,159,28,0.25);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.cn-lib-card-thumb {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cn-lib-card-badge {
    position: absolute;
    bottom: 8px;
    left: 10px;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    border: 1px solid;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
}

.cn-lib-card-body {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cn-lib-card-title { color: #fff; font-size: 0.95rem; font-weight: 700; line-height: 1.3; }

.cn-lib-card-notes {
    color: #a1a1a1;
    font-size: 0.8rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cn-lib-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.cn-lib-card-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ff9f1c;
    text-decoration: none;
    margin-top: 0.25rem;
}
.cn-lib-card-link:hover { opacity: 0.8; }

/* Edit/Delete actions overlay */
.cn-lib-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.cn-lib-card:hover .cn-lib-card-actions { opacity: 1; }

.cn-lib-btn-edit,
.cn-lib-btn-delete {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}
.cn-lib-btn-edit   { background: rgba(52,152,219,0.85); color: #fff; }
.cn-lib-btn-delete { background: rgba(231,76,60,0.85);  color: #fff; }
.cn-lib-btn-edit:hover   { background: #3498db; transform: scale(1.1); }
.cn-lib-btn-delete:hover { background: #e74c3c; transform: scale(1.1); }

/* Empty state */
.cn-library-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 576px) {
    .cn-library-grid { grid-template-columns: 1fr; }
    .cn-tabs-bar { gap: 0.25rem; }
    .cn-tab-btn { padding: 0.5rem 0.9rem; font-size: 0.82rem; }
}
