/* ===== Makhluot Social Engagement CSS ===== */

/* ============ COMMENTS ============ */
.ms-comments-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, #2a2a3e);
}
.ms-comments-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary, #fff);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ms-comments-title i { color: var(--c-primary, #6c5ce7); }
.ms-comments-count { color: var(--text-tertiary, #666); font-size: 0.85rem; }

/* Comment Form */
.ms-comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.ms-form-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.ms-form-input-wrap { flex: 1; }
.ms-comment-input, .ms-reply-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface, #0a0a12);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 12px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    max-height: 150px;
    outline: none;
    transition: border-color 0.2s;
}
.ms-comment-input:focus, .ms-reply-input:focus {
    border-color: var(--c-primary, #6c5ce7);
}
.ms-comment-submit, .ms-reply-submit {
    margin-top: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.ms-comment-submit:hover, .ms-reply-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,92,231,0.3);
}
.ms-reply-cancel {
    margin-top: 8px;
    margin-right: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    color: var(--text-secondary, #b0b0c0);
    font-size: 0.82rem;
    cursor: pointer;
}

/* Comment Item */
.ms-comment {
    margin-bottom: 16px;
}
.ms-comment-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.ms-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.ms-comment-body {
    flex: 1;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 12px;
    padding: 12px 14px;
}
.ms-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.ms-comment-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}
.ms-comment-date {
    font-size: 0.7rem;
    color: var(--text-tertiary, #666);
}
.ms-comment-text {
    font-size: 0.88rem;
    color: var(--text-secondary, #b0b0c0);
    line-height: 1.5;
}
.ms-comment-pending {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #f39c12;
    font-weight: 600;
}
.ms-reply-btn {
    background: none;
    border: none;
    color: var(--c-primary, #6c5ce7);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    padding: 0;
}
.ms-comment.ms-pending { opacity: 0.6; }

/* Threaded replies */
.ms-comment-replies {
    margin-top: 12px;
    padding-right: 20px;
    border-right: 2px solid var(--border-color, #2a2a3e);
}
[dir="ltr"] .ms-comment-replies {
    padding-right: 0;
    padding-left: 20px;
    border-right: none;
    border-left: 2px solid var(--border-color, #2a2a3e);
}

/* Reply form */
.ms-reply-form {
    margin-top: 10px;
}
.ms-reply-actions { display: flex; gap: 8px; }

/* Login prompt */
.ms-login-prompt {
    padding: 16px;
    text-align: center;
    background: var(--bg-card, #1e1e2e);
    border: 1px dashed var(--border-color, #2a2a3e);
    border-radius: 12px;
    color: var(--text-secondary, #b0b0c0);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}
.ms-login-prompt:hover {
    border-color: var(--c-primary, #6c5ce7);
    color: var(--c-primary, #6c5ce7);
}

.ms-no-comments {
    text-align: center;
    color: var(--text-tertiary, #666);
    padding: 20px;
    font-size: 0.9rem;
}

/* ============ REACTIONS ============ */
.ms-reactions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 14px 18px;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 14px;
}
.ms-reactions-btns {
    display: flex;
    gap: 6px;
}
.ms-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-surface, #0a0a12);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary, #b0b0c0);
    font-size: 0.8rem;
}
.ms-react-btn:hover {
    border-color: var(--c-primary, #6c5ce7);
    transform: translateY(-2px);
}
.ms-react-btn.ms-active {
    background: rgba(108,92,231,0.15);
    border-color: var(--c-primary, #6c5ce7);
}
.ms-react-emoji {
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.ms-react-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}
.ms-reactions-total {
    font-size: 0.75rem;
    color: var(--text-tertiary, #666);
    margin-right: auto;
}
[dir="ltr"] .ms-reactions-total { margin-right: 0; margin-left: auto; }

/* ============ FAVORITES ============ */
.ms-fav-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    backdrop-filter: blur(4px);
}
[dir="rtl"] .ms-fav-btn { left: auto; right: 10px; }
.ms-fav-btn:hover { transform: scale(1.15); }
.ms-fav-btn.ms-fav-active {
    background: rgba(108,92,231,0.8);
    color: #ffd700;
}

/* Favorites Page */
.ms-favorites-page {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 16px;
}
.ms-fav-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary, #fff);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ms-fav-title i { color: #ffd700; }

.ms-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.ms-fav-card {
    position: relative;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.ms-fav-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.ms-fav-card-link { display: block; text-decoration: none; }
.ms-fav-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.ms-fav-info { padding: 14px; }
.ms-fav-cat {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--c-primary, #6c5ce7);
    text-transform: uppercase;
}
.ms-fav-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 6px 0 0;
    line-height: 1.4;
}
.ms-fav-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(231,76,60,0.8);
    border: none;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
[dir="rtl"] .ms-fav-remove { right: auto; left: 10px; }
.ms-fav-card:hover .ms-fav-remove { opacity: 1; }

/* Empty state */
.ms-empty-state {
    text-align: center;
    padding: 60px 20px;
}
.ms-empty-icon { font-size: 3rem; margin-bottom: 16px; }
.ms-empty-state h2 { color: var(--text-primary, #fff); font-size: 1.2rem; margin-bottom: 8px; }
.ms-empty-state p { color: var(--text-secondary, #b0b0c0); font-size: 0.9rem; margin-bottom: 20px; }
.ms-browse-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.ms-browse-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,92,231,0.4); }

/* ============ SCROLL ANIMATIONS ============ */
.ms-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.ms-animate.ms-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.ms-animate:nth-child(2) { transition-delay: 0.08s; }
.ms-animate:nth-child(3) { transition-delay: 0.16s; }
.ms-animate:nth-child(4) { transition-delay: 0.24s; }
.ms-animate:nth-child(5) { transition-delay: 0.32s; }
.ms-animate:nth-child(6) { transition-delay: 0.4s; }
.ms-animate:nth-child(7) { transition-delay: 0.48s; }
.ms-animate:nth-child(8) { transition-delay: 0.56s; }

/* Post card hover enhancement */
.post-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}
.post-card:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3) !important;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ms-animate { opacity: 1; transform: none; transition: none; }
    .post-card:hover { transform: none !important; }
    html { scroll-behavior: auto; }
}

/* Mobile */
@media (max-width: 600px) {
    .ms-reactions-bar { flex-wrap: wrap; padding: 10px 12px; }
    .ms-react-btn { padding: 6px 10px; font-size: 0.75rem; }
    .ms-comment-avatar { width: 30px; height: 30px; }
    .ms-comment-replies { padding-right: 12px; }
    .ms-fav-grid { grid-template-columns: 1fr; }
}
