/* Groups Module Styles */

/* Override social-page overflow restriction for groups */
body.social-page:has(.groups-container),
body.social-page:has(.group-page) {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

.group-page {
    overflow-y: auto;
    min-height: 100vh;
}

.groups-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 165px;
}

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.groups-header h1 {
    margin: 0;
    color: #1c1e21;
    font-size: 24px;
}

.groups-search {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.groups-search input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.groups-search input:focus {
    border-color: #1877f2;
}

.btn-create-group {
    background: linear-gradient(135deg, #1877f2, #1a365d);
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create-group:hover {
    background: linear-gradient(135deg, #1a6ed8, #152a4d);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.4);
}

.btn-create-group.large {
    padding: 18px 35px;
    font-size: 17px;
    margin-top: 20px;
}

/* Discover Header */
.discover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.discover-header h2 {
    margin: 0;
    color: #1c1e21;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.discover-header .btn-create-group {
    flex-shrink: 0;
    white-space: nowrap;
}

.discover-header h2 .groups-icon,
.groups-header h1 .groups-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

/* Search Bar */
.groups-search-bar {
    margin-bottom: 20px;
}

.groups-search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 12px 18px;
    border: 1px solid #dddfe2;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    background: white;
}

.groups-search-bar input:focus {
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
}

/* Empty state styles */
.groups-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.group-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.group-cover {
    height: 0;
    background: transparent;
    position: relative;
    display: none;
}

.group-cover:has(img) {
    height: 120px;
    display: block;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3748 100%);
}

.group-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-group-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid #1a365d;
}

.my-group-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    border: 3px solid #1a365d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.my-group-avatar-placeholder span {
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.my-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-group-info {
    flex: 1;
}

.group-info {
    padding: 15px;
}

.group-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1c1e21;
}

.group-name a {
    color: inherit;
    text-decoration: none;
}

.group-name a:hover {
    color: #1877f2;
}

.group-meta {
    font-size: 13px;
    color: #65676b;
    margin-bottom: 10px;
}

.group-meta span {
    margin-right: 15px;
}

.group-description {
    font-size: 14px;
    color: #65676b;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.group-actions {
    display: flex;
    gap: 10px;
}

.btn-join, .btn-view {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
}

.btn-join {
    background: #1877f2;
    color: white;
}

.btn-join:hover {
    background: #166fe5;
}

.btn-join.joined {
    background: #e4e6e9;
    color: #1c1e21;
}

.btn-view {
    background: #e4e6e9;
    color: #1c1e21;
}

.btn-view:hover {
    background: #d8dadf;
}

/* Privacy Badge */
.privacy-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.privacy-badge.public {
    background: #e7f3ff;
    color: #1877f2;
}

.privacy-badge.private {
    background: #fff3e6;
    color: #e67e22;
}

/* Single Group Page */
.group-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 160px;
    box-sizing: border-box;
}

.group-header-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3748 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    min-height: 180px;
}

.group-header-banner > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.group-header-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    color: white;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.group-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.group-title-row h1 {
    flex: 1;
    min-width: 0;
}

.group-title-row .group-leadership-badges {
    margin-left: auto;
}

.group-header-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.group-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a365d, #3b82f6);
    font-size: 28px;
    color: white;
}

.group-list-avatar {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 12px;
    border: 3px solid #1a365d;
    flex-shrink: 0;
}

.group-list-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    border: 3px solid #1a365d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 12px;
    flex-shrink: 0;
}

.group-list-avatar-placeholder span {
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.group-header-content h1 {
    margin: 0;
    font-size: 28px;
}

.group-header-content .group-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.group-header-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.group-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

@media (max-width: 768px) {
    .group-content {
        grid-template-columns: 1fr;
    }
}

/* Three Column Layout */
.group-content-three-col {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.group-sidebar-left,
.group-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 1024px) {
    .group-content-three-col {
        grid-template-columns: 1fr;
    }
    .group-sidebar-left,
    .group-sidebar-right {
        order: 1;
    }
    .group-main {
        order: 0;
    }
}

/* Two Column Layout */
.group-content-two-col {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.group-main-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 900px) {
    .group-content-two-col {
        grid-template-columns: 1fr;
    }
}

/* Full Width Layout for Posts */
.group-content-full {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* About Section - Full Width with Members */
.group-about-section {
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    padding: 20px;
    color: white;
    max-width: 100%;
    margin: 15px 0;
}

.about-content-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.about-text {
    flex: 0 0 auto;
    width: calc(100% - 300px);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.about-text h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 1px;
}

.about-text p {
    margin: 0;
    line-height: 1.6;
    opacity: 0.9;
}

/* Members in About Section */
.about-members {
    flex: 0 0 auto;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px;
    min-width: 220px;
    max-width: 280px;
}

.about-members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.members-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.see-all-members {
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
}

.see-all-members:hover {
    text-decoration: underline;
}

.about-members-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.about-member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.about-member-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.about-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.about-member-name {
    font-size: 11px;
    color: #374151;
    text-align: center;
    margin-top: 4px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.about-member-role {
    font-size: 9px;
    color: #6366f1;
    text-transform: capitalize;
    font-weight: 600;
}

@media (max-width: 600px) {
    .about-content-row {
        flex-direction: column;
    }
    .about-members {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Members Modal */
.members-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.members-modal-overlay.active {
    display: flex;
}

.members-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.members-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.members-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.members-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.members-modal-close:hover {
    color: #1f2937;
}

.members-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.members-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.modal-member-item:hover {
    background: #f3f4f6;
}

.modal-member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-member-info {
    min-width: 0;
}

.modal-member-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-member-role {
    font-size: 11px;
    color: #6366f1;
    text-transform: capitalize;
    font-weight: 600;
}

.group-about-section h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 1px;
}

.group-about-section p {
    margin: 0;
    line-height: 1.6;
    opacity: 0.9;
}

/* Leadership Badges */
.group-leadership-badges {
    display: flex;
    gap: 15px;
    margin-left: 0;
    justify-content: flex-start;
}

.leadership-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: white;
}

.leadership-badge.admin-badge {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.leadership-badge.moderator-badge {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.leadership-badge.no-moderator {
    background: rgba(100, 116, 139, 0.7);
}

.leadership-badge.member-badge {
    background: linear-gradient(135deg, #475569, #64748b);
    min-width: 80px;
    justify-content: center;
}

.leadership-badge.member-badge:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.leadership-badge.pending-badge {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    min-width: 100px;
    justify-content: center;
}

.leadership-badge.join-badge {
    background: linear-gradient(135deg, #059669, #10b981);
    min-width: 80px;
    justify-content: center;
}

.leadership-badge.join-badge:hover {
    background: linear-gradient(135deg, #047857, #059669);
}

/* Group Stats Layout */
.group-stats-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Membership Status Button in Stats Row */
.membership-status-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.membership-status-btn.joined {
    background: #475569;
    color: white;
}

.membership-status-btn.joined:hover {
    background: #dc2626;
}

.membership-status-btn.pending {
    background: #f59e0b;
    color: white;
    cursor: default;
}

.membership-status-btn.join {
    background: #10b981;
    color: white;
}

.membership-status-btn.join:hover {
    background: #059669;
}

.membership-btn-group {
    display: flex;
    gap: 8px;
}

.membership-status-btn.leave {
    background: #dc2626;
    color: white;
}

.membership-status-btn.leave:hover {
    background: #b91c1c;
}

.leadership-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

.leadership-avatar.placeholder-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.leadership-info {
    display: flex;
    flex-direction: column;
}

.leadership-name {
    font-size: 14px;
    font-weight: 600;
}

.leadership-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .group-leadership-badges {
        margin-left: 0;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .group-title-row {
        flex-wrap: wrap;
    }
}

/* Feeling Feature */
.btn-attach-feeling {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #65676b;
    border-radius: 6px;
}

.btn-attach-feeling:hover {
    background: #f0f2f5;
}

.feeling-picker {
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.feeling-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feeling-options button {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.feeling-options button:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.selected-feeling {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    margin-top: 10px;
}

.selected-feeling span {
    font-size: 14px;
    color: #166534;
}

.remove-feeling-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #dc2626;
    cursor: pointer;
    padding: 0 4px;
}

.group-post-author-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.post-feeling {
    color: #64748b;
    font-size: 13px;
}

/* Group Header Stats Row */
.group-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Group Post Stats */
.group-post-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    color: #65676b;
    border-bottom: 1px solid #e4e6e9;
    margin-bottom: 8px;
    margin-left: -12px;
    margin-right: -12px;
}

.group-post-stats .stat-reactions {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.group-post-stats .stat-reactions:hover {
    background: rgba(0,0,0,0.05);
}

.stat-comments {
    cursor: pointer;
}

.stat-comments:hover {
    text-decoration: underline;
}

/* Group Reaction Picker */
.group-post-action-btn.reaction-btn {
    position: relative;
}

.group-reaction-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 6px 10px;
    gap: 4px;
    z-index: 100;
}

/* Bridge element to prevent hover gap */
.group-reaction-picker::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.group-post-action-btn.reaction-btn:hover .group-reaction-picker {
    display: flex;
}

.reaction-option {
    font-size: 26px;
    cursor: pointer;
    transition: transform 0.15s;
    padding: 2px 4px;
}

.reaction-option:hover {
    transform: scale(1.3);
}

.current-reaction {
    margin-right: 5px;
}

.group-post-action-btn.reaction-btn.reacted {
    color: #1877f2;
}

.group-post-action-btn.reaction-btn.reacted .reaction-text {
    font-weight: 600;
}

/* Group Comments */
.group-post-comments {
    padding-top: 10px;
    border-top: 1px solid #e4e6e9;
    margin-top: 10px;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.group-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.group-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.group-comment-body {
    flex: 1;
    background: #f0f2f5;
    padding: 8px 12px;
    border-radius: 18px;
}

.group-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #050505;
}

.group-comment-text {
    font-size: 14px;
    color: #1c1e21;
    margin-top: 2px;
}

.group-comment-time {
    font-size: 11px;
    color: #65676b;
    margin-top: 4px;
    padding-left: 42px;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.comment-input:focus {
    border-color: #1877f2;
}

.comment-submit-btn {
    padding: 8px 16px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.comment-submit-btn:hover {
    background: #166fe5;
}

/* Group Post Form */
.group-post-form {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.group-post-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.group-post-form textarea:focus {
    outline: none;
    border-color: #1877f2;
}

.group-post-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.btn-attach-photo {
    background: #f0f2f5;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1877f2;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-attach-photo:hover {
    background: #e4e6e9;
}

.post-image-preview {
    position: relative;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.post-image-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-preview-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Group Posts */
.group-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.group-post {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.group-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.group-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.group-post-author {
    flex: 1;
}

.group-post-author-name {
    font-weight: 600;
    color: #1c1e21;
}

.group-post-time {
    font-size: 12px;
    color: #65676b;
}

.group-post-content {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #1c1e21;
}

.group-post-image {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

.group-post-actions {
    display: flex;
    gap: 15px;
    padding-top: 12px;
    border-top: 1px solid #eff2f5;
}

.group-post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.group-post-action:hover {
    background: #f0f2f5;
}

.group-post-action.active {
    color: #1877f2;
}

/* Facebook-style Group Posts */
.group-post.fb-style {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.group-post.fb-style .group-post-header {
    padding: 16px 16px 12px;
    margin-bottom: 0;
}

.group-post.fb-style .group-post-avatar {
    width: 48px;
    height: 48px;
}

.group-post.fb-style .group-post-author-name {
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    text-decoration: none;
}

.group-post.fb-style .group-post-author-name:hover {
    text-decoration: underline;
}

.group-post.fb-style .group-post-time {
    font-size: 13px;
    color: #65676b;
}

.group-post.fb-style .group-post-content {
    padding: 0 16px 16px;
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.6;
}

.group-post.fb-style .group-post-image {
    width: 100%;
    border-radius: 0;
    margin-bottom: 0;
    max-height: 500px;
    object-fit: cover;
}

.group-post.fb-style .group-post-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    margin: 0 16px;
    border-top: 1px solid #eff2f5;
}

.group-post-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}

.group-post-action-btn:hover {
    background: #f0f2f5;
}

.group-post-action-btn.active {
    color: #1877f2;
}

/* Post Menu (Ellipsis) */
.group-post-menu {
    position: relative;
    margin-left: auto;
}

.group-post-ellipsis {
    background: none;
    border: none;
    font-size: 24px;
    color: #65676b;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.2s;
}

.group-post-ellipsis:hover {
    background: #f0f2f5;
}

.group-post-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
}

.group-post-dropdown.show {
    display: block;
}

.group-post-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: #1c1e21;
    cursor: pointer;
    text-align: left;
}

.group-post-dropdown button:hover {
    background: #f0f2f5;
}

/* Group Sidebar */
.group-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.group-sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.group-sidebar-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1c1e21;
}

.group-about {
    font-size: 14px;
    color: #65676b;
    line-height: 1.5;
}

/* Members List */
.members-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.member-item {
    text-align: center;
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
}

.member-name {
    font-size: 12px;
    color: #1c1e21;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role {
    font-size: 10px;
    color: #1877f2;
    font-weight: 600;
}

/* Create Group Modal */
.create-group-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.create-group-modal.active {
    display: flex;
}

.create-group-form {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.create-group-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e4e6e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.create-group-header h2 {
    margin: 0;
    font-size: 20px;
}

.create-group-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #65676b;
}

.create-group-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1c1e21;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1877f2;
}

.create-group-footer {
    padding: 15px 20px;
    border-top: 1px solid #e4e6e9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: #e4e6e9;
    color: #1c1e21;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit {
    background: #1877f2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit:hover {
    background: #166fe5;
}

/* My Groups Section */
.my-groups-section {
    margin-bottom: 30px;
}

.my-groups-section h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #1c1e21;
}

.other-groups-heading {
    margin: 20px 0 20px 0;
    font-size: 22px;
    color: #000000;
    text-shadow: none;
}

.my-groups-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.my-group-item {
    flex: 0 0 auto;
    width: 200px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.my-group-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.my-group-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1c1e21;
}

.my-group-role {
    font-size: 12px;
    color: #1877f2;
}

.groups-empty h3 {
    margin: 0 0 10px 0;
    color: #1c1e21;
}

/* Invitations Section */
.invitations-section {
    margin-bottom: 30px;
}

.invitations-section h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #1c1e21;
}

.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invitation-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease;
}

.invitation-info strong {
    font-size: 16px;
    color: #1c1e21;
    margin-right: 10px;
}

.invitation-info p {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: #65676b;
}

.invitation-actions {
    display: flex;
    gap: 10px;
}

.btn-accept {
    background: #1877f2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-accept:hover {
    background: #166fe5;
}

.btn-decline {
    background: #e4e6eb;
    color: #65676b;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-decline:hover {
    background: #d8dadf;
}

/* Secret Privacy Badge */
.privacy-badge.secret {
    background: #7c3aed;
    color: white;
}

/* Invite Members Modal */
.invite-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.invite-modal.active {
    display: flex;
}

.invite-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.invite-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invite-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.invite-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #65676b;
}

.invite-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.invite-search {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.invitable-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invitable-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: #f7f8fa;
}

.invitable-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invitable-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.invitable-user-name {
    font-weight: 600;
    color: #1c1e21;
}

.btn-invite {
    background: #1877f2;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.btn-invite:hover {
    background: #166fe5;
}

.btn-invite:disabled {
    background: #bcc0c4;
    cursor: not-allowed;
}

.btn-invite.invited {
    background: #e4e6eb;
    color: #65676b;
}

/* Group Avatar Upload */
.group-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed #dadde1;
}

.btn-upload-avatar {
    background: linear-gradient(135deg, #1877f2, #1a365d);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-upload-avatar:hover {
    opacity: 0.9;
}

/* Group Background Selector */
/* Avatar Upload Section */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px dashed #dadde1;
    background: #f0f2f5;
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, #1a365d, #3b82f6);
    color: white;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-choose-avatar {
    padding: 8px 16px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-choose-avatar:hover {
    background: #166fe5;
}

.btn-remove-avatar {
    padding: 8px 16px;
    background: #f0f2f5;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-remove-avatar:hover {
    background: #fef2f2;
}

.group-background-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.background-preview {
    width: 160px;
    height: 90px;
    border-radius: 8px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed #dadde1;
    color: #65676b;
    font-size: 12px;
}

.btn-choose-bg {
    background: linear-gradient(135deg, #1877f2, #1a365d);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-choose-bg:hover {
    opacity: 0.9;
}

/* Group Background Modal */
.group-bg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-bg-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.group-bg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6e9;
}

.group-bg-header h3 {
    margin: 0;
    font-size: 18px;
}

.group-bg-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #65676b;
}

.group-bg-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.group-bg-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.group-bg-category {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.group-bg-category:hover {
    transform: translateY(-2px);
}

.group-bg-category img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-bg-category span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 16px 8px 8px;
    font-size: 12px;
    font-weight: 600;
}

.group-bg-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.group-bg-image {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    transition: transform 0.2s;
}

.group-bg-image:hover {
    transform: scale(1.02);
}

.group-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Group Announcement Link in Feed */
.group-announcement-link {
    display: inline-block;
    background: linear-gradient(135deg, #1877f2, #1a365d);
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}

.group-announcement-link:hover {
    opacity: 0.9;
}
