/*
 * VGCSC Member Account Page
 * Colors:
 *   --vgcsc-navy  : #1C2C4C  (primary)
 *   --vgcsc-cyan  : #00d9de  (accent)
 *   --vgcsc-white : #ffffff  (surface)
 *   --vgcsc-grey  : #f4f6f8  (neutral background — WebAIM passes with navy)
 */

/* ── Reset & variables ───────────────────────────────────────────── */
.vgcsc-account,
.vgcsc-account * {
    box-sizing: border-box;
}

.vgcsc-account {
    --navy:       #1C2C4C;
    --cyan:       #00d9de;
    --white:      #ffffff;
    --grey:       #f4f6f8;
    --border:     #dce4ef;
    --text-muted: #5a6a8a;

    /* Status colours — WCAG AA on their respective backgrounds */
    --green:      #0b5e35;
    --green-bg:   #e4f5ec;
    --amber:      #6b4100;
    --amber-bg:   #fff3cc;
    --blue-dark:  #1a3a6b;
    --blue-bg:    #e6ecf8;
    --purple:     #4a1c7c;
    --purple-bg:  #f2eafa;

    --radius:     10px;
    --shadow:     0 2px 18px rgba(28, 44, 76, .11);
    --ease:       .18s ease;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--navy);
    max-width: 940px;
    margin: 0 auto;
    padding: 0 16px 56px;
}

/* ── Login gate ──────────────────────────────────────────────────── */
.vgcsc-account-gate {
    text-align: center;
    padding: 72px 24px;
    color: var(--navy);
}
.vgcsc-account-gate a {
    color: var(--navy);
    font-weight: 700;
    text-decoration: underline;
}

/* ── Header ──────────────────────────────────────────────────────── */
.vgcsc-account-header {
    display: flex;
    align-items: center;
    gap: 22px;
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px 32px;
}

.vgcsc-avatar-img {
    border-radius: 50%;
    border: 3px solid var(--cyan);
    width: 72px;
    height: 72px;
    object-fit: cover;
    flex-shrink: 0;
}

.vgcsc-account-identity {
    min-width: 0;
}

.vgcsc-account-name {
    margin: 0 0 3px;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.vgcsc-account-email {
    margin: 0;
    font-size: .9rem;
    color: rgba(255, 255, 255, .72);
}

.vgcsc-membership-badge {
    display: inline-block;
    margin-top: 9px;
    background: var(--cyan);
    color: var(--navy);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 3px 11px;
    border-radius: 20px;
}

/* ── Tab bar ─────────────────────────────────────────────────────── */
.vgcsc-account-tabs {
    display: flex;
    gap: 3px;
    background: #152238;          /* slightly darker navy for depth */
    padding: 0 10px 10px;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 30px;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.vgcsc-account-tabs::-webkit-scrollbar { display: none; }

.vgcsc-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .68);
    font-size: .88rem;
    font-weight: 500;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--ease), color var(--ease);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}

.vgcsc-tab:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--white);
}

.vgcsc-tab.active {
    background: var(--cyan);
    color: var(--navy);
    font-weight: 700;
}

.vgcsc-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .22);
    color: inherit;
    font-size: .68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
}
.vgcsc-tab.active .vgcsc-tab-count {
    background: rgba(28, 44, 76, .22);
}

/* ── Panels ──────────────────────────────────────────────────────── */
.vgcsc-panel {
    display: none;
    animation: vgcsc-fade-in .18s ease;
}
.vgcsc-panel.active {
    display: block;
}

@keyframes vgcsc-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.vgcsc-panel > h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 22px;
}

.vgcsc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.vgcsc-panel-header h2 { margin: 0; }

/* ── Dashboard: stat cards ───────────────────────────────────────── */
.vgcsc-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.vgcsc-stat-card {
    background: var(--white);
    border: 2px solid var(--cyan);
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.vgcsc-stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 7px;
}

.vgcsc-stat-label {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Dashboard membership strip */
.vgcsc-dash-membership {
    background: var(--grey);
    border-left: 4px solid var(--cyan);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 24px;
}
.vgcsc-dash-membership h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}
.vgcsc-membership-summary-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    font-size: .9rem;
    color: var(--navy);
}
.vgcsc-billing-start-notice {
    margin: 12px 0 0;
    padding: 12px 16px;
    background: #eafcfd;
    border-left: 4px solid #00d9de;
    border-radius: 4px;
    font-size: .88rem;
    line-height: 1.55;
    color: #0c3d54;
}
.vgcsc-billing-start-notice strong { color: #0c3d54; }
.vgcsc-billing-start-hint {
    font-size: .82rem;
    color: #5a7686;
}
.vgcsc-membership-level-name {
    font-weight: 700;
    background: var(--cyan);
    color: var(--navy);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.vgcsc-dash-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ── Post list ───────────────────────────────────────────────────── */
.vgcsc-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vgcsc-post-row {
    display: grid;
    grid-template-columns: 68px 1fr auto auto;
    align-items: center;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 18px;
    transition: box-shadow var(--ease), opacity var(--ease), transform var(--ease);
}
.vgcsc-post-row:hover {
    box-shadow: var(--shadow);
}
.vgcsc-post-row.vgcsc-row-trashing {
    opacity: 0;
    transform: translateX(-16px);
    pointer-events: none;
}

.vgcsc-post-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}
.vgcsc-post-img-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 7px;
    background: var(--grey);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--cyan);
}

.vgcsc-post-info { min-width: 0; }

.vgcsc-post-title {
    font-size: .96rem;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.vgcsc-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: .79rem;
    color: var(--text-muted);
}

/* ── Status badges ───────────────────────────────────────────────── */
.vgcsc-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.vgcsc-badge-published  { background: var(--green-bg);  color: var(--green);     }
.vgcsc-badge-pending    { background: var(--amber-bg);  color: var(--amber);     }
.vgcsc-badge-scheduled  { background: var(--blue-bg);   color: var(--blue-dark); }
.vgcsc-badge-private    { background: var(--purple-bg); color: var(--purple);    }
.vgcsc-badge-default    { background: var(--grey);      color: var(--text-muted);}

/* ── Action buttons ──────────────────────────────────────────────── */
.vgcsc-post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.vgcsc-action-btn {
    font-size: .79rem;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 6px;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: background var(--ease), color var(--ease), border-color var(--ease);
    display: inline-block;
    line-height: 1.45;
}

.vgcsc-action-view {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.vgcsc-action-view:hover {
    background: #2a3f68;
    color: var(--white);
    border-color: #2a3f68;
}

.vgcsc-action-edit {
    background: var(--white);
    color: var(--navy);
    border-color: var(--cyan);
}
.vgcsc-action-edit:hover {
    background: var(--cyan);
    color: var(--navy);
}

.vgcsc-action-trash {
    background: var(--white);
    color: #b02030;
    border-color: #e8b0b8;
}
.vgcsc-action-trash:hover   { background: #fde8eb; border-color: #c0293c; }
.vgcsc-action-trash:disabled { opacity: .45; cursor: not-allowed; }

/* ── Empty state ─────────────────────────────────────────────────── */
.vgcsc-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--grey);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.vgcsc-empty-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    color: var(--cyan);
    line-height: 1;
}
.vgcsc-empty-state p {
    color: var(--text-muted);
    font-size: .95rem;
    margin: 0 0 22px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.vgcsc-btn {
    display: inline-block;
    font-size: .9rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 7px;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
    line-height: 1.4;
    font-family: inherit;
}
.vgcsc-btn-primary {
    background: var(--cyan);
    color: var(--navy);
    border-color: var(--cyan);
}
.vgcsc-btn-primary:hover {
    background: #00bec3;
    border-color: #00bec3;
    color: var(--navy);
}
.vgcsc-btn-outline {
    background: transparent;
    border-color: var(--navy);
    color: var(--navy);
}
.vgcsc-btn-outline:hover {
    background: var(--navy);
    color: var(--white);
}
.vgcsc-btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.vgcsc-btn-ghost:hover {
    background: var(--grey);
    color: var(--navy);
}

/* ── Profile form ────────────────────────────────────────────────── */
.vgcsc-profile-form {
    max-width: 560px;
}

.vgcsc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.vgcsc-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.vgcsc-form-group label {
    font-size: .84rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}

.vgcsc-required-mark {
    color: #b02030;
    margin-left: 2px;
}

.vgcsc-input,
.vgcsc-textarea {
    border: 1.5px solid #c5d2e4;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: .94rem;
    color: var(--navy);
    background: var(--white);
    transition: border-color var(--ease), box-shadow var(--ease);
    width: 100%;
    font-family: inherit;
}
.vgcsc-input:focus,
.vgcsc-textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 217, 222, .18);
}
.vgcsc-textarea { resize: vertical; }

.vgcsc-form-divider {
    margin: 26px 0 10px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.vgcsc-form-divider h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--navy);
}
.vgcsc-form-hint {
    font-size: .81rem;
    color: var(--text-muted);
    margin: 0;
}

.vgcsc-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.vgcsc-save-status {
    font-size: .85rem;
    font-weight: 600;
}
.vgcsc-status-ok  { color: var(--green); }
.vgcsc-status-err { color: #b02030; }

/* ── Membership panel ────────────────────────────────────────────── */
.vgcsc-membership-card {
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 28px;
}

.vgcsc-membership-card-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.vgcsc-membership-level-icon { font-size: 1.6rem; color: var(--cyan); line-height: 1; }
.vgcsc-membership-level-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cyan);
}

.vgcsc-membership-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 22px;
}
.vgcsc-membership-table th,
.vgcsc-membership-table td {
    padding: 6px 18px 6px 0;
    font-size: .9rem;
    text-align: left;
    color: var(--white);
    border: none;
}
.vgcsc-membership-table th {
    color: rgba(255, 255, 255, .65);
    font-weight: 500;
    white-space: nowrap;
    width: 40%;
}

.vgcsc-membership-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.vgcsc-membership-links .vgcsc-btn-outline {
    border-color: var(--cyan);
    color: var(--cyan);
}
.vgcsc-membership-links .vgcsc-btn-outline:hover {
    background: var(--cyan);
    color: var(--navy);
}

.vgcsc-link-danger {
    font-size: .85rem;
    color: rgba(255, 255, 255, .55);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color var(--ease);
}
.vgcsc-link-danger:hover { color: #ff9aaa; }

/* Payment section */
.vgcsc-payment-section {
    background: var(--grey);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}
.vgcsc-payment-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--navy);
}

.vgcsc-payment-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.vgcsc-payment-icon { font-size: 2rem; flex-shrink: 0; color: var(--navy); }
.vgcsc-payment-details { flex: 1; min-width: 0; }
.vgcsc-card-type {
    margin: 0 0 2px;
    font-size: .95rem;
    color: var(--navy);
    font-weight: 500;
}
.vgcsc-card-exp {
    margin: 0;
    font-size: .81rem;
    color: var(--text-muted);
}
.vgcsc-payment-none {
    color: var(--text-muted);
    margin: 0 0 18px;
    font-size: .9rem;
}

/* ── Edit Modal ──────────────────────────────────────────────────── */
.vgcsc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 26, 46, .6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.vgcsc-modal-overlay.active { display: flex; }

body.vgcsc-modal-open { overflow: hidden; }

.vgcsc-modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(16, 26, 46, .3);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vgcsc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    background: var(--navy);
    flex-shrink: 0;
}
.vgcsc-modal-heading {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
}
.vgcsc-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .7);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}
.vgcsc-modal-close:hover { color: var(--white); }

.vgcsc-modal-body {
    padding: 24px 26px;
    overflow-y: auto;
    flex: 1;
}
.vgcsc-modal-body .vgcsc-form-group { margin-bottom: 18px; }

.vgcsc-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 26px;
    border-top: 1px solid var(--border);
    background: var(--grey);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.vgcsc-modal-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 36px 0;
    font-size: .95rem;
}

.vgcsc-error {
    color: #b02030;
    font-size: .9rem;
    text-align: center;
    padding: 20px 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .vgcsc-account-header {
        padding: 20px;
        gap: 14px;
    }
    .vgcsc-account-name { font-size: 1.25rem; }

    .vgcsc-post-row {
        grid-template-columns: 56px 1fr;
        grid-template-areas:
            "thumb info"
            "thumb status"
            "actions actions";
        row-gap: 8px;
    }
    .vgcsc-post-thumb   { grid-area: thumb; }
    .vgcsc-post-info    { grid-area: info; }
    .vgcsc-post-status  { grid-area: status; }
    .vgcsc-post-actions {
        grid-area: actions;
        justify-content: flex-start;
    }

    .vgcsc-form-row { grid-template-columns: 1fr; }

    .vgcsc-membership-card { padding: 22px 20px; }

    .vgcsc-stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .vgcsc-stat-grid { grid-template-columns: 1fr; }
    .vgcsc-account-header { flex-direction: column; text-align: center; }
}
