﻿/* =========================================================================
   TalkApp — Ultra-Premium Native-Grade New Group UI (Light + Dark + Mobile/Desktop)
   ========================================================================= */
#createGroupPage {
    --ngp-bg: #ffffff;
    --ngp-surface: #ffffff;
    --ngp-surface-elevated: #f7f9fa;
    --ngp-input-bg: #f3f6f8;
    --ngp-border: rgba(17, 27, 33, 0.08);
    --ngp-divider: rgba(17, 27, 33, 0.06);
    --ngp-text: #111b21;
    --ngp-muted: #667781;
    --ngp-accent: #00a884;
    --ngp-accent-deep: #007a62;
    --ngp-accent-soft: rgba(0, 168, 132, 0.09);
    --ngp-header-bg: linear-gradient(135deg, #065f50 0%, #008069 55%, #009176 100%);
    --ngp-footer-bg: rgba(255, 255, 255, 0.88);
    --ngp-shadow: 0 28px 75px rgba(11, 20, 26, 0.30);
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(11, 20, 26, 0.56);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    animation: ngpFadeIn 0.18s ease-out;
}

body.dark-mode #createGroupPage {
    --ngp-bg: #111b21;
    --ngp-surface: #111b21;
    --ngp-surface-elevated: #182229;
    --ngp-input-bg: #202c33;
    --ngp-border: rgba(255, 255, 255, 0.08);
    --ngp-divider: rgba(255, 255, 255, 0.06);
    --ngp-text: #e9edef;
    --ngp-muted: #8696a0;
    --ngp-accent: #00a884;
    --ngp-accent-deep: #06cf9c;
    --ngp-accent-soft: rgba(0, 168, 132, 0.14);
    --ngp-header-bg: linear-gradient(135deg, #1b272e 0%, #202c33 100%);
    --ngp-footer-bg: rgba(17, 27, 33, 0.90);
    --ngp-shadow: 0 32px 84px rgba(0, 0, 0, 0.72);
}

/* Call Pill Active hone par zero overlap */
html body.wa-gc-pip-visible #createGroupPage {
    top: 50px !important;
    height: calc(100vh - 50px) !important;
    height: calc(100dvh - 50px) !important;
}

/* Main Sheet Container */
.ngp-shell {
    width: 100%;
    height: 100%;
    background: var(--ngp-surface);
    color: var(--ngp-text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ngpSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Desktop par luxury centered sheet */
@media (min-width: 768px) {
    #createGroupPage {
        padding: 20px;
    }

    .ngp-shell {
        width: 100%;
        max-width: 470px;
        height: min(90vh, 720px);
        border-radius: 26px;
        border: 1px solid var(--ngp-border);
        box-shadow: var(--ngp-shadow);
    }
}

/* 1. Sleek Top Header */
.grp-page-header {
    background: var(--ngp-header-bg);
    color: #ffffff;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.grp-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.16s ease, transform 0.14s ease;
}

    .grp-back-btn:hover {
        background: rgba(255, 255, 255, 0.22);
    }

    .grp-back-btn:active {
        transform: scale(0.92);
    }

.ngp-header-meta {
    min-width: 0;
    flex: 1;
}

.ngp-header-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

#selected-mitra-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 2px;
    font-weight: 500;
}

/* 2. Hero Group Identity Card (Aligned & Compact) */
.grp-form-card {
    padding: 16px 16px 14px;
    background: linear-gradient(180deg, rgba(0, 168, 132, 0.055) 0%, var(--ngp-surface) 100%);
    border-bottom: 1px solid var(--ngp-border);
    flex-shrink: 0;
}

body.dark-mode .grp-form-card {
    background: linear-gradient(180deg, rgba(0, 168, 132, 0.08) 0%, var(--ngp-surface) 100%);
}

.ngp-identity-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ngp-avatar-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #00bf96 0%, #007d65 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.6px;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.14), 0 10px 22px rgba(0, 128, 105, 0.28);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
    user-select: none;
    position: relative;
}

    .ngp-avatar-badge::after {
        content: "";
        position: absolute;
        inset: 2px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.26);
        pointer-events: none;
    }

    .ngp-avatar-badge.has-initials {
        font-size: 20px;
    }

.ngp-inputs-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ngp-field {
    position: relative;
    display: flex;
    align-items: center;
}

.ngp-field-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--ngp-muted);
    pointer-events: none;
    transition: color 0.16s ease;
}

.grp-input {
    width: 100%;
    border: 1px solid var(--ngp-border);
    border-radius: 13px;
    padding: 9px 44px 9px 34px;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    background: var(--ngp-surface);
    color: var(--ngp-text);
    box-shadow: 0 1px 3px rgba(17, 27, 33, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.dark-mode .grp-input {
    background: var(--ngp-input-bg);
    box-shadow: none;
}

.grp-input::placeholder {
    color: var(--ngp-muted);
    font-weight: 400;
}

.grp-input:focus {
    border-color: var(--ngp-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15);
}

.ngp-field:focus-within .ngp-field-icon {
    color: var(--ngp-accent);
}

.ngp-char-count {
    position: absolute;
    right: 11px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ngp-muted);
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* 3. WhatsApp-Native Circular Avatar Rail (Selected Members) */
.ngp-chips-strip {
    display: none;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px 10px;
    overflow-x: auto;
    background: var(--ngp-surface-elevated);
    border-bottom: 1px solid var(--ngp-border);
    flex-shrink: 0;
    scrollbar-width: none;
}

    .ngp-chips-strip::-webkit-scrollbar {
        display: none;
    }

    .ngp-chips-strip.has-items {
        display: flex;
    }

.ngp-avatar-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    flex-shrink: 0;
    cursor: pointer;
    animation: ngpChipPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ngp-avatar-chip-ring {
    position: relative;
    width: 46px;
    height: 46px;
}

.ngp-avatar-chip-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ngp-accent);
    background: var(--ngp-input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 168, 132, 0.18);
}

    .ngp-avatar-chip-img.is-fallback {
        background: linear-gradient(135deg, #00a884 0%, #007a62 100%);
    }

.ngp-avatar-chip-remove {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--ngp-surface-elevated);
    background: #54656f;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.14s ease;
}

.ngp-avatar-chip:hover .ngp-avatar-chip-remove {
    background: #ef4444;
    transform: scale(1.1);
}

.ngp-avatar-chip-name {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ngp-text);
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* 4. Crisp Search Bar & Minimal Section Title */
.grp-search-wrap {
    padding: 12px 16px 8px;
    background: var(--ngp-surface);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ngp-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.ngp-search-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--ngp-muted);
    pointer-events: none;
}

.grp-search-input {
    width: 100%;
    border: 1.5px solid transparent;
    background: var(--ngp-input-bg);
    border-radius: 14px;
    padding: 9px 36px 9px 38px;
    font-size: 13.5px;
    outline: none;
    color: var(--ngp-text);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

    .grp-search-input::placeholder {
        color: var(--ngp-muted);
    }

    .grp-search-input:focus {
        background: var(--ngp-surface);
        border-color: var(--ngp-accent);
        box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
    }

.ngp-search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--ngp-muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

    .ngp-search-clear.show {
        display: inline-flex;
    }

    .ngp-search-clear:hover {
        background: rgba(134, 150, 160, 0.18);
        color: var(--ngp-text);
    }

.ngp-list-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ngp-muted);
    padding: 0 2px;
}

/* 5. Clean Unified Contact List (iOS / WhatsApp Hairline Rows — No Cluttered Boxes) */
#group-mitra-list {
    flex: 1;
    overflow-y: auto;
    padding: 2px 8px 14px;
    background: var(--ngp-surface);
}

    #group-mitra-list::-webkit-scrollbar {
        width: 5px;
    }

    #group-mitra-list::-webkit-scrollbar-track {
        background: transparent;
    }

    #group-mitra-list::-webkit-scrollbar-thumb {
        background: rgba(134, 150, 160, 0.28);
        border-radius: 999px;
    }

.mitra-select-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px;
    margin: 2px 0;
    border-radius: 14px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.16s ease, transform 0.12s ease;
}

    /* Indented WhatsApp-style hairline divider starting after avatar */
    .mitra-select-row::after {
        content: "";
        position: absolute;
        left: 66px;
        right: 12px;
        bottom: -2px;
        height: 1px;
        background: var(--ngp-divider);
        pointer-events: none;
        transition: opacity 0.15s ease;
    }

    .mitra-select-row:last-child::after,
    .mitra-select-row.selected::after {
        opacity: 0;
    }

    .mitra-select-row:hover {
        background: var(--ngp-surface-elevated);
    }

    .mitra-select-row:active {
        transform: scale(0.992);
    }

    .mitra-select-row.selected {
        background: var(--ngp-accent-soft);
    }

    .mitra-select-row img {
        width: 46px !important;
        height: 46px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        border: 2px solid var(--ngp-border);
        background: var(--ngp-input-bg);
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .mitra-select-row.selected img {
        border-color: var(--ngp-accent);
        box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.18);
    }

    .mitra-select-row .fw-semibold,
    .mitra-select-row span {
        font-size: 14.5px;
        font-weight: 600;
        letter-spacing: -0.01em;
        color: var(--ngp-text);
    }

.mitra-circle-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(134, 150, 160, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    background: transparent;
}

.mitra-select-row.selected .mitra-circle-check {
    background: linear-gradient(135deg, #00bf96 0%, #008069 100%);
    border-color: transparent;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.36);
}

/* 6. Compact Frosted-Glass Action Footer */
.grp-page-footer {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--ngp-footer-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--ngp-border);
    box-shadow: 0 -6px 24px rgba(11, 20, 26, 0.05);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.ngp-cancel-btn {
    border: 1px solid var(--ngp-border);
    background: var(--ngp-input-bg);
    color: var(--ngp-text);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.12s ease;
}

    .ngp-cancel-btn:hover {
        background: rgba(134, 150, 160, 0.22);
    }

    .ngp-cancel-btn:active {
        transform: scale(0.96);
    }

.grp-create-btn {
    width: auto;
    background: linear-gradient(135deg, #00b892 0%, #008069 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 5px 14px rgba(0, 168, 132, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.16s ease;
}

    .grp-create-btn:hover:not(:disabled) {
        filter: brightness(1.05);
        box-shadow: 0 7px 18px rgba(0, 168, 132, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.26);
        transform: translateY(-1px);
    }

    .grp-create-btn:active:not(:disabled) {
        transform: scale(0.97);
    }

    .grp-create-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        box-shadow: none;
    }

@keyframes ngpFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ngpSlideUp {
    from {
        transform: translateY(18px) scale(0.985);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes ngpChipPop {
    from {
        transform: scale(0.76);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
.ngp-row-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ngp-row-name {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ngp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ngp-row-sub {
    font-size: 12px;
    color: var(--ngp-muted);
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

.ngp-empty-search {
    text-align: center;
    padding: 36px 16px;
    font-size: 13.5px;
    color: var(--ngp-muted);
}