/* ==========================================
   LOSTVERSE
   MY POSTS STYLESHEET
   Personal Post Management
========================================== */

/* ==========================================
   01. PAGE FOUNDATION
========================================== */

.my-posts-page {
    min-height: 100vh;
    background: var(--bg, #f0f4fc);
    color: var(--navy, #101a30);
}

.my-posts-page [hidden] {
    display: none !important;
}

/* ==========================================
   02. POST STATISTICS
========================================== */

.my-post-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 16px;
    margin: 28px 0;
}

.stat-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 124px;

    gap: 12px;
    padding: 22px;

    background: #ffffff;

    border: 1px solid #dbe3ee;
    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(15, 23, 42, .03);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.stat-card:hover {
    border-color: #b8c8df;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.stat-card span {
    color: #64748b;

    font-size: 13px;
    font-weight: 500;

    overflow-wrap: anywhere;
}

.stat-card strong {
    display: block;

    color: #142b4b;

    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;

    font-variant-numeric: tabular-nums;
}

#stat-total {
    color: #142b4b;
}

#stat-active {
    color: #2563eb;
}

#stat-resolved {
    color: #15803d;
}

#stat-closed {
    color: #64748b;
}

/* ==========================================
   03. POST STATUS FILTERS
========================================== */

.my-post-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
    margin-bottom: 24px;
}

.my-post-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    min-height: 40px;

    padding: 10px 18px;

    border: 1px solid #dbe3ee;
    border-radius: 8px;

    background: #ffffff;
    color: #64748b;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}

.my-post-tabs button:not(:disabled):hover {
    background: #eff6ff;
    color: #2456b8;
    border-color: #bfdbfe;
}

.my-post-tabs button.selected,
.my-post-tabs button[aria-pressed="true"] {
    background: #2456b8;
    color: #ffffff;

    border-color: #2456b8;

    font-weight: 600;
}

.my-post-tabs button.selected:hover,
.my-post-tabs button[aria-pressed="true"]:hover {
    background: #19469f;
    color: #ffffff;
}

.my-post-tabs button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.my-post-tabs button:focus-visible {
    outline: 3px solid #93b4ed;
    outline-offset: 3px;
}

/* ==========================================
   04. PERSONAL POST GRID
========================================== */

.my-posts-page #cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;

    align-items: stretch;
}

.my-posts-page #cards > * {
    min-width: 0;
}

.my-posts-page #cards .item {
    min-width: 0;
}

.my-posts-page #cards .item h3,
.my-posts-page #cards .item p {
    overflow-wrap: anywhere;
}

/* ==========================================
   05. POST STATUS LABELS
========================================== */

.post-status-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    width: fit-content;
    max-width: 100%;

    margin: 5px 0;
    padding: 5px 9px;

    border: 1px solid transparent;
    border-radius: 6px;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.post-status-label.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}

.post-status-label.resolved {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.post-status-label.closed {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.post-status-label svg {
    width: 13px;
    height: 13px;

    flex-shrink: 0;
}

/* ==========================================
   06. SEARCH & RESULT COUNT
========================================== */

.my-posts-page #search {
    min-width: 0;
}

.my-posts-page #search input {
    min-width: 0;
}

.my-posts-page #result-count {
    color: #64748b;

    font-size: 13px;
    font-weight: 400;

    font-variant-numeric: tabular-nums;
}

/* ==========================================
   07. EMPTY STATE
========================================== */

.my-posts-page #empty {
    min-height: 180px;

    padding: 40px 20px;

    color: #64748b;

    text-align: center;
    line-height: 1.8;
}

.my-posts-page #empty svg {
    width: 42px;
    height: 42px;

    margin-bottom: 10px;

    color: #94a3b8;
}

.my-posts-page #empty h3 {
    margin: 8px 0;

    color: #17233d;

    font-size: 16px;
    font-weight: 600;
}

.my-posts-page #empty p {
    margin: 0;

    font-size: 13px;
}

/* ==========================================
   08. POST MANAGEMENT MESSAGES
========================================== */

.my-posts-page #edit-error,
.my-posts-page #report-error {
    color: #b91c1c;

    font-size: 13px;
    line-height: 1.7;

    overflow-wrap: anywhere;
}

/* ==========================================
   09. TABLET RESPONSIVE
========================================== */

@media (max-width: 1000px) {

    .my-post-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

    .my-posts-page #cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 16px;
    }

    .stat-card {
        min-height: 110px;
        padding: 20px;
    }

}

/* ==========================================
   10. MOBILE RESPONSIVE
========================================== */

@media (max-width: 600px) {

    .my-post-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
        margin: 20px 0;
    }

    .stat-card {
        min-height: 100px;

        gap: 8px;
        padding: 16px;
    }

    .stat-card span {
        font-size: 12px;
    }

    .stat-card strong {
        font-size: 28px;
    }

    .my-post-tabs {
        gap: 6px;
        margin-bottom: 18px;
    }

    .my-post-tabs button {
        min-height: 38px;

        padding: 9px 12px;

        font-size: 12px;
    }

    .my-posts-page #cards {
        grid-template-columns: 1fr;

        gap: 14px;
    }

    .my-posts-page #search {
        flex-wrap: wrap;
    }

    .my-posts-page #search input {
        flex: 1 1 100%;
        width: 100%;
    }

    .my-posts-page #search select {
        flex: 1 1 120px;
        width: auto;
    }

    .my-posts-page #search button {
        width: auto;
    }

    .my-posts-page #result-count {
        font-size: 12px;
    }

}

/* ==========================================
   11. SMALL MOBILE
========================================== */

@media (max-width: 360px) {

    .stat-card {
        padding: 12px;
    }

    .stat-card strong {
        font-size: 24px;
    }

    .my-post-tabs button {
        flex: 1 1 calc(50% - 6px);
    }

}

/* ==========================================
   12. ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {

    .stat-card,
    .my-post-tabs button {
        transition: none;
    }

}