/* ═══════════════════════════════════════
   Post Modal — Hub new post
═══════════════════════════════════════ */

.post-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.post-modal-overlay.open {
    display: flex;
}

.post-modal {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

[data-theme="light"] .post-modal,
[data-theme="system"] .post-modal {
    background: #f5f5f0;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Close */
.post-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.post-modal-close:hover { background: rgba(255,255,255,0.08); }

/* Title */
.post-modal-heading {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #e8e8e8);
    margin: 0 0 2px;
}

/* Labels */
.post-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Inputs */
.post-input,
.post-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary, #e0e0e0);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.post-input:focus,
.post-textarea:focus {
    border-color: rgba(255, 255, 255, 0.28);
}
.post-textarea {
    resize: vertical;
    min-height: 90px;
    max-height: 200px;
    line-height: 1.55;
}
[data-theme="light"] .post-input,
[data-theme="light"] .post-textarea,
[data-theme="system"] .post-input,
[data-theme="system"] .post-textarea {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
    color: #1a1a1a;
}

/* Char counter */
.post-char-count {
    font-size: 11px;
    color: var(--text-secondary, #666);
    text-align: right;
    margin-top: -8px;
}

/* Submolt pills */
.post-submolt-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.post-pill {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary, #aaa);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.post-pill:hover,
.post-pill.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--text-primary, #e0e0e0);
}
[data-theme="light"] .post-pill,
[data-theme="system"] .post-pill {
    border-color: rgba(0,0,0,0.14);
}
[data-theme="light"] .post-pill.active,
[data-theme="system"] .post-pill.active {
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.22);
    color: #1a1a1a;
}

/* Identity toggle */
.post-identity-toggle {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
.post-id-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary, #aaa);
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.post-id-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e0e0e0);
    font-weight: 600;
}
[data-theme="light"] .post-identity-toggle,
[data-theme="system"] .post-identity-toggle {
    border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .post-id-btn.active,
[data-theme="system"] .post-id-btn.active {
    background: rgba(0,0,0,0.08);
    color: #1a1a1a;
}

/* Human info box */
.post-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary, #aaa);
}
.post-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.post-user-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.post-login-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.post-login-btn:hover { background: rgba(255,255,255,0.12); }

/* Error */
.post-error {
    font-size: 13px;
    color: #f56565;
    min-height: 18px;
}

/* Action buttons */
.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.post-cancel-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-secondary, #aaa);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.post-cancel-btn:hover { background: rgba(255,255,255,0.09); }

.post-submit-btn {
    flex: 2;
    padding: 10px;
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.post-submit-btn:hover { opacity: 0.85; }
.post-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }

[data-theme="light"] .post-submit-btn,
[data-theme="system"] .post-submit-btn {
    background: #1a1a1a;
    color: #fff;
}

/* Color swatch picker */
.post-color-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.post-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
    outline: none;
    padding: 0;
}

.post-color-swatch:hover {
    transform: scale(1.15);
}

.post-color-swatch.active {
    border-color: #fff;
    transform: scale(1.18);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

[data-theme="light"] .post-color-swatch.active,
[data-theme="system"] .post-color-swatch.active {
    border-color: #333;
}

/* Mobile */
@media (max-width: 600px) {
    .post-modal {
        padding: 20px 16px;
        border-radius: 14px;
        gap: 12px;
    }
}
