/**
 * Community — Styles
 *
 * @package DivinationChaloce\Core
 *
 * ⚠️ نکته مهم:
 * این فایل هم نام‌گذاری جدید (BEM: dc-community__xxx) و
 * هم نام‌گذاری قدیمی (dc-community-xxx) را پشتیبانی می‌کند.
 * بنابراین با هر دو ساختار HTML سازگار است.
 */

/* ============================================================
 * Community Wrapper
 * ============================================================ */

.dc-community-wrapper,
.dc-community,
.dc-community-page {
    background: #f7f7f9;
    padding: 30px 20px;
    min-height: 70vh;
}

/* ============================================================
 * Container / Layout
 * ============================================================ */

.dc-community-container,
.dc-community__layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

@media (max-width: 900px) {
    .dc-community-container,
    .dc-community__layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
 * Main Column
 * ============================================================ */

.dc-community-main,
.dc-community__main,
.dc-community__main-col {
    min-width: 0;
}

/* ============================================================
 * Sidebar
 * ============================================================ */

.dc-community-sidebar,
.dc-community__sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* ============================================================
 * Hero
 * ============================================================ */

.dc-community__hero {
    margin-bottom: 24px;
}

.dc-community__hero-inner {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dc-community__hero h1,
.dc-community__hero-inner h1 {
    font-size: 28px;
    margin: 0 0 8px;
    color: #222;
    font-weight: 700;
}

.dc-community__hero p,
.dc-community__hero-inner p {
    color: #666;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================================
 * Tabs
 * ============================================================ */

.dc-community-tabs,
.dc-community__tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.dc-community-tabs a,
.dc-community__tabs a {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
}

.dc-community-tabs a:hover,
.dc-community__tabs a:hover {
    background: #f7f7f9;
    color: #222;
}

.dc-community-tabs a.is-active,
.dc-community__tabs a.is-active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

/* ============================================================
 * Composer (Note Creator)
 * ============================================================ */

.dc-composer,
.dc-note-composer {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dc-composer-form,
.dc-note-composer form {
    display: flex;
    gap: 14px;
}

.dc-composer-avatar,
.dc-note-composer__avatar {
    flex-shrink: 0;
}

.dc-composer-avatar img,
.dc-note-composer__avatar img {
    border-radius: 50%;
    display: block;
}

.dc-composer-body,
.dc-note-composer__body {
    flex: 1;
    min-width: 0;
}

.dc-composer-body textarea,
.dc-note-composer__body textarea {
    width: 100%;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.dc-composer-body textarea:focus,
.dc-note-composer__body textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dc-composer-actions,
.dc-note-composer__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.dc-composer-visibility {
    display: flex;
    gap: 8px;
}

.dc-composer-visibility label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    transition: all 0.15s;
}

.dc-composer-visibility label:hover {
    border-color: #999;
}

.dc-composer-visibility input[type="radio"] {
    display: none;
}

.dc-composer-visibility input[type="radio"]:checked + span {
    color: #6366f1;
    font-weight: 600;
}

.dc-composer-visibility label:has(input:checked) {
    border-color: #6366f1;
    background: #f0f0ff;
}

/* ============================================================
 * Note Card
 * ============================================================ */

.dc-note {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
    animation: dcFadeIn 0.3s ease;
}

.dc-note:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

@keyframes dcFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dc-note-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dc-note-avatar img {
    border-radius: 50%;
    display: block;
}

.dc-note-author {
    flex: 1;
    min-width: 0;
}

.dc-note-name {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    margin-bottom: 2px;
}

.dc-note-name:hover {
    color: #6366f1;
}

.dc-note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #999;
    align-items: center;
}

.dc-note-visibility {
    font-size: 11px;
    padding: 1px 6px;
    background: #f0f0f5;
    border-radius: 6px;
}

.dc-note-type-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 6px;
    font-weight: 500;
    text-transform: uppercase;
}

.dc-note-type-expert {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.dc-note-menu {
    margin-inline-start: auto;
}

.dc-note-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.dc-note-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.dc-note-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 14px;
    word-wrap: break-word;
}

.dc-note-content p {
    margin: 0 0 12px;
}

.dc-note-content p:last-child {
    margin-bottom: 0;
}

/* ============================================================
 * Note Footer (Actions)
 * ============================================================ */

.dc-note-footer {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f5;
}

.dc-note-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.dc-note-action:hover {
    background: #f7f7f9;
    color: #222;
}

.dc-note-like-btn.is-liked {
    color: #ef4444;
}

.dc-note-like-btn.is-liked .dc-icon {
    animation: dcHeartPop 0.3s ease;
}

@keyframes dcHeartPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.dc-icon {
    font-size: 16px;
    line-height: 1;
}

/* ============================================================
 * Note Comments
 * ============================================================ */

.dc-note-comments-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f5;
}

.dc-note-comments-list {
    margin-bottom: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.dc-note-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.dc-note-comment:last-child {
    border-bottom: none;
}

.dc-comment-avatar img {
    border-radius: 50%;
    display: block;
}

.dc-comment-body {
    flex: 1;
    min-width: 0;
}

.dc-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}

.dc-comment-header a {
    color: #222;
    text-decoration: none;
    font-weight: 600;
}

.dc-comment-header time {
    color: #999;
    font-size: 11px;
}

.dc-comment-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    word-wrap: break-word;
}

.dc-comment-content p {
    margin: 0;
}

.dc-note-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.dc-note-comment-form textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.dc-note-comment-form textarea:focus {
    outline: none;
    border-color: #6366f1;
}

/* ============================================================
 * Badge
 * ============================================================ */

.dc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

.dc-badge-expert {
    background: #3b82f6;
}

.dc-badge-counselor {
    background: #3b82f6;
}

/* ============================================================
 * Profile Cards (Members List)
 * ============================================================ */

.dc-members-grid,
.dc-profile-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dc-profile-card,
.dc-member-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dc-profile-card:hover,
.dc-member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.dc-profile-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px;
    text-align: center;
}

.dc-profile-card-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.dc-profile-card-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
}

.dc-profile-card-badge {
    position: absolute;
    bottom: 2px;
    inset-inline-end: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid #fff;
    background: #3b82f6;
}

.dc-profile-card-body h3,
.dc-member-card h3 {
    font-size: 15px;
    margin: 0 0 6px;
    color: #222;
    font-weight: 600;
}

.dc-profile-card-expertise {
    font-size: 12px;
    color: #999;
    margin: 0 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dc-profile-card-type {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 6px;
    margin-bottom: 8px;
}

.dc-profile-card-stats {
    font-size: 12px;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #f0f0f5;
}

/* ============================================================
 * Members Filter
 * ============================================================ */

.dc-members-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dc-members-filter a {
    padding: 8px 16px;
    background: #fff;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    border: 1px solid #eaeaea;
    transition: all 0.15s;
}

.dc-members-filter a:hover {
    border-color: #999;
}

.dc-members-filter a.is-active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* ============================================================
 * Activity Feed
 * ============================================================ */

.dc-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dc-activity-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    transition: all 0.15s;
}

.dc-activity-item:hover {
    background: #fafafa;
}

.dc-activity-avatar img {
    border-radius: 50%;
}

.dc-activity-body {
    flex: 1;
    min-width: 0;
}

.dc-activity-text {
    font-size: 14px;
    color: #444;
    margin: 0 0 4px;
    line-height: 1.6;
}

.dc-activity-text a {
    color: #6366f1;
    text-decoration: none;
}

.dc-activity-text a:hover {
    text-decoration: underline;
}

.dc-activity-time {
    font-size: 12px;
    color: #999;
}

/* ============================================================
 * Sidebar Widgets / Cards
 * ============================================================ */

.dc-sidebar-widget,
.dc-sidebar-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dc-sidebar-widget h3,
.dc-sidebar-card h4,
.dc-sidebar-card__title {
    font-size: 14px;
    color: #222;
    margin: 0 0 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dc-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dc-sidebar-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.dc-sidebar-list li:last-child {
    border-bottom: none;
}

.dc-sidebar-list img {
    border-radius: 50%;
    flex-shrink: 0;
}

.dc-sidebar-list a {
    font-size: 13px;
    color: #333;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dc-sidebar-list a:hover {
    color: #6366f1;
}

/* ============================================================
 * Sidebar Profile Card
 * ============================================================ */

.dc-sidebar-profile {
    text-align: center;
}

.dc-sidebar-profile__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: block;
}

.dc-sidebar-profile__name {
    font-size: 16px;
    margin: 0 0 4px;
    color: #222;
    font-weight: 700;
}

.dc-sidebar-profile__name a {
    color: inherit;
    text-decoration: none;
}

.dc-sidebar-profile__name a:hover {
    color: #6366f1;
}

.dc-sidebar-profile__username {
    font-size: 13px;
    color: #999;
    margin: 0 0 14px;
}

.dc-sidebar-profile__stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
}

.dc-sidebar-profile__stats a {
    text-decoration: none;
    color: #666;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dc-sidebar-profile__stats strong {
    font-size: 18px;
    color: #6366f1;
    font-weight: 700;
}

/* ============================================================
 * Sidebar Notes (Popular)
 * ============================================================ */

.dc-sidebar-notes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dc-sidebar-notes li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.dc-sidebar-notes li:last-child {
    border-bottom: none;
}

.dc-sidebar-notes a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

.dc-sidebar-notes a:hover {
    color: #6366f1;
}

.dc-sidebar-notes__content {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dc-sidebar-notes__meta {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

/* ============================================================
 * Sidebar Card — More Link
 * ============================================================ */

.dc-sidebar-card__more {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f5;
    color: #6366f1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.dc-sidebar-card__more:hover {
    text-decoration: underline;
}

/* ============================================================
 * Buttons (Community)
 * ============================================================ */

.dc-community-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #d5d5dc;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.dc-community-button:hover {
    border-color: #999;
    background: #f7f7f9;
}

.dc-community-button--primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-color: transparent;
}

.dc-community-button--primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dc-community-button--secondary {
    background: #f7f7f9;
    color: #333;
    border-color: #eaeaea;
}

/* ============================================================
 * Guest Notice
 * ============================================================ */

.dc-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dc-community-guest {
    text-align: center;
    padding: 30px 20px;
}

.dc-community-guest p {
    color: #666;
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
}

.dc-community-guest p:last-child {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
}

/* ============================================================
 * Empty State
 * ============================================================ */

.dc-community-empty,
.dc-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    color: #999;
    font-size: 15px;
}

.dc-community-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ============================================================
 * Loading Skeleton
 * ============================================================ */

.dc-skeleton {
    background: linear-gradient(90deg, #f0f0f5 0%, #e5e5ea 50%, #f0f0f5 100%);
    background-size: 200% 100%;
    animation: dcSkeleton 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes dcSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
 * Report Modal (آینده)
 * ============================================================ */

.dc-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.dc-report-modal-body {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 768px) {
    .dc-community-wrapper,
    .dc-community,
    .dc-community-page {
        padding: 16px 12px;
    }

    .dc-community-container,
    .dc-community__layout {
        gap: 16px;
    }

    .dc-community__hero-inner {
        padding: 24px 16px;
    }

    .dc-community__hero h1,
    .dc-community__hero-inner h1 {
        font-size: 22px;
    }

    .dc-note {
        padding: 16px;
        border-radius: 12px;
    }

    .dc-note-header {
        gap: 8px;
    }

    .dc-note-avatar img {
        width: 40px;
        height: 40px;
    }

    .dc-members-grid,
    .dc-profile-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .dc-profile-card-link {
        padding: 14px;
    }

    .dc-profile-card-avatar img {
        width: 60px;
        height: 60px;
    }

    .dc-community-tabs,
    .dc-community__tabs {
        padding: 4px;
    }

    .dc-community-tabs a,
    .dc-community__tabs a {
        padding: 8px 14px;
        font-size: 13px;
    }

    .dc-note-comment-form {
        flex-direction: column;
    }

    .dc-note-composer,
    .dc-composer {
        padding: 16px;
    }

    .dc-note-composer form,
    .dc-composer-form {
        flex-direction: column;
    }

    .dc-note-composer__footer,
    .dc-composer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dc-note-composer__footer select,
    .dc-composer-actions select {
        width: 100%;
    }

    .dc-note-composer__footer button,
    .dc-composer-actions button {
        width: 100%;
    }
}