/* =============================================================================
   profile-hero.css - Combined identity + ship + loadout hero on the profile page.
   Replaces the old pp-ph and sp-hero sections.
   ============================================================================= */

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes ph-fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes ph-barGrow {
    from {
        width: 0;
    }
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.ph-wrap {
    border: 1px solid rgba(200, 168, 75, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
}

/* ── Identity strip ──────────────────────────────────────────────────────── */
.ph-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px;
    border-bottom: 1px solid rgba(200, 168, 75, 0.06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    position: relative; /* anchor for the absolute-positioned edit button */
}
.ph-identity-body {
    flex: 1;
    min-width: 0;
}
.ph-meta-row {
    font-size: var(--font-size-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.ph-identity-body > .ph-meta-row:first-child {
    font-size: var(--font-size-base);
}
.ph-identity-body:has(.ph-name-row--with-guild) .ph-meta-row {
    margin-left: -1px;
}
.ph-title {
    color: var(--text-tertiary);
}
.ph-accent {
    color: var(--text-primary);
}
.ph-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0.2rem;
    --ph-name-size: var(--font-size-3xl);
}
.ph-name-row--with-guild {
    margin-left: -3px;
}
.ph-name-row--with-guild .ph-name {
    margin-left: -5px;
}
.ph-name {
    font-family: var(--font-body);
    font-size: var(--ph-name-size);
    font-weight: bold;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.15;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-guild-tag {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: var(--ph-name-size);
    color: var(--text-muted);
    text-transform: uppercase;
}
.ph-guild-tag--link {
    cursor: pointer;
}
.ph-guild-tag--link:hover {
    color: var(--gold);
}
.ph-chart-ref {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-meta-row--detail {
    color: var(--text-secondary);
}
.ph-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.ph-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    position: absolute;
    top: 14px;
    right: 14px;
    transform: none;
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(200, 168, 75, 0.06);
    border: 1px solid rgba(200, 168, 75, 0.15);
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
}
.ph-edit-btn:hover:not(:disabled) {
    background: rgba(200, 168, 75, 0.12);
    border-color: rgba(200, 168, 75, 0.3);
}
.ph-edit-btn:disabled {
    opacity: 0.45;
    cursor: default;
}
.ph-edit-btn svg,
.ph-edit-btn img {
    opacity: 0.7;
    flex-shrink: 0;
}
.ph-actions--other {
    position: absolute;
    top: 14px;
    right: 14px;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: 0;
}
.ph-actions--other .ph-action-btn,
.ph-actions--other .ph-more-btn {
    position: static;
    transform: none;
}
.ph-more-btn {
    min-width: 34px;
    padding: 5px 10px;
    justify-content: center;
    letter-spacing: 0.12em;
}
.ph-more-wrap {
    position: relative;
    flex-shrink: 0;
}

/* ── Portrait ────────────────────────────────────────────────────────────── */
.ph-portrait {
    width: 90px;
    height: 90px;
    border: 2px solid rgba(200, 168, 75, 0.3);
    background: var(--surface-base);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(200, 168, 75, 0.08);
}
.ph-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-portrait--sm {
    width: 36px;
    height: 36px;
}

/* ── Status badge ────────────────────────────────────────────────────────── */
.ph-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.ph-status--online {
    background: rgba(74, 153, 74, 0.12);
    color: #5cb85c;
    border: 1px solid rgba(74, 153, 74, 0.2);
    margin-left: 5px;
}
.ph-status--online::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5cb85c;
}
.ph-status--training {
    background: rgba(200, 168, 75, 0.08);
    color: var(--gold);
    border: 1px solid rgba(200, 168, 75, 0.15);
}
.ph-status--offline {
    background: rgba(100, 100, 100, 0.1);
    color: #777;
    border: 1px solid rgba(100, 100, 100, 0.15);
}

/* ── Ship + spec hero grid ───────────────────────────────────────────────── */
.ph-hero {
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    position: relative;
    animation: ph-fadeUp 0.5s ease both;
}
.ph-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(200, 168, 75, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgb(9 15 20) 0%, transparent 50%), #0d1015;
}
.ph-hero > * {
    position: relative;
    z-index: 1;
}

/* Ship column */
.ph-ship-col {
    flex: 1 1 340px;
    max-width: 350px;
    position: relative;
    min-height: 250px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}
/* Portrait wrapper - establishes the containing block for the absolute ship image.
   flex: 1 fills all column space above the bars. */
.ph-ship-portrait {
    position: relative;
    flex: 1;
}
.ph-ship-img {
    position: absolute;
    top: -18%;
    left: 7%;
    width: 88%;
    height: calc(100% + 20px);
    object-fit: contain;
    object-position: center bottom;
    transform: rotate(180deg) scale(1.35);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7)) brightness(0.8);
    pointer-events: none;
}
.ph-bars {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    top: -53px;
    width: 90%;
    margin-left: 6%;
}
.ph-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ph-bar-label {
    font-size: var(--font-size-base);
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    width: 4.5rem;
    flex-shrink: 0;
}
.ph-bar-track {
    flex: 1;
    height: 7px;
    background: rgb(26 31 35);
    border-radius: 2px;
    overflow: hidden;
}
.ph-bar-value {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    width: 25px;
    text-align: right;
    flex-shrink: 0;
}

/* Info + spec column */
.ph-info-col {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0px;
    gap: 6px;
    min-width: 0;
}
.ph-ship-class {
    font-size: var(--font-size-base);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ph-ship-name {
    font-family: var(--font-body);
    font-size: var(--font-size-3xl);
    font-weight: bold;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    margin: 0 0 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-ship-name-edit {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}
.ph-ship-name-input {
    font-family: var(--font-body);
    font-size: var(--font-size-xl);
    font-weight: bold;
    color: var(--gold);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: 100%;
    max-width: 260px;
}
.ph-meta {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-spec-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 16px;
    font-size: var(--font-size-base);
}
.ph-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid rgba(200, 168, 75, 0.04);
}
.ph-spec-label {
    color: var(--text-muted);
}
.ph-spec-value {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

/* ── Loadout dock ────────────────────────────────────────────────────────── */
.ph-lo-dock {
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(200, 168, 75, 0.08);
    padding: 14px 20px;
    gap: 16px;
    background: rgba(200, 168, 75, 0.015);
}
.ph-lo-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    flex-shrink: 0;
}
.ph-lo-slots {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
/* Sizing + clickability hook - visual styles come from sp-hold-slot */
.ph-lo-slot {
    width: 10rem;
    cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 740px) {
    .ph-identity {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    .ph-actions--other {
        position: static;
        transform: none;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .ph-meta-row {
        font-size: var(--font-size-xs);
        letter-spacing: 0.1em;
    }
    .ph-identity-body > .ph-meta-row:first-child {
        font-size: var(--font-size-base);
    }
    .ph-name-row {
        --ph-name-size: var(--font-size-xl);
        flex-wrap: wrap;
        gap: 4px;
    }
    .ph-name {
        font-size: var(--ph-name-size);
    }
    .ph-chart-ref {
    }
    .ph-ship-col {
        min-height: 200px;
        max-width: none;
    }
    .ph-ship-img {
        left: 10%;
        width: 80%;
        transform: rotate(180deg) scale(1.2);
    }
    .ph-bars {
        top: -40px;
        width: 80%;
        margin-left: 10%;
    }
    .ph-info-col {
        padding: 16px;
    }
    .ph-ship-name {
        font-size: var(--font-size-2xl);
    }
    .ph-lo-dock {
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px;
        align-items: flex-start;
    }
}
@media (max-width: 480px) {
    .ph-identity {
        padding: 10px 12px;
        gap: 8px;
    }
    .ph-meta-row {
        font-size: var(--font-size-xs);
    }
    .ph-identity-body > .ph-meta-row:first-child {
        font-size: var(--font-size-base);
    }
    .ph-name-row {
        --ph-name-size: var(--font-size-lg);
    }
    .ph-name {
        font-size: var(--ph-name-size);
    }
    .ph-ship-col {
        min-height: 180px;
        padding: 12px;
    }
    .ph-ship-img {
        left: 15%;
        width: 70%;
    }
    .ph-bars {
        width: 70%;
        margin-left: 15%;
        top: -30px;
    }
    .ph-bar-label {
        font-size: var(--font-size-xs);
        width: 4.5rem;
    }
    .ph-bar-value {
        font-size: var(--font-size-xs);
        width: 40px;
    }
    .ph-info-col {
        padding: 12px;
    }
    .ph-ship-class {
        font-size: var(--font-size-xs);
        letter-spacing: 0.1em;
    }
    .ph-ship-name {
        font-size: var(--font-size-xl);
    }
    .ph-spec-grid {
        font-size: var(--font-size-xs);
    }
}
