/* group-list.css - 群聊列表页面样式 */

.group-list-page.page-full-width {
    max-width: none;
    margin: 0;
    width: 100% !important;
    background-color: transparent;
}

#app[data-page="group-list"] {
    min-height: 100vh;
    --list-side-padding: var(--space-16);
    --avatar-radius: var(--radius-md);
}

.group-list-page {
    
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.conversation-header {
    position: sticky;
    top: 0;
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.conversation-header-title {
    flex: 1;
    text-align: center;
    font-size: var(--font-title);
    font-weight: 500;
    color: #111827;
    letter-spacing: 0.4px;
    margin-left: 26px;
}

.conversation-header-btn {
    border: none;
    background: none;
    color: #1f2937;
    font-size: 18px;
    font-weight: 500;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.conversation-header-btn.icon-button {
    width: 24px;
    height: 24px;
    border-radius: 0;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.conversation-header-btn:active {
    transform: scale(0.92);
}

.icon-plus {
    position: relative;
    width: 16px;
    height: 16px;
}
.icon-plus::before,
.icon-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 1.8px;
    background-color: currentColor;
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.icon-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.conversation-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 14px;
    width: 190px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    padding: 10px 0;
    backdrop-filter: blur(18px);
    z-index: 180;
}

.conversation-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    right: 18px;
    border-width: 0 8px 10px 8px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.98) transparent;
}

.conversation-menu-item {
    width: 100%;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    font-size: 15px;
    color: #1c1c1e;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.conversation-menu-item:active {
    transform: scale(0.97);
}

.conversation-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
}

.menu-icon-chat {
    background-color: rgba(0, 122, 255, 0.12);
    color: #007aff;
}

.menu-icon-chat::before {
    content: "群";
}

.menu-icon-contact {
    background-color: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.menu-icon-contact::before {
    content: "友";
}

.menu-icon-scan {
    background-color: rgba(88, 86, 214, 0.12);
    color: #5856d6;
}

.menu-icon-scan::before {
    content: "加";
}

.conversation-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 140;
}

.conversation-list-wrapper {
    padding: 0 0;
}

.conversation-search-wrapper {
    padding: 8px var(--list-side-padding) 0;
    background-color: rgba(255,255,255,0.7);
    backdrop-filter: blur(6px);
}

.conversation-search-wrapper input[type="search"] {
    width: 97%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: #f5f6f8;
    font-size: 14px;
    outline: none;
    text-align: center;
    background-image: url('../avatars/sousuo.png');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
    
    margin: 8px;
}

.conversation-search-wrapper input[type="search"]:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.14);
    border: none;
}

.conversation-search-wrapper input[type="search"]::placeholder {
    text-align: center;
    color: rgba(0,0,0,0.36);
}

.conversation-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.conversation-item {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--list-side-padding);
    background-color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background-color 0.2s, padding-left 0.3s ease, transform 0.1s ease;
}

.conversation-list.editing .conversation-item {
    padding-left: 60px;
    cursor: pointer;
}

.conversation-selection {
    position: absolute;
    left: -30px; /* Start hidden off-screen */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, left 0.3s ease; /* Animate left property */
}

.conversation-list.editing .conversation-selection {
    left: 18px; /* Slide into view */
}

.selection-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #007aff;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.conversation-item.selected .conversation-selection {
    border-color: #007aff;
}

.conversation-item.selected .selection-indicator {
    transform: scale(1);
}

.edit-mode-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    z-index: 100;
    box-sizing: border-box;
}

.delete-btn {
    border: none;
    background: none;
    color: #ff3b30;
    font-size: 16px;
    font-weight: 500;
    padding: 8px;
    cursor: pointer;
    margin-left: auto;
}

.delete-btn:disabled {
    color: #d1d1d6;
    cursor: not-allowed;
}

.conversation-item:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.conversation-item:hover {
    background-color: rgba(244, 244, 246, 0.8);
}

.conversation-avatar {
    margin-top: 0;
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: var(--avatar-radius);
    background-color: #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}

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

.avatar-initials {
    letter-spacing: 0.4px;
}

.conversation-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 2px;
    border-radius: 11px;
    background-color: #007aff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
}

.conversation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding-top: 0;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    padding-top: 0;
}

.conversation-name {
    font-size: var(--font-body);
    font-weight: 600;
    color: var(--text-primary-strong);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: var(--font-meta);
    color: #7a7f87;
    line-height: 1.35;
    white-space: nowrap;
}

.conversation-preview {
    flex: 1;
    font-size: var(--font-sub);
    color: var(--text-secondary-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-list {
    margin: 0px auto;
    max-width: 220px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
    line-height: 1.6;
}

.empty-list::before {
    content: '📪';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}
