/**
 * Wall System - Styles
 */

/* Community Header */
.community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.community-title {
    margin: 0;
}

.community-actions {
    display: flex;
    gap: 8px;
}

/* Mobile responsive header */
@media (max-width: 767px) {
    .community-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .community-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .community-actions {
        display: flex;
        gap: 8px;
    }

    .community-btn {
        flex: 1;
        font-size: 0.875rem;
        padding: 8px 12px;
    }

    .community-btn .btn-text {
        display: inline;
    }
}

/* Tablet - more compact buttons */
@media (min-width: 768px) and (max-width: 991px) {
    .community-btn {
        font-size: 0.875rem;
        padding: 8px 12px;
    }
}

/* Post Cards */
.wall-post-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wall-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Post Text */
.post-text {
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--theme-text);
    margin: 0;
    padding: 0;
}

/* Post Images */
.post-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.post-image img:hover {
    opacity: 0.95;
}

/* Post Stats */
.post-stats {
    font-size: 0.9rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Action Buttons */
.post-actions {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.post-actions .btn {
    font-size: 0.9rem;
    padding: 0.375rem 1rem;
}

/* Like Button Animation */
.like-btn.btn-danger {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Comments Section - Clean & Simple */
.comment-item {
    padding: 8px 0;
    margin-left: 40px; /* Indent comments */
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin-right: 6px;
}

.comment-text {
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--theme-text);
}

.comment-meta {
    margin-top: 2px;
}

.comment-meta small {
    font-size: 0.75rem;
}

/* Legacy comment styles for backwards compatibility */
.comment {
    padding: 0.75rem 0;
}

.comment:last-child {
    border-bottom: none !important;
}

.comment strong {
    font-weight: 600;
    color: var(--theme-text);
}

.comment p {
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Comment Form - Clean Style */
.comment-section {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 12px;
    margin-top: 12px;
}

[data-theme="dark"] .comment-section {
    border-top-color: rgba(255,255,255,0.1);
}

.comments-list {
    margin-bottom: 12px;
}

#commentForm {
    align-items: center;
}

#commentInput {
    flex: 1;
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

#commentForm button[type="submit"] {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inline comment form styling */
.comment-form {
    align-items: center;
    margin-left: 40px; /* Align with comments */
}

.comment-form .comment-input {
    flex: 1;
    border-radius: 20px;
    padding: 8px 14px;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-surface);
    font-size: 0.875rem;
    transition: all 0.2s;
    color: var(--theme-text);
}

[data-theme="dark"] .comment-form .comment-input {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.comment-form .comment-input:focus {
    background-color: var(--theme-bg);
    border-color: var(--theme-primary);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    color: var(--theme-text);
}

[data-theme="dark"] .comment-form .comment-input:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-primary);
}

.comment-form button[type="submit"] {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: var(--theme-primary);
    color: white;
    transition: background-color 0.2s;
}

.comment-form button[type="submit"]:hover {
    background-color: var(--theme-primary-hover);
}

.comment-form button[type="submit"]:disabled {
    background-color: var(--theme-border);
    cursor: not-allowed;
}

[data-theme="dark"] .comment-form button[type="submit"]:disabled {
    background-color: var(--theme-border);
}

.comment-form button[type="submit"] i {
    font-size: 0.75rem;
}

/* Dark Mode Support */
[data-theme="dark"] .wall-post-card {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
}

[data-theme="dark"] .post-stats {
    border-top-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .post-actions {
    border-top-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .comment {
    border-bottom-color: rgba(255,255,255,0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .wall-post-card {
        border-radius: 0;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .post-actions .btn {
        font-size: 0.85rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Comments list container */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 0;
}

.comments-list::-webkit-scrollbar {
    width: 8px;
}

.comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--theme-border);
    border-radius: 4px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-muted);
}

/* View all comments link */
.comments-list a {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty States */
.text-center i.fa-3x {
    opacity: 0.3;
}

/* Badge Styles */
.badge.bg-success[style*="font-size: 0.65rem"] {
    padding: 0.15rem 0.4rem;
    vertical-align: middle;
}

/* Online Indicator */
.online-indicator {
    position: relative;
}

.online-indicator::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: var(--theme-success);
    border: 2px solid var(--theme-bg);
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.online-indicator-small {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--theme-success);
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* ==================== THEME SYSTEM CLASSES ==================== */
/* External CSS classes to replace inline styles */

/* Profile containers */
.wall-profile-inline {
    display: inline-block;
}

.wall-profile-placeholder-32 {
    width: 32px;
    height: 32px;
}

.wall-profile-placeholder-50 {
    width: 50px;
    height: 50px;
}

/* Image preview */
.wall-image-preview-hidden {
    display: none;
}

.wall-image-preview-img {
    max-height: 200px;
}

/* Alert visibility */
.wall-alert-hidden {
    display: none;
}

/* Post link color (uses theme variable) */
.wall-post-link {
    color: var(--theme-text);
}
