
/*all group listing*/
.wpgroups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}


.wpgroups-title {
    font-size: 16px;
    font-weight: 600;
}

.wpgroups-subtitle {
    font-size: 24px;
    font-weight: 600;
    margin: 25px 0 15px;
}

.wpgroups-my-section {
    margin-bottom: 40px;
}


.wpgroups-create-btn {
    background: #ff3366;
    color: #fff;
    padding: 10px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
}


.wpgroups-create-btn:hover {
    background: #e62e5c;
}


.wpgroups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}


.wpgroups-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}


.wpgroups-card:hover {
    transform: translateY(-4px);
}


.wpgroups-card-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}


.wpgroups-card-body {
    padding: 15px;
}


.wpgroups-card-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
}


.wpgroups-card-body p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}


.wpgroups-view-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    background: #f2f2f2;
    font-size: 13px;
    text-decoration: none;
    color: #333;
}


.wpgroups-view-btn:hover {
    background: #e6e6e6;
}


/* create group form */

.wpgroups-form {
    background: #fff;
    padding: 30px;
    border-radius: 18px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.wpgroups-form-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 25px;
}

.wpgroups-form-wrapper {
    display: flex;
    gap: 30px;
}

.wpgroups-form-left,
.wpgroups-form-right {
    flex: 1;
}

.wpgroups-form-left label,
.wpgroups-form-right label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.wpgroups-form-left input,
.wpgroups-form-left textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-bottom: 18px;
    font-size: 14px;
}

.wpgroups-save-btn {
    background: #ff3366;
    color: #fff;
    padding: 12px 22px;
    border-radius: 25px;
    border: none;
    font-size: 15px;
    cursor: pointer;
}

.wpgroups-save-btn:hover {
    background: #e62e5c;
}

/* Image upload */
.wpgroups-image-upload input {
    display: none;
}

.wpgroups-image-preview {
    border: 2px dashed #ddd;
    border-radius: 16px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.wpgroups-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#wpgroups-placeholder {
    color: #999;
    font-size: 14px;
}

@media (max-width: 768px) {

    .wpgroups-form-wrapper {
        flex-direction: column;
    }

    /* Show image upload first */
    .wpgroups-form-right {
        order: 1;
        margin-bottom: 20px;
    }

    /* Form fields second */
    .wpgroups-form-left {
        order: 2;
    }

    /* Keep save button at bottom */
    .wpgroups-save-btn {
        margin-top: 10px;
    }
}

/* GROUP DETAIL */
.wpgroups-detail {
    background: #f4f5f7;
}

/* COVER */
.wpgroups-cover {
    height: 320px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.wpgroups-cover-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.2));
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.wpgroups-cover-content {
    padding: 30px;
    color: #fff;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.wpgroups-cover-content h1 {
    font-size: 34px;
    margin-bottom: 6px;
}

.wpgroups-cover-content p {
    font-size: 16px;
    opacity: 0.9;
}

.wpgroups-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #303030;
    padding: 0 20px;
    border-bottom: 1px solid #e4e4e4;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 60px;
}

/* Left menu */
.wpgroups-nav-left a {
    margin-right: 25px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    position: relative;
    padding: 18px 0;
}

.wpgroups-nav-left a.active,
.wpgroups-nav-left a:hover {
    color: #cd091f;
}

.wpgroups-nav-left a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #cd091f;
    border-radius: 4px;
}

.wpgroups-nav-right .wpgroups-invite-btn {
    background: #515455;
    color: #fff;
    padding: 10px 20px;
    border-radius: 18px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

/* Optional: hover effect to make gradient slightly darker */
.wpgroups-nav-right .wpgroups-invite-btn:hover {
    background: #cd091f;
}

/* CONTENT */
.wpgroups-content {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 15px;
}

/* POSTS */
.wpgroups-post {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.wpgroups-post-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.wpgroups-post-body {
    font-size: 15px;
    color: #333;
}

/* Cover header layout */
.wpgroups-cover-header {
    display: flex;
    align-items: center;
    gap: 18px;
}


/* Group avatar */
.wpgroups-group-avatar {
    width: 110px;
    height: 110px;
    border-radius: 16px; /* square with soft corners */
    overflow: hidden;
    border: 4px solid #fff;
    flex-shrink: 0;
    background-color: #eee; /* fallback color */
    position: relative;
}

.wpgroups-group-avatar img {
    position: absolute;  /* Fill the container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;   /* Fill and crop properly */
    display: block;
}

/* Group info */
.wpgroups-group-info h1 {
    font-size: 34px;
    margin: 0 0 6px;
}

.wpgroups-group-info p {
    font-size: 16px;
    opacity: 0.9;
}


/* MOBILE */
@media (max-width: 768px) {
    .wpgroups-cover {
        height: 240px;
    }

    .wpgroups-cover-content h1 {
        font-size: 24px;
    }

   .wpgroups-nav-bar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 10px 15px;
    }

    .wpgroups-nav-left {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        width: 100%;
        margin-bottom: 10px;
    }

    .wpgroups-nav-right {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .wpgroups-nav-right .wpgroups-invite-btn {
        width: auto;
    }

     .wpgroups-cover-header {
        flex-direction: column;
        align-items: flex-start;
    }

      .wpgroups-group-avatar {
        width: 90px;
        height: 90px;
    }

    .wpgroups-group-info h1 {
        font-size: 24px;
    }

}


#wpgroups-post-form {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

#wpgroups-post-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    resize: none;
    min-height: 80px;
}

.wpgroups-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.wpgroups-upload-btn {
    cursor: pointer;
    font-size: 18px;
}

.wpgroups-post-btn {
    background: #000;
    color: #000;
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    font-weight: 500;
}

.wpgroups-post-loader {
    text-align: center;
    padding: 15px;
    color: #777;
}

.wpgroups-empty-posts {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 15px;
}

.wpgroups-post-image {
    margin-top: 10px;
}

.wpgroups-post-image img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    max-height: 400px;
}

.wpgroups-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
    gap: 15px;
    margin-top: 20px;
}

.wpgroups-photo-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.wpgroups-no-photos {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 20px;
}

.wpgroups-photos-loading {
    font-size: 14px;
    color: #333;
}


.wpgroups-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.wpgroups-member-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    text-align: center;
}

.wpgroups-member-img {
    display: block;
    height: 220px;
    overflow: hidden;
}

.wpgroups-member-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.wpgroups-member-info {
    padding: 10px;
}

.wpgroups-member-info h4 {
    font-size: 15px;
    margin: 0;
}

.group-role-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}

.group-role-badge.admin {
    background: linear-gradient(135deg, #ff6a00, #ff9800);
}

.group-role-badge.moderator {
    background: linear-gradient(135deg, #2196f3, #03a9f4);
}

.wpgroups-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.wpgroups-pagination a {
    padding: 6px 12px;
    border-radius: 20px;
    background: #eee;
    color: #333;
    text-decoration: none;
}

.wpgroups-pagination a.active {
    background: #000;
    color: #fff;

}

.wpgroups-post-actions {
    display: flex;
    gap: 18px;
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.wpgroups-post-actions span {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpgroups-post-actions i {
    font-size: 15px;
}

.wpgroups-like-action.liked {
    color: #ff3366;
}

.wpgroups-post-actions span:hover {
    text-decoration: underline;
}

.wpgroups-comment-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.wpgroups-comment-input {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    min-height: 36px;
}

.wpgroups-comment-input:focus {
    border-color: #000;
}

.wpgroups-comment-submit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #000;        /* black background */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;             /* icon color */
    font-size: 15px;
    transition: 0.2s ease;
}

.wpgroups-comment-submit i {
    color: #fff;
}

.wpgroups-comment-submit:hover {
    background: #333;
}


.wpgroups-comment {
    display: flex;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.wpgroups-comment-avatar {
    flex: 0 0 40px;
    margin-right: 10px;
}

.wpgroups-comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.wpgroups-comment-body-wrapper {
    flex: 1;
}

.wpgroups-comment-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.wpgroups-comment-date {
    font-weight: 400;
    color: #666;
    font-size: 12px;
}

.wpgroups-comment-body {
    font-size: 14px;
}

.wpgroups-group-type input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    cursor: pointer;
    transform: scale(1);
}

/* Align nicely */
.wpgroups-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 8px;
}

/* Text layout */
.wpgroups-radio strong {
    font-size: 14px;
    display: block;
}

.wpgroups-radio span {
    font-size: 12px;
    color: #666;
}

.wpgroups-select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
}


/* Overlay */
.wpgroups-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

/* Modal box */
.wpgroups-invite-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    display: none;
    z-index: 9999;
    overflow: hidden; /* CRITICAL */
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}

/* Header */
.wpgroups-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Search */
#wpgroups-invite-search {
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* 🔥 SCROLLABLE LIST */
.wpgroups-invite-list {
    max-height: 45vh;
    overflow-y: auto;
    padding: 10px 16px;
}

.invite-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
}

.invite-user-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* Checkbox on right */
.invite-user-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.invite-user:last-child {
    border-bottom: none;
}

/* Send button */
#wpgroups-send-invite {
    width: calc(100% - 32px);
    margin: 12px 16px 16px;
    padding: 12px;
    border-radius: 25px;
    border: none;
    background: #1877f2;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.wpgroups-send-invite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
