.groups-page,
.group-detail {
    color: #f2f6fb;
}

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

.groups-heading h1 {
    margin: 0;
}

.groups-seo-intro {
    max-width: 620px;
    margin: 8px 0 0;
    color: #aeb9ca;
    line-height: 1.45;
}

.groups-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.groups-search input {
    min-width: 230px;
    border: 0;
    border-radius: 5px;
    padding: 13px 14px;
    color: #e7eefb;
    background: #303142;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.group-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(230px, 1fr);
    min-height: 192px;
    overflow: hidden;
    border-radius: 5px;
    background: #282936;
}

.group-card-photo {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 192px;
    background: #b9c5d5;
    color: #596679;
}

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

.group-fallback {
    font-size: 3rem;
}

.group-verified {
    position: absolute;
    top: 12px;
    left: 12px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #2687ff;
    color: white;
    font-weight: 900;
}

.group-followed-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 999px;
    color: white;
    background: #2687ff;
    box-shadow: 0 0 0 3px rgba(38, 135, 255, 0.18);
    font-weight: 900;
}

.group-followed-badge.pending {
    color: #101827;
    background: #f3d46b;
    box-shadow: 0 0 0 3px rgba(243, 212, 107, 0.18);
}

.group-card-copy {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 24px;
}

.group-card-copy h2 {
    margin: 0;
    font-size: 1.05rem;
    text-transform: uppercase;
}

.group-card-copy a {
    color: white;
    text-decoration: none;
}

.group-card-copy p {
    margin: 0;
    color: #aeb9ca;
    line-height: 1.5;
}

.group-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c2d2ea;
    font-size: 0.92rem;
    font-weight: 800;
}

.group-location::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #58a6ff;
}

.group-members {
    justify-self: start;
    margin-top: 24px;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    background: #38394b;
    font-size: 0.8rem;
    font-weight: 800;
}

.group-cover {
    min-height: 240px;
    border-radius: 5px 5px 0 0;
    background: #0d4a99 center/cover;
}

.group-detail-head {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #282936;
}

.group-detail-avatar,
.group-member-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(135deg, #254f93, #d14b74);
    color: white;
    font-weight: 900;
}

.group-detail-avatar {
    width: 48px;
    height: 48px;
}

.group-detail-avatar img,
.group-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-detail-head h1,
.group-detail-head p {
    margin: 0;
}

.group-detail-head p {
    color: #aeb9ca;
}

.group-verified-inline {
    color: #54a3ff;
}

.group-join-form {
    margin: 0;
}

.group-admin-button {
    min-width: 150px;
    justify-content: center;
}

.group-join-button {
    min-width: 144px;
    justify-content: center;
    border: 0;
    cursor: pointer;
}

.group-join-button.is-following {
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.78);
    background: rgba(38, 135, 255, 0.12);
}

.group-join-button.is-following::after,
.group-join-button.is-pending::after {
    content: "⌄";
    margin-left: 6px;
    font-size: 0.8rem;
}

.group-join-button.is-pending {
    color: #f5f7fb;
    border: 1px solid rgba(245, 247, 251, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.group-detail-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 280px;
    gap: 24px;
    margin-top: 24px;
}

.group-tabs {
    display: grid;
    align-content: start;
    gap: 8px;
}

.group-tabs a {
    padding: 12px 14px;
    border-radius: 5px;
    color: #dbe5f5;
    text-decoration: none;
}

.group-tabs a.active,
.group-tabs a:hover {
    background: rgba(38, 135, 255, 0.14);
    color: #58a6ff;
}

.group-feed,
.group-members-panel {
    display: grid;
    align-content: start;
    gap: 18px;
}

.group-comment-box,
.group-comment-form,
.group-post,
.group-members-panel {
    border-radius: 5px;
    background: #282936;
}

.group-comment-box {
    display: block;
    padding: 16px;
    color: #9facbf;
    text-decoration: none;
}

.group-comment-form {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.group-comment-form textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    border: 1px solid rgba(38, 135, 255, 0.86);
    border-radius: 4px 4px 0 0;
    padding: 16px;
    color: #f2f6fb;
    background: #303142;
    outline: none;
}

.group-comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.group-comment-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 136px;
    padding: 11px 18px;
    border-radius: 4px;
    color: #f2f6fb;
    background: #333445;
    cursor: pointer;
    font-weight: 800;
}

.group-comment-upload:hover {
    background: #3b3d51;
}

.group-comment-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.group-post {
    padding: 24px;
}

.group-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #8fb9ff;
}

.group-post-author {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.group-post-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, #254f93, #d14b74);
    font-weight: 900;
    text-decoration: none;
}

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

.group-user-link {
    color: #8fb9ff;
    font-weight: 900;
    text-decoration: none;
}

.group-user-link:hover {
    color: #cfe2ff;
    text-decoration: underline;
}

.group-post-actions {
    margin: 18px -24px -24px;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #aeb9ca;
}

.group-post-image {
    display: block;
    width: min(420px, 100%);
    max-height: 420px;
    margin-top: 14px;
    border-radius: 6px;
    object-fit: cover;
    background: #151622;
}

.group-members-panel {
    padding: 22px;
}

.group-member-grid {
    display: grid;
    grid-template-columns: repeat(5, 38px);
    gap: 12px;
}

.group-member-avatar {
    width: 38px;
    height: 38px;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

a.group-member-avatar:hover {
    box-shadow: 0 0 0 3px rgba(84, 163, 255, 0.18);
    transform: translateY(-1px);
}

.group-requests-panel {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.group-requests-panel h4 {
    margin: 0;
    color: #f2f6fb;
}

.group-request-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
}

.group-request-row a,
.group-request-row strong {
    color: #f2f6fb;
    font-weight: 900;
    text-decoration: none;
}

.group-request-row small {
    display: block;
    margin-top: 2px;
    color: #9facbf;
}

.group-request-row form {
    margin: 0;
}

.group-request-row button {
    border: 1px solid rgba(0, 214, 93, 0.72);
    border-radius: 5px;
    color: #00d65d;
    background: transparent;
    cursor: pointer;
    padding: 7px 9px;
    font-weight: 900;
}

.group-request-row button.reject {
    border-color: rgba(255, 58, 82, 0.78);
    color: #ff3a52;
}

.group-form-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 6px;
    background: #282936;
}

.group-form-card label {
    display: grid;
    gap: 10px;
}

.group-form-card input,
.group-form-card select,
.group-form-card textarea {
    width: 100%;
    border: 0;
    border-radius: 4px;
    padding: 13px 14px;
    color: #f2f6fb;
    background: #333445;
}

.group-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.group-upload-box {
    position: relative;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border: 2px dashed #9aa3b2;
    border-radius: 8px;
    color: #9aa3b2;
    font-size: 2.4rem;
    font-weight: 800;
}

.group-form-card input[type="file"] {
    padding: 0;
    background: transparent;
}

.group-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn.danger {
    color: #fff;
    border-color: rgba(255, 68, 95, 0.72);
    background: #e73f4f;
}

.btn.danger:hover {
    border-color: rgba(255, 92, 116, 0.92);
    background: #f04d5d;
}

.group-delete-modal-open {
    overflow: hidden;
}

.group-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.group-delete-modal[hidden] {
    display: none;
}

.group-delete-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 12, 0.74);
    backdrop-filter: blur(6px);
}

.group-delete-dialog {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f2f6fb;
    background: #202130;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.group-delete-dialog h2 {
    margin: 0 0 12px;
}

.group-delete-dialog p {
    margin: 0;
    color: #c7d2e4;
    line-height: 1.55;
}

.group-delete-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #aeb9ca;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.group-delete-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.group-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 980px) {
    .groups-grid,
    .group-detail-layout,
    .group-form-grid {
        grid-template-columns: 1fr;
    }

    .group-card {
        grid-template-columns: 1fr;
    }

    .group-comment-actions,
    .group-post-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .group-comment-actions .btn,
    .group-comment-upload {
        width: 100%;
    }

    .group-delete-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}
