/*
 * profile-page.css
 * User Profile Dashboard — White & #c8102e
 * =========================================== */

/* ── Variables ── */
:root {
    --pr:           #c8102e;
    --pr-dark:      #a50d26;
    --pr-light:     rgba(200, 16, 46, .08);
    --pr-mid:       rgba(200, 16, 46, .15);

    --bg:           #f4f4f6;
    --surface:      #ffffff;
    --border:       #e8e8ec;
    --border-dark:  #d0d0d8;

    --text-1:       #18181c;
    --text-2:       #55556a;
    --text-3:       #9898aa;

    --sidebar-w:    240px;
    --content-max:  1366px;
    --radius:       10px;

    --font-head:    'DM Serif Display', 'Georgia', serif;
    --font-body:    'DM Sans', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
}

/* ── Reset ── */
.profile-page * { box-sizing: border-box; }
.profile-page { font-family: var(--font-body); background: var(--bg); min-height: 100vh; }

/* ── Google Fonts import (add to wp_head or @import in functions) ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap');

/* ══════════════════════════════════════════
   BANNER
══════════════════════════════════════════ */
.profile-banner {
    display: grid;
    background: var(--pr-dark);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(255,255,255,.12) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(0,0,0,.15) 0%, transparent 55%);
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 280px;
    justify-content: center;
    align-items: center;
}

/* Decorative circles */
.banner-circles {
    position: absolute; inset: 0; pointer-events: none;
}
.banner-circles span {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.12);
}
.banner-circles span:nth-child(1) { width: 220px; height: 220px; top: -80px; left: -60px; }
.banner-circles span:nth-child(2) { width: 160px; height: 160px; top: -20px; left: 80px; }
.banner-circles span:nth-child(3) { width: 300px; height: 300px; top: -120px; right: 200px; }
.banner-circles span:nth-child(4) { width: 180px; height: 180px; bottom: -80px; right: 60px; }

.profile-banner-inner {
    width: var(--content-max);
    margin: 0 auto;
    padding: 2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Avatar */
.profile-avatar-wrap {
    flex-shrink: 0;
}
.profile-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    display: block;
}

/* Identity */
.profile-identity {
    flex: 1;
    padding-bottom: 1rem;
    min-width: 0;
}
.profile-greeting {
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-role-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255,255,255,.2);
    color: #fff;
    border-radius: 20px;
    padding: .2em .75em;
    border: 1px solid rgba(255,255,255,.25);
}

/* Stats */
.profile-stats {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: .75rem 1.5rem;
    border: 1px solid rgba(255,255,255,.2);
    border-bottom: none;
    margin-left: auto;
    flex-shrink: 0;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: 0 1.25rem;
    color: #fff;
}
.stat-item svg { opacity: .8; }
.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    font-size: .72rem;
    opacity: .8;
    letter-spacing: .04em;
}
.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,.25);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════ */
.profile-main {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.profile-sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 90px;
    overflow: hidden;
}

/* Notice inside sidebar */
.sidebar-notice {
    font-size: .8rem;
    padding: .6rem .875rem;
    line-height: 1.4;
}
.sidebar-notice--success {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 1px solid #bbf7d0;
}
.sidebar-notice--error {
    background: #fff1f2;
    color: #9f1239;
    border-bottom: 1px solid #fecdd3;
}

/* Nav */
.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.nav-group {
    margin-bottom: .25rem;
}
.nav-group + .nav-group {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
}
.nav-group-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: .35rem 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
    cursor: pointer;
    background: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}
.nav-item:hover {
    background: var(--pr-light);
    color: var(--pr);
}
.nav-item.active {
    background: var(--pr-light);
    color: var(--pr);
    border-left-color: var(--pr);
    font-weight: 600;
}
.nav-item svg { flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }

/* Parent item with chevron */
.nav-item--parent { justify-content: flex-start; }
.nav-item--parent .chevron {
    margin-left: auto;
    transition: transform .2s;
}
.nav-item--parent.active .chevron { transform: rotate(180deg); }

/* Sub-nav */
.nav-item-group { position: relative; }
.nav-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.nav-sub.open { max-height: 120px; }

.nav-sub-item {
    display: block;
    padding: .5rem 1rem .5rem 2.75rem;
    font-size: .825rem;
    color: var(--text-2);
    text-decoration: none;
    transition: color .15s, background .15s;
    border-left: 3px solid transparent;
}
.nav-sub-item:hover { color: var(--pr); background: var(--pr-light); }
.nav-sub-item.active {
    color: var(--pr);
    font-weight: 600;
    border-left-color: var(--pr);
    background: var(--pr-light);
}

/* Sidebar footer */
.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid var(--border);
}
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .65rem 1rem;
    background: var(--pr);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .15s;
}
.btn-logout:hover { background: var(--pr-dark); transform: translateY(-1px); }
.btn-logout:active { transform: translateY(0); }

/* ══════════════════════════════════════════
   CONTENT PANEL
══════════════════════════════════════════ */
.profile-content { min-width: 0; }

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.profile-panel-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-1);
    margin: 0;
}
.panel-count {
    font-size: .8rem;
    color: var(--text-3);
    background: var(--bg);
    padding: .2em .7em;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.panel-body {
    padding: 1.5rem;
}
.panel-body--center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

/* ── Post List ── */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; padding-bottom: 0; }
.post-item-main { flex: 1; min-width: 0; }
.post-item-title {
    display: block;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text-1);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .3rem;
    transition: color .15s;
}
.post-item-title:hover { color: var(--pr); }
.post-item-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .775rem;
    color: var(--text-3);
}
.post-status {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .1em .55em;
    border-radius: 4px;
}
.post-status--publish { background: #dcfce7; color: #166534; }
.post-status--draft   { background: #fef9c3; color: #854d0e; }
.post-status--pending { background: #dbeafe; color: #1e40af; }

.post-item-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.post-action-btn {
    font-size: .775rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    padding: .3em .7em;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: color .15s, border-color .15s, background .15s;
}
.post-action-btn:hover {
    color: var(--pr);
    border-color: var(--pr);
    background: var(--pr-light);
}

/* ── Comment List ── */
.comment-list { display: flex; flex-direction: column; gap: 0; }
.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-item-author {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-1);
}
.comment-item-author img {
    border-radius: 50%;
    display: block;
}
.comment-item-body {
    font-size: .875rem;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: .4rem;
}
.comment-item-meta {
    display: flex;
    gap: 1rem;
    font-size: .775rem;
    color: var(--text-3);
}
.comment-item-meta a {
    color: var(--pr);
    text-decoration: none;
}
.comment-item-meta a:hover { text-decoration: underline; }

/* ── Empty State ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 3rem 1rem;
    color: var(--text-3);
    text-align: center;
}
.empty-state svg { opacity: .4; }
.empty-state p { font-size: .9rem; margin: 0; }

/* ── Coming Soon ── */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-3);
}
.coming-soon svg { opacity: .35; }
.coming-soon h3 { margin: 0; font-size: 1.1rem; color: var(--text-2); }
.coming-soon p  { margin: 0; font-size: .875rem; }

/* ── Profile Form ── */
.profile-form { display: flex; flex-direction: column; gap: 1.25rem; }
.profile-form--narrow { max-width: 440px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: .02em;
}
.label-note {
    font-weight: 400;
    color: var(--text-3);
    font-size: .75rem;
}
.form-input {
    height: 42px;
    padding: 0 1rem 0 2.875rem;
    border: 1.5px solid var(--border-dark);
    border-radius: 8px;
    font-size: .9rem;
    font-family: var(--font-body);
    color: var(--text-1);
    background: #fafafa;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-input:hover { border-color: #b0b0c0; }
.form-input:focus {
    border-color: var(--pr);
    background: #fff;
    box-shadow: 0 0 0 3px var(--pr-light);
}
.form-input--disabled {
    background: var(--bg);
    color: var(--text-3);
    cursor: not-allowed;
}
.form-textarea {
    padding: .625rem .875rem;
    border: 1.5px solid var(--border-dark);
    border-radius: 8px;
    font-size: .9rem;
    font-family: var(--font-body);
    color: var(--text-1);
    background: #fafafa;
    outline: none;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.55;
}
.form-textarea:hover { border-color: #b0b0c0; }
.form-textarea:focus {
    border-color: var(--pr);
    background: #fff;
    box-shadow: 0 0 0 3px var(--pr-light);
}
.form-hint {
    font-size: .775rem;
    color: var(--text-3);
}

/* Avatar upload section */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.avatar-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--pr);
    flex-shrink: 0;
}
.avatar-info { flex: 1; }
.avatar-note { font-size: .8rem; color: var(--text-2); margin: 0; line-height: 1.55; }
.avatar-note a { color: var(--pr); text-decoration: none; }
.avatar-note a:hover { text-decoration: underline; }

/* Save button */
.btn-save {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.5rem;
    background: var(--pr);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    align-self: flex-start;
}
.btn-save:hover {
    background: var(--pr-dark);
    box-shadow: 0 4px 14px rgba(200,16,46,.3);
    transform: translateY(-1px);
}
.btn-save:active { transform: translateY(0); }

/* Danger zone */
.danger-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .875rem;
    padding: 1.5rem;
    background: #fff8f8;
    border: 1.5px solid #fecdd3;
    border-radius: 10px;
}
.danger-icon {
    width: 56px; height: 56px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pr);
}
.danger-zone h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-1); }
.danger-zone p  { margin: 0; font-size: .875rem; color: var(--text-2); line-height: 1.6; }
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.25rem;
    background: var(--pr);
    color: #fff;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.btn-danger:hover { background: var(--pr-dark); }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: .35rem;
    margin-top: 1.25rem;
    justify-content: center;
}
.page-btn {
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: all .15s;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: .85rem;
    color: var(--text-3);
    letter-spacing: .05em;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.page-btn:hover { border-color: var(--pr); color: var(--pr); }
.page-btn.active {
    background: var(--pr);
    border-color: var(--pr);
    color: #fff;
    font-weight: 700;
}


/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .profile-banner-inner { flex-wrap: wrap; }
    .profile-stats { margin-left: 0; border-radius: var(--radius); margin-bottom: 1rem; }
}

@media (max-width: 768px) {
    .profile-main {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .profile-sidebar { position: static; }
    .form-row { grid-template-columns: 1fr; }
    .profile-banner-inner { padding: 1.5rem 1rem 0; }
    .profile-stats { width: 100%; justify-content: space-around; }
    .stat-item { padding: 0 .75rem; }
}

@media (max-width: 480px) {
    .profile-greeting { font-size: 1.1rem; }
    .panel-body { padding: 1rem; }
    .post-item { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .post-item-actions { align-self: flex-end; }
}

/* ── Password strength bar ── */
.pw-strength {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-top: .4rem;
}
.pw-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.pw-strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width .3s, background .3s;
}
.pw-strength-label {
    font-size: .72rem;
    font-weight: 600;
    min-width: 64px;
    text-align: right;
}

/* ── Public profile view ── */
.public-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    gap: .5rem;
}
.public-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--pr);
    margin-bottom: .5rem;
}
.public-name {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-1);
    margin: 0;
}
.public-bio {
    font-size: .9rem;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 480px;
    margin: .5rem 0 1rem;
}
.public-bio--empty { color: var(--text-3); font-style: italic; }
.public-stats {
    display: flex;
    gap: 2rem;
    margin-top: .5rem;
}
.pub-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
}
.pub-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pr);
}
.pub-stat-label {
    font-size: .75rem;
    color: var(--text-3);
    letter-spacing: .04em;
}
