/* ============================================================
   MOBILE MOMENTS & MEMORIES REVAMP
   Improved mobile UX for Moments, Memories, and Collections tabs
   ============================================================ */

/* --- Tab Bar --- */
.mm-tab-bar {
    display: flex;
    gap: 0;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #F0F0F0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mm-tab {
    flex: 1;
    padding: 14px 0 12px;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #B0B0B0;
    cursor: pointer;
    text-align: center;
    position: relative;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mm-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #EA794C;
    border-radius: 3px 3px 0 0;
    transition: width 0.25s ease;
}

.mm-tab.active {
    color: #EA794C;
}

.mm-tab.active::after {
    width: 40px;
}

/* --- Tab Content Panels --- */
.mm-tab-content {
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mm-tab-content.active {
    display: block;
}

/* --- Streak Progress Bar (compact) --- */
.mm-streak-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FFF8F5 0%, #FFFFFF 100%);
    border-bottom: 1px solid #F5F5F5;
}

.mm-streak-bar .streak-progress {
    width: 100%;
    max-width: 360px;
}

/* --- Date Section Headers --- */
.mm-date-header {
    padding: 20px 16px 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: -0.2px;
}

.mm-date-header:first-child {
    padding-top: 12px;
}

.mm-date-header-today {
    color: #EA794C;
}

/* --- Moments Grid (replaces horizontal scroll with grid) --- */
.mm-moments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 4px 3px;
}

.mm-moment-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mm-moment-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mm-moment-card-placeholder {
    width: 100%;
    height: 100%;
    background: #F4F4F4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mm-moment-card-placeholder .material-icons-outlined {
    font-size: 32px;
    color: #D0D0D0;
}

/* Moment overlay gradient for text legibility */
.mm-moment-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.mm-moment-location {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mm-moment-location .material-icons-outlined {
    font-size: 12px;
    flex-shrink: 0;
}

/* Video indicator badge */
.mm-moment-video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mm-moment-video-badge .material-icons-outlined {
    font-size: 12px;
}

/* User avatar on moment */
.mm-moment-avatar {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-size: cover;
    background-position: center;
    background-color: #F4F4F4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Moment creation button in grid */
.mm-moment-create {
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    background: linear-gradient(145deg, #FFF0E8 0%, #FFE0D0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    border: 2px dashed #F0A882;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mm-moment-create:active {
    transform: scale(0.96);
}

.mm-moment-create-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #EA794C;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(234, 121, 76, 0.3);
}

.mm-moment-create-icon .material-icons-outlined {
    font-size: 22px;
}

.mm-moment-create-label {
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #EA794C;
}

/* --- Memories Card Layout --- */
.mm-memories-list {
    padding: 12px 16px;
    padding-bottom: 100px;
}

.mm-memory-card {
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: inherit;
}

.mm-memory-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mm-memory-thumb {
    width: 110px;
    min-height: 110px;
    flex-shrink: 0;
    background: #F4F4F4;
    overflow: hidden;
}

.mm-memory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mm-memory-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8F8F8, #F0F0F0);
}

.mm-memory-thumb-placeholder .material-icons-outlined {
    font-size: 28px;
    color: #D0D0D0;
}

.mm-memory-info {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.mm-memory-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #1A1A1A;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.mm-memory-meta {
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.mm-memory-meta .material-icons-outlined {
    font-size: 13px;
    color: #B0B0B0;
}

.mm-memory-date {
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 12px;
    color: #757575;
    margin-top: 2px;
}

.mm-memory-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.mm-memory-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 12px;
    color: #999;
}

.mm-memory-stat .material-icons-outlined {
    font-size: 14px;
    color: #EA794C;
}

/* --- Empty States --- */
.mm-empty-state {
    text-align: center;
    padding: 48px 32px;
}

.mm-empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #FFF0E8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.mm-empty-state-icon .material-icons-outlined {
    font-size: 28px;
    color: #EA794C;
}

.mm-empty-state-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #1A1A1A;
    margin: 0 0 8px;
}

.mm-empty-state-text {
    font-family: 'SFProText', -apple-system, sans-serif;
    font-size: 14px;
    color: #999;
    line-height: 1.4;
    margin: 0;
}

/* --- Collections styling adjustments for this context --- */
.mm-collections-list {
    padding: 8px 16px;
    padding-bottom: 100px;
}

.mm-collections-list .coll-row {
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 4px;
}

.mm-collections-list .coll-row:active {
    background: #FFF4EF;
}

.mm-collections-list .coll-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 12px;
}

/* --- Horizontal moments shortcut strip (refined) --- */
.mm-moments-strip {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mm-moments-strip::-webkit-scrollbar {
    display: none;
}

.mm-strip-moment {
    flex-shrink: 0;
    width: 100px;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mm-strip-moment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Override legacy padding on tab content containers --- */
#memories-and-moments #my-memories,
#memories-and-moments #my-collections {
    padding: 0;
}

/* --- Utility: bottom safe area padding --- */
.mm-safe-bottom {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
