/* Base Styles */
:root {
    --primary-color: #1877F2;
    --secondary-color: #65676B;
    --border-color: #e1e1e1;
    --bg-hover: #f0f2f5;
    --bg-light: #f8f9fa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --spacing: 1rem;
}

/* Layout */
.group-wall-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

.group-wall-content {
    flex: 1;
    max-width: 680px;
}

/* Sidebar */
.group-wall-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    height: fit-content;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing);
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: #050505;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav-item a:hover { background: var(--bg-hover); }
.sidebar-nav-item.active a {
    background: #e7f3ff;
    color: var(--primary-color);
    font-weight: 500;
}

/* Posts */
/* Update post styles */
.group-wall-post {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Admin actions styling */
.post-admin-actions {
    position: relative;
    margin-left: auto;
}

.admin-actions-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    display: none;
}

.pin-input-group {
    margin-bottom: 0.75rem;
}

.pin-input-group input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.pin-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.admin-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.admin-toggle:hover {
    background: var(--bg-hover);
}

.admin-actions-dropdown .pin-form,
.admin-actions-dropdown .delete-action {
    width: 100%;
    padding: 0.5rem;
    margin: 0.25rem 0;
}

.pin-input-group {
    margin-bottom: 0.5rem;
}

/* Fix post content size */
.post-content {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* TinyMCE editor consistency */
.wp-editor-container {
    width: 100%;
    box-sizing: border-box;
}

.mce-content-body {
    padding: 10px !important;
}
.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar img {
    border-radius: 50%;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author { font-weight: 600; }
.post-date { color: var(--secondary-color); font-size: 0.875rem; }
.post-content { margin: 1rem 0; line-height: 1.5; }

/* Actions */
.post-actions {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

.like-button,
.comment-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.like-button:hover,
.comment-toggle:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

.like-button.liked {
    color: #e74c3c;
}

.like-button.liked .dashicons {
    color: #e74c3c;
}

.post-admin-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.pin-button,
.unpin-button,
.delete-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pin-button:hover,
.unpin-button:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

.delete-button {
    color: #666;
}

.delete-button:hover {
    background: #fee;
    color: #e74c3c;
}
.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    border-radius: 20px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: all 0.2s;
}

.action-button:hover { background: var(--bg-hover); }
.action-button.liked { color: var(--primary-color); }

/* Pinned Posts */
/* Pinned Posts Section */
.pinned-posts-section {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.pinned-posts-section h3 {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.pinned-posts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pinned-post-accordion {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 300px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.accordion-header {
    padding: 0.5rem 0.75rem;
    min-height: 32px;
    box-shadow: none;
    background: transparent;
}

.accordion-content {
    padding: 0.75rem;
    background: #fff;
}

.pin-title {
    font-size: 0.875rem;
    line-height: 1.2;
}

/* Post form spacing */
.group-wall-post-form {
    margin: 1rem 0 2rem 0;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.group-wall-post-form {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

/* Regular posts container */
.regular-posts-container {
    margin-top: 2rem;
}

/* Enhanced Pinned Posts Section */
.pinned-posts-section {
    margin-bottom: 2rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.pinned-posts-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pinned-posts-section h3:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.1rem;
    background: var(--primary-color);
    border-radius: 2px;
}

.pinned-posts-container {
    margin-bottom: 2rem;
    width: 100%;
}

.pinned-post-content {
    display: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    width: 100%;
}

.pinned-post-content .post-actions {
    display: none;
}

.pinned-post-content.active {
    display: block;
}

.close-pinned-post {
    display: block;
    margin: 1rem auto 0;
    padding: 0.5rem 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.close-pinned-post:hover {
    background: var(--bg-hover);
}

.accordion-content {
    padding: 1.25rem;
    background: #fff;
    display: none;
}

.accordion-toggle:checked + .accordion-header {
    background: #e7f3ff;
}

.accordion-toggle:checked + .accordion-header .dashicons {
    transform: rotate(90deg);
}

.accordion-toggle:checked ~ .accordion-content {
    display: block;
}

/* Pin Categories */
.pin-category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: #e7f3ff;
    color: var(--primary-color);
    white-space: nowrap;
}

.pinned-posts-category-header {
    background: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.pinned-posts-category-header:hover { background: var(--bg-hover); }
.pinned-posts-category-content { padding: 8px 16px 8px 32px; }

.pin-button, .unpin-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.pin-button {
    color: var(--primary-color);
}

.pin-button:hover {
    background: #e7f3ff;
}

.unpin-button {
    color: var(--secondary-color);
}

.unpin-button:hover {
    background: var(--bg-hover);
}

.group-wall-post.pinned {
    border-left: 4px solid var(--primary-color);
    background: #f8faff;
}

/* Comments */
.comments-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: none;
    width: 100%;
}

.comment-form {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.comment-form form {
    width: 100%;
}

.wp-editor-container {
    width: 100%;
    box-sizing: border-box;
}

.comment-submit-button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-submit-button:hover {
    background: #1565c0;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: flex-start;
}

.comment-form-input {
    flex-grow: 1;
    position: relative;
}

.comment-form textarea {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    resize: none;
    min-height: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .group-wall-container {
        flex-direction: column;
        padding: 0.5rem;
    }
    
    .group-wall-sidebar {
        width: 100%;
        position: static;
    }
    
    .post-form-container,
    .post-actions {
        flex-direction: column;
    }
}

.pinned-post-accordion {
    margin-bottom: 1rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.accordion-toggle {
    display: none;
}

.accordion-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-header .dashicons {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-top: 1px solid var(--border-color);
}

.accordion-toggle:checked + .accordion-header .dashicons {
    transform: rotate(90deg);
}

.accordion-toggle:checked + .accordion-header + .accordion-content {
    max-height: 1000px; /* Adjust this value based on your content */
}

.pin-title {
    font-weight: 500;
    color: var(--primary-color);
    flex-grow: 1;
    cursor: pointer;
}

.pin-title:hover {
    text-decoration: underline;
}

.accordion-content {
    margin-top: 0.5rem;
}

.pin-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pin-input-group input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.accordion-content {
    border-top: 1px solid var(--border-color);
}

/* Pinned Posts Navigation */
.nav-separator {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.pinned-posts-nav {
    background: #fff;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.pinned-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pinned-post-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.pinned-post-item:hover {
    background-color: var(--bg-hover);
}

.pinned-post-content {
    margin-bottom: 2rem;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.close-pinned-post {
    display: block;
    margin: 1rem auto 0;
    padding: 0.5rem 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.close-pinned-post:hover {
    background: var(--bg-hover);
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 1rem;
}

.sidebar-separator {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pinned Posts in Sidebar */
.pinned-nav .sidebar-nav-item {
    margin-bottom: 0.5rem;
}

.pinned-post-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.pinned-post-link:hover {
    background-color: var(--bg-hover);
    text-decoration: none;
}

.pin-category-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: #e7f3ff;
    color: var(--primary-color);
    white-space: nowrap;
    margin-left: auto;
}

.comment-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.comment-toggle:hover {
    background: var(--bg-hover);
}

.bulk-actions-bar {
    margin: 1rem 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.bulk-actions-bar select {
    margin-right: 8px;
}

.role-checkboxes {
    display: flex;
    gap: 1rem;
}

.role-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-form {
    margin: 1em 0;
}

.search-form .search-box {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.search-form input[type="search"] {
    padding: 6px 8px;
    min-width: 300px;
}

.tablenav-pages {
    margin: 1em 0;
    text-align: right;
}

.tablenav-pages .page-numbers {
    display: inline-block;
    padding: 3px 8px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 2px;
}

.tablenav-pages .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}