/* ===== Moments page styles ===== */

/* Page background: light aqua -> white gradient */
html, body {
    background: linear-gradient(to bottom, #d3f9f5 0%, #ffffff 35%, #ffffff 100%);
}

.app-container {
    background: linear-gradient(to bottom, #d3f9f5 0%, #ffffff 35%, #ffffff 100%);
}


.page-header {
    background: transparent;
}

/* Top tabs: inactive stays black (same size); active is purple and larger */
.page-header .tab-item {
    color: #000000;
    font-size: 18px; /* Match common.css default size to avoid shrinking/growing */
}

.page-header .tab-item.active {
    color: #8b5cf6;
    font-size: 20px;
}

.page-header .tab-item.active::after {
    background: #8b5cf6;
}





/* Fullscreen image viewer */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px); /* Frosted-glass feel */
}


.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* Moments list */

.moment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* Moment card: transparent to reveal gradient background, with subtle border */
.moment-item {
    background: transparent;

    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(17, 24, 39, 0.10);
    box-shadow: none;
}






/* Moment header */
.moment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.post-time {
    font-size: 12px;
    color: #9ca3af;
}

/* Add friend / follow button */
.add-friend-btn {
    width: 36px;
    height: 36px;
    background: #fbbf24;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.add-friend-btn .material-symbols-rounded {
    font-size: 22px;
    color: #ffffff;
    font-variation-settings: 'FILL' 1;
}

.add-friend-btn.followed {
    background: #e5e7eb;
}

.add-friend-btn.followed .material-symbols-rounded {
    color: #111827;
}


/* Moment content */
.moment-content {
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    margin-bottom: 12px;
}

/* Moment photos */
.moment-photos {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.moment-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Fallback for old WebView/browsers without aspect-ratio (avoid wrong height calc) */
@supports not (aspect-ratio: 1) {
    .moment-photos img {
        height: auto;
    }
}



/* Layout for 1/2/3/4/5/6+ images */
.photos-1 {
    grid-template-columns: 1fr;
}

.photos-1 img {
    aspect-ratio: 1;
}

.photos-2 {
    grid-template-columns: repeat(2, 1fr);
}

.photos-2 img {
    aspect-ratio: 1;
}

/* Layout for 3 images */
.photos-3 {
    grid-template-columns: repeat(3, 1fr);
}

.photos-3 img {
    aspect-ratio: 1;
}

.photos-4 {
    grid-template-columns: repeat(2, 1fr);
}

.photos-4 img {
    aspect-ratio: 1;
}

/* Layout for 5 images */
.photos-5 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* 6+ images: simple 3-column grid (show first 9) */
.photos-6 {
    grid-template-columns: repeat(3, 1fr);
}

.photos-6 img {
    aspect-ratio: 1;
}



.photos-5 img:nth-child(1),
.photos-5 img:nth-child(2),
.photos-5 img:nth-child(3) {
    aspect-ratio: 1;
}

.photos-5 img:nth-child(4) {
    grid-column: 1 / 3;
    aspect-ratio: 2 / 1;
}

.photos-5 img:nth-child(5) {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    aspect-ratio: 1;
}

/* Moment action buttons */
.moment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f3f4f6;
}


.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
}

.action-btn .material-symbols-rounded {
    font-size: 24px;
}

.action-btn .count {
    font-weight: 500;
}

.like-btn:active {
    color: #ef4444;
}

/* Liked state */
.like-btn.is-liked {
    color: #ef4444;
}

/* Insufficient balance alert (triggered by comment click) */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.alert-modal {
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    animation: alert-pop 0.2s ease-out;
}

@keyframes alert-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alert-content {
    padding: 24px 20px;
}

.alert-title {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
}

.alert-message {
    font-size: 14px;
    color: #999;
}

.alert-actions {
    display: flex;
    border-top: 1px solid #eee;
}

.alert-btn {
    flex: 1;
    padding: 12px 0;
    font-size: 17px;
    background: none;
    border: none;
    cursor: pointer;
}

.alert-btn.cancel {
    color: #000;
    border-right: 1px solid #eee;
}

.alert-btn.recharge {
    color: #007bff;
    font-weight: 500;
}

.alert-btn:active {
    background: #f9f9f9;
}

/* Responsive */
@media (max-width: 375px) {
    .moment-item {
        padding: 14px;
    }
    
    .user-avatar {
        width: 42px;
        height: 42px;
    }
    
    .moment-photos {
        gap: 5px;
    }
}

