/* css/lists.css */
/* List items, wish lists, user lists */

/* List Styles */
ul {
    list-style-type: none;
    padding: 0;
    max-height: min(300px, 50vh);
    overflow-y: auto;
    margin-bottom: 20px;
}

li {
    background-color: #fff;
    margin: 10px 0;
    padding: 15px;
    border-radius: 10px;
    font-size: clamp(1rem, 1vw + 0.8rem, 1.2em);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
    opacity: 1;
    min-height: 44px;
    transform-origin: top center;
    /* Aurora Wave setup */
    background: linear-gradient(135deg, 
        #fff 0%, 
        #fff 40%, 
        rgba(233, 30, 99, 0.05) 50%, 
        #fff 60%, 
        #fff 100%);
    background-size: 200% 200%;
    background-position: 0% 0%;
}

li:hover {
    background-position: 100% 100%;
    animation: auroraWave 3s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
    transform: translateY(-2px);
}

li:active {
    transform: translateY(0) scale(0.99);
}

/* List Item Addition Animation - Gift Box Pop */
.list-item-animate {
    animation: giftBoxBase 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Add lid animation to content - exclude .added-by and .wish-count */
.list-item-animate .wish-container > *:not(.added-by):not(.wish-count),
.list-item-animate .user-info-container,
.list-item-animate .member-info {
    animation: giftBoxLid 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ensure added-by appears smoothly without jumping */
.list-item-animate .added-by,
.list-item-animate .wish-count {
    animation: fadeIn 0.8s ease-out 0.3s both;
}

/* Link Indicator */
.link-indicator {
    font-size: 1.1em;
    color: #e91e63;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    margin-right: 4px;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.link-indicator:hover {
    color: #ad1457;
    animation: origamiFold 0.6s ease-in-out;
}

.link-indicator:active {
    color: #ad1457;
    transform: scale(0.95);
}

/* Passive Link Indicator (non-clickable, just shows links exist) */
.link-indicator.link-indicator-passive {
    cursor: default;
    pointer-events: none;
    color: #e91e63;
    opacity: 0.7;
    margin-right: 2px;
    min-width: 24px;
    min-height: 24px;
}

.link-indicator.link-indicator-passive:hover {
    animation: none;
    transform: none;
}

.link-indicator.link-indicator-passive .lucide {
    width: 16px;
    height: 16px;
}

/* Style for purchased wishes */
.purchased {
    text-decoration: line-through;
    color: gray;
}

/* Style for the wish container */
.wish-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Wish name - flexible text that wraps */
.wish-name {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .wish-container {
        gap: 8px;
    }
    
    .wish-name, .username {
        white-space: normal;
        word-break: break-word;
    }
    
    ul {
        max-height: min(250px, 40vh);
    }
}

/* Style for the wish count */
.wish-count {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.65em;
    color: #999;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Animate wish count changes */
.wish-count.updating {
    animation: hourglassSand 0.5s ease-out;
}

/* User list items don't need extra bottom padding (compact layout) */
#user-list li {
    padding-bottom: 15px;
}

/* Optional: Prevent text selection on wish-count */
.wish-count {
    user-select: none;
}

@media (max-width: 600px) {
    #user-list li {
        padding-bottom: 15px;
    }

    .wish-count {
        bottom: 5px;
        right: 8px;
        font-size: 0.6em;
    }
}

/* Style for the "Added by" info */
.added-by {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.65em;
    color: #999;
    user-select: none;
    white-space: nowrap;
}

/* Secret gift indicator - shows on wishes you added for others */
.secret-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65em;
    color: #9c27b0;
    background: rgba(156, 39, 176, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
}

.secret-indicator .lucide {
    width: 0.9em;
    height: 0.9em;
}

/* Empty state for wish lists */
.wish-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.wish-list-empty-icon {
    font-size: 3em;
    color: #e91e63;
    opacity: 0.6;
    margin-bottom: 15px;
}

.wish-list-empty-title {
    font-family: 'Pacifico', cursive;
    font-size: 1.3em;
    color: #e91e63;
    margin-bottom: 10px;
}

.wish-list-empty-text {
    font-size: 0.95em;
    color: #888;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

.wish-list-empty-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    font-size: 0.85em;
    color: #9c27b0;
    background: rgba(156, 39, 176, 0.08);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
}

/* Secret info banner - shown when viewing someone else's wish list */
.secret-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.08), rgba(233, 30, 99, 0.08));
    border: 1px solid rgba(156, 39, 176, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #7b1fa2;
    animation: fadeIn 0.3s ease-out;
}

.secret-info-banner .lucide {
    flex-shrink: 0;
    opacity: 0.8;
}

/* Admin info banner - shown when admin is viewing someone else's wish list */
.admin-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.08), rgba(0, 150, 136, 0.08));
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 15px;
    font-size: 0.85em;
    color: #1565c0;
    animation: fadeIn 0.3s ease-out;
}

.admin-info-banner .lucide {
    flex-shrink: 0;
    opacity: 0.8;
}

#wish-list li {
    padding-bottom: 30px;
    cursor: default; /* Wish items aren't directly clickable - use three-dot menu */
}

#wish-list li:hover {
    transform: none; /* Remove lift effect since not clickable */
}

#wish-list li:active {
    transform: none;
}

@media (max-width: 600px) {
    #wish-list li {
        padding-bottom: 28px;
    }

    .added-by {
        bottom: 5px;
        right: 8px;
        font-size: 0.6em;
    }
}

/* Text overflow handling for usernames */
.username {
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

/* User Info Container */
.user-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* User content styling - compact horizontal layout */
.user-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

/* Left side: name + badges */
.user-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.user-badges {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Right side: wish count */
.user-wish-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
    color: #888;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Mobile: allow badges to wrap below name */
@media (max-width: 480px) {
    .user-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .user-name {
        max-width: 100%;
    }
}

/* Group list item positioning */
#group-list li {
    position: relative;
    padding-right: 50px;
}

#group-list li.join-group-card {
    padding-right: 20px;
}

/* Group Management Modal List */
.group-members-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.group-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-username {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.member-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .group-member-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .member-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* User Right Container */
.user-right-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 10px;
    bottom: 5px;
}

.user-right-container .wish-count {
    position: static;
}

