/* ============================================================
   edit-post.css — Modal Edit Postingan
   Background mengikuti var(--bg-body) & var(--bg-card) dari style.css
   Mendukung dark mode & light mode secara otomatis via CSS variable
   ============================================================ */

/* === OVERLAY === */
#edit-post-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.60);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
#edit-post-modal.active {
    display: flex;
}

/* === PANEL === */
.edit-post-panel {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.edit-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-body);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}
.edit-post-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
}
.edit-post-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.edit-post-close-btn:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}
.edit-post-save-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.edit-post-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.edit-post-save-btn:not(:disabled):hover {
    opacity: 0.85;
}

/* === BODY === */
.edit-post-body {
    padding: 16px;
    flex: 1;
}

/* Textarea edit postingan */
#edit-post-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    resize: vertical;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
#edit-post-textarea:focus {
    border-color: var(--primary-color);
}

/* Counter karakter */
.edit-post-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.edit-post-counter.warn {
    color: #E2B719;
}
.edit-post-counter.danger {
    color: #f91880;
}

/* Label "(edited)" pada post yang sudah diedit */
.post-edited-tag {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
    font-style: italic;
    opacity: 0.75;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .edit-post-panel {
        border-radius: 12px;
        max-height: 85vh;
    }
    #edit-post-textarea {
        font-size: 14px;
        min-height: 100px;
    }
}