/**
 * Hilanaw Community — Dashboard Styles
 * Covers: investor dashboard, organization dashboard, shared sections,
 *         cohort cards, stats bar, interest list, modals, dark mode.
 *
 * Uses the same .hc- component classes from hilanaw-community.css
 * (buttons, tags, spinners, modals, forms) — no duplication.
 * Dashboard-specific classes use the .hcd- prefix.
 *
 * @package Hilanaw_Community
 * @version 1.0.0
 */

/* ============================================================
   DASHBOARD WRAP
   ============================================================ */
.hcd-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
    color: var(--hc-text);
    font-family: inherit;
    box-sizing: border-box;
}

/* ============================================================
   DASHBOARD HEADER
   ============================================================ */
.hcd-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 36px 0 28px;
    border-bottom: 1px solid var(--hc-border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.hcd-header__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--hc-blue-light);
    color: var(--hc-blue);
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--hc-border);
}

.hcd-header__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hcd-header__info { flex: 1; }

.hcd-header__name {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 800;
    color: var(--hc-text);
    margin: 0 0 4px;
    line-height: 1.2;
}

.hcd-header__role-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-blue);
    margin: 0 0 6px;
}

.hcd-header__focus {
    font-size: 13px;
    color: var(--hc-text-soft);
    margin: 0;
    line-height: 1.5;
}

.hcd-header__focus-label {
    font-weight: 600;
    color: var(--hc-text-mid);
    margin-right: 4px;
}

.hcd-header__actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-top: 4px;
}

/* ============================================================
   STATS BAR
   ============================================================ */
.hcd-stats-bar {
    display: flex;
    gap: 0;
    background: var(--hc-surface-alt);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.hcd-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 12px;
    border-right: 1px solid var(--hc-border);
    text-align: center;
}

.hcd-stat:last-child { border-right: none; }

.hcd-stat--faint .hcd-stat__value { color: var(--hc-text-soft); }

.hcd-stat__value {
    font-size: 24px;
    font-weight: 800;
    color: var(--hc-blue);
    line-height: 1;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.hcd-stat__sub {
    font-size: 13px;
    font-weight: 500;
    color: var(--hc-text-soft);
}

.hcd-stat__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--hc-text-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ============================================================
   QUICK LINKS
   ============================================================ */
.hcd-quick-links {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.hcd-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--hc-surface);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    text-decoration: none;
    color: var(--hc-text);
    font-size: 14px;
    font-weight: 600;
    transition: border-color var(--hc-transition), box-shadow var(--hc-transition),
                background var(--hc-transition);
    flex: 1;
    min-width: 200px;
}

.hcd-quick-link:hover {
    border-color: var(--hc-blue);
    background: var(--hc-blue-light);
    box-shadow: var(--hc-shadow);
    color: var(--hc-blue);
}

.hcd-quick-link__icon { font-size: 20px; flex-shrink: 0; }

/* ============================================================
   DASHBOARD SECTIONS
   ============================================================ */
.hcd-section {
    padding: 28px 0;
    border-top: 1px solid var(--hc-border);
}

.hcd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hcd-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--hc-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hcd-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hc-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
}

.hcd-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.hcd-badge--alert {
    background: var(--hc-red);
    color: #fff;
}

.hcd-empty-state {
    text-align: center;
    padding: 36px 20px;
    background: var(--hc-surface-alt);
    border-radius: var(--hc-radius);
    border: 1.5px dashed var(--hc-border-mid);
}

.hcd-empty-state p {
    color: var(--hc-text-soft);
    font-size: 14px;
    margin: 0 0 14px;
}

.hcd-empty-state__hint {
    font-size: 13px !important;
    color: var(--hc-text-faint) !important;
}

/* ============================================================
   INTEREST LIST
   ============================================================ */
.hcd-interest-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hcd-interest-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--hc-surface);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    padding: 16px 18px;
    transition: box-shadow var(--hc-transition);
}

.hcd-interest-card:hover { box-shadow: var(--hc-shadow); }

.hcd-interest-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hc-blue-light);
    color: var(--hc-blue);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.hcd-interest-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hcd-interest-card__body { flex: 1; min-width: 0; }

.hcd-interest-card__pitch-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--hc-text);
    margin: 0 0 3px;
}

.hcd-interest-card__tagline {
    font-size: 13px;
    color: var(--hc-text-soft);
    margin: 0 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hcd-interest-card__meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.hcd-interest-card__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hcd-interest-card__date {
    font-size: 12px;
    color: var(--hc-text-faint);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Connection status badge */
.hcd-connection-status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
}

.hcd-connection-status--pending  { background: #fef9c3; color: #854d0e; }
.hcd-connection-status--accepted { background: #dcfce7; color: #15803d; }
.hcd-connection-status--declined { background: #fee2e2; color: #991b1b; }

.hcd-pitch-closed-badge {
    font-size: 12px;
    color: var(--hc-text-faint);
    background: var(--hc-surface-alt);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--hc-border);
}

/* ============================================================
   PROFILE DISPLAY
   ============================================================ */
.hcd-profile-display {
    background: var(--hc-surface-alt);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    overflow: hidden;
}

.hcd-profile-display__row {
    display: flex;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--hc-border);
}

.hcd-profile-display__row:last-child { border-bottom: none; }

.hcd-profile-display__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--hc-text-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    min-width: 130px;
    flex-shrink: 0;
    padding-top: 2px;
}

.hcd-profile-display__value {
    font-size: 14px;
    color: var(--hc-text-mid);
    line-height: 1.6;
}

.hcd-profile-edit {
    margin-top: 20px;
    padding: 24px;
    background: var(--hc-surface-alt);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
}

/* ============================================================
   MY CONNECTIONS
   ============================================================ */
.hcd-connections-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
    gap: 14px;
}

.hcd-connection-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: var(--hc-surface);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    padding: 20px 16px 16px;
    transition: box-shadow var(--hc-transition);
}

.hcd-connection-card:hover { box-shadow: var(--hc-shadow); }

.hcd-connection-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--hc-blue-light);
    color: var(--hc-blue);
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--hc-border);
}

.hcd-connection-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hcd-connection-card__photo--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hcd-connection-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.hcd-connection-card__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--hc-text);
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hcd-connection-card__biz {
    font-size: 12px;
    color: var(--hc-text-soft);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hcd-connection-card__role {
    font-size: 11px;
    font-weight: 600;
    color: var(--hc-blue);
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
}

.hcd-connection-card__actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 4px;
}

/* ============================================================
   COHORT SECTION (org only)
   ============================================================ */
.hcd-cohort-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hcd-cohort-card {
    background: var(--hc-surface);
    border: 1.5px solid var(--hc-border);
    border-radius: var(--hc-radius);
    padding: 20px;
    transition: box-shadow var(--hc-transition);
}

.hcd-cohort-card:hover { box-shadow: var(--hc-shadow); }

.hcd-cohort-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hcd-cohort-card__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--hc-text);
    margin: 0 0 6px;
}

.hcd-cohort-card__status-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.hcd-cohort-status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
}

.hcd-cohort-status--active   { background: #dcfce7; color: #15803d; }
.hcd-cohort-status--closed   { background: #fee2e2; color: #991b1b; }
.hcd-cohort-status--archived { background: var(--hc-surface-alt); color: var(--hc-text-faint); border: 1px solid var(--hc-border); }

.hcd-cohort-visibility {
    font-size: 12px;
    color: var(--hc-text-faint);
    font-weight: 500;
}

.hcd-cohort-card__description {
    font-size: 13px;
    color: var(--hc-text-soft);
    margin: 0 0 14px;
    line-height: 1.5;
}

.hcd-cohort-card__stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hcd-cohort-stat {
    font-size: 13px;
    color: var(--hc-text-soft);
}

.hcd-cohort-stat strong {
    color: var(--hc-text);
    font-weight: 700;
    margin-right: 4px;
}

.hcd-cohort-stat--alert strong { color: var(--hc-red); }
.hcd-cohort-stat--faint { color: var(--hc-text-faint); }

.hcd-cohort-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Wide modal variant for cohort forms — scrollable on short/mobile screens */
.hc-modal__box--wide {
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* The form sits between the box and the body, so it must
   also be a flex column that fills the available height */
.hc-modal__box--wide form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hc-modal__box--wide .hc-modal__header {
    padding: 24px 24px 0;
    flex-shrink: 0;
}

.hc-modal__box--wide .hc-modal__body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.hc-modal__box--wide .hc-modal__actions {
    padding: 16px 24px 24px;
    flex-shrink: 0;
    border-top: 1px solid var(--hc-border);
    background: var(--hc-surface);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .hcd-header         { flex-direction: column; }
    .hcd-stats-bar      { flex-wrap: wrap; }
    .hcd-stat           { min-width: 45%; border-right: none; border-bottom: 1px solid var(--hc-border); }
    .hcd-stat:last-child { border-bottom: none; }
    .hcd-quick-links    { flex-direction: column; }
    .hcd-quick-link     { min-width: auto; }
    .hcd-profile-display__row { flex-direction: column; gap: 4px; }
    .hcd-profile-display__label { min-width: auto; }
    .hcd-interest-card  { flex-direction: column; }
    .hcd-interest-card__date { align-self: flex-end; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
body.hilanaw-dark-mode .hcd-stats-bar {
    background: #111827;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-stat {
    border-right-color: #374151;
}

body.hilanaw-dark-mode .hcd-quick-link {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

body.hilanaw-dark-mode .hcd-quick-link:hover {
    border-color: #3b82f6;
    background: #1e3a5f;
    color: #93c5fd;
}

body.hilanaw-dark-mode .hcd-interest-card {
    background: #1f2937;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-interest-card__avatar {
    background: #1e3a5f;
    color: #93c5fd;
}

body.hilanaw-dark-mode .hcd-connection-card {
    background: #1f2937;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-connection-card__avatar {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-connection-status--pending  { background: #292524; color: #fcd34d; }
body.hilanaw-dark-mode .hcd-connection-status--accepted { background: #14532d; color: #86efac; }
body.hilanaw-dark-mode .hcd-connection-status--declined { background: #450a0a; color: #fca5a5; }

body.hilanaw-dark-mode .hcd-profile-display {
    background: #111827;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-profile-display__row {
    border-bottom-color: #374151;
}

body.hilanaw-dark-mode .hcd-profile-edit {
    background: #111827;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-empty-state {
    background: #111827;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-cohort-card {
    background: #1f2937;
    border-color: #374151;
}

body.hilanaw-dark-mode .hcd-cohort-status--active   { background: #14532d; color: #86efac; }
body.hilanaw-dark-mode .hcd-cohort-status--closed   { background: #450a0a; color: #fca5a5; }
body.hilanaw-dark-mode .hcd-cohort-status--archived { background: #1f2937; color: #6b7280; border-color: #374151; }

body.hilanaw-dark-mode .hcd-pitch-closed-badge {
    background: #1f2937;
    border-color: #374151;
    color: #6b7280;
}

/* ============================================================
   REPORT REQUEST CARDS (entrepreneur dashboard)
   ============================================================ */
.hcd-report-request-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hcd-report-request-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--hc-surface);
    border: 1.5px solid var(--hc-border);
    border-left: 4px solid var(--hc-blue);
    border-radius: var(--hc-radius);
    padding: 16px 18px;
    transition: box-shadow var(--hc-transition);
}

.hcd-report-request-card:hover { box-shadow: var(--hc-shadow); }

.hcd-report-request-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hc-blue-light);
    color: var(--hc-blue);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.hcd-report-request-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hcd-report-request-card__body { flex: 1; min-width: 0; }

.hcd-report-request-card__name {
    font-size: 15px;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hcd-report-request-card__role {
    font-size: 11px;
    background: var(--hc-blue-light);
    color: var(--hc-blue);
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 600;
}

.hcd-report-request-card__message {
    font-size: 13px;
    color: var(--hc-text-soft);
    font-style: italic;
    margin: 0 0 6px;
    line-height: 1.5;
}

.hcd-report-request-card__meta {
    font-size: 12px;
    color: var(--hc-text-faint);
    margin: 0;
}

.hcd-report-request-card__actions { flex-shrink: 0; align-self: center; }

/* Dark mode */
body.hilanaw-dark-mode .hcd-report-request-card {
    background: #1f2937;
    border-color: #374151;
    border-left-color: #3b82f6;
}

body.hilanaw-dark-mode .hcd-report-request-card__avatar {
    background: #1e3a5f;
    color: #93c5fd;
}

body.hilanaw-dark-mode .hcd-report-request-card__role {
    background: #1e3a5f;
    color: #93c5fd;
}
