/**
 * Hello Middleton - Profile Completeness Card
 * Progress nudge shown on own profile until all steps complete.
 *
 * @requires tokens.css
 * @version 1.0.0
 */

/* ==========================================================================
   CARD CONTAINER
   ========================================================================== */

.hm-profile-complete {
    background: var(--hm-bg-elevated);
    border: 1px solid var(--hm-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.hm-profile-complete__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.hm-profile-complete__header svg {
    width: 20px;
    height: 20px;
    color: var(--hm-primary, var(--hm-primary));
    flex-shrink: 0;
}

.hm-profile-complete__title {
    font-family: var(--font-display, 'DM Serif Display', Georgia, serif);
    font-size: var(--text-lg, 1.125rem);
    font-weight: 400;
    color: var(--hm-text);
    margin: 0;
    line-height: var(--leading-tight, 1.25);
}

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */

.hm-profile-complete__progress {
    margin-bottom: 20px;
}

.hm-profile-complete__bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hm-profile-complete__bar {
    flex: 1;
    height: 8px;
    background: var(--hm-neutral-100);
    border-radius: 999px;
    overflow: hidden;
}

.hm-profile-complete__bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hm-primary, var(--hm-primary)), var(--hm-primary-400));
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 0;
}

.hm-profile-complete__bar-label {
    font-family: var(--font-body);
    font-size: var(--text-sm, 0.875rem);
    font-weight: 600;
    color: var(--hm-text-secondary);
    white-space: nowrap;
}

/* ==========================================================================
   STEP LIST
   ========================================================================== */

.hm-profile-complete__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-profile-complete__step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

/* Completed step */
.hm-profile-complete__step--done {
    background: var(--hm-success-light);
}

.hm-profile-complete__step--done .hm-profile-complete__step-icon {
    color: var(--hm-success);
}

/* Incomplete step */
.hm-profile-complete__step--todo {
    background: var(--hm-neutral-50);
    border: 1px dashed var(--hm-neutral-200);
}

.hm-profile-complete__step--todo .hm-profile-complete__step-icon {
    color: var(--hm-neutral-400);
}

/* Step icon */
.hm-profile-complete__step-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.hm-profile-complete__step-icon svg {
    width: 20px;
    height: 20px;
}

/* Step text */
.hm-profile-complete__step-text {
    flex: 1;
    font-family: var(--font-body);
    font-size: var(--text-sm, 0.875rem);
    font-weight: 500;
    color: var(--hm-text);
    line-height: var(--leading-normal, 1.5);
}

.hm-profile-complete__step--done .hm-profile-complete__step-text {
    color: var(--hm-success-dark);
}

/* Earned tag */
.hm-profile-complete__earned {
    font-family: var(--font-body);
    font-size: var(--text-xs, 0.75rem);
    font-weight: 600;
    color: var(--hm-success);
    white-space: nowrap;
}

/* Action link */
.hm-profile-complete__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    font-size: var(--text-sm, 0.875rem);
    font-weight: 600;
    color: var(--hm-primary, var(--hm-primary));
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.hm-profile-complete__action:hover {
    color: var(--hm-primary-hover, var(--hm-primary-hover));
}

.hm-profile-complete__action svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   INLINE BIO FORM
   ========================================================================== */

.hm-profile-complete__bio-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

.hm-profile-complete__bio-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: var(--text-sm, 0.875rem);
    color: var(--hm-text);
    background: var(--hm-bg-elevated);
    border: 1px solid var(--hm-neutral-300);
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: var(--leading-normal, 1.5);
}

.hm-profile-complete__bio-textarea:focus {
    outline: none;
    border-color: var(--hm-primary, var(--hm-primary));
    box-shadow: 0 0 0 3px var(--hm-primary-muted);
}

.hm-profile-complete__bio-textarea::placeholder {
    color: var(--hm-text-muted);
}

.hm-profile-complete__bio-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.hm-profile-complete__bio-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: var(--font-body);
    font-size: var(--text-sm, 0.875rem);
    font-weight: 600;
    color: var(--hm-text-inverse);
    background: var(--hm-primary, var(--hm-primary));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.hm-profile-complete__bio-save:hover {
    background: var(--hm-primary-hover, var(--hm-primary-hover));
}

.hm-profile-complete__bio-save:active {
    transform: scale(0.97);
}

.hm-profile-complete__bio-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   FOOTER NOTE
   ========================================================================== */

.hm-profile-complete__footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--hm-neutral-100);
    font-family: var(--font-body);
    font-size: var(--text-xs, 0.75rem);
    color: var(--hm-text-muted);
    text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 479px) {
    .hm-profile-complete {
        padding: 16px;
        border-radius: var(--radius-md);
        margin-bottom: 16px;
    }

    .hm-profile-complete__step {
        padding: 8px 10px;
        gap: 8px;
    }

    .hm-profile-complete__bar-wrap {
        gap: 8px;
    }

    .hm-profile-complete__earned {
        display: none; /* Save space on mobile */
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hm-profile-complete__bar-fill {
        transition: none;
    }
}

@media (forced-colors: active) {
    .hm-profile-complete {
        border: 2px solid CanvasText;
    }

    .hm-profile-complete__step--done {
        background: Canvas;
        border: 1px solid CanvasText;
    }

    .hm-profile-complete__bar-fill {
        background: Highlight;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .hm-profile-complete {
        display: none;
    }
}
