/* Reset */

:root {
    --bg: #fafafa;
    --text: #111111;
    --card: #ffffff;
    --border: #e5e5e5;
    --muted: #666666;
    --input-bg: #f5f5f5;
    --input-border: #dddddd;
    --following-bg: #e4e6eb;
    --following-text: #000000;
}

[data-theme="dark"] {
    --bg: #1C222B;
    --text: #FFFFFF;
    --card: #252C36;
    --border: #353E4A;
    --muted: #B8C0CC;
    --input-bg: #252C36;
    --input-border: #3A4552;
    --following-bg: #303744;
    --following-text: #FFFFFF;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

body{
     background: var(--bg);
    color: var(--text);
}

/* Top Bar */
.top-bar{
    width:100%;
    height:60px;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    padding:0 20px;
    border-bottom:1px  solid var(--border);
    background:var(--bg);
    gap: 8px;
}





.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 22px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: var(--text);
    letter-spacing: 1px;
    user-select: none;
    z-index: 1000;
}

/* Profile */
.profile-content {
width: 100%;
max-width: 440px;
min-width: 0;
margin: 8px auto 0;
padding: 0 16px 64px;
box-sizing: border-box;
}





/* Profile Image */
.profile-photo{
    width: 82px;
    height: 82px;
    margin:0;
    flex:0 0 82px;
}

.profile-photo img{
    display:block;
    width:100%;
    height:100%;
    border-radius:50%;
    object-fit:cover;
    border:3px solid var(--border);
    box-sizing: border-box;
}


.profile-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
}


/* Username and start area */
.profile-top-row .profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

/* Username beside the photo */
.profile-top-row .profile-info h2 {
    width: 100%;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 12px;
    text-align: left;
    overflow-wrap: anywhere;
}



/* Center Followers and Following */
.profile-top-row .follow-stats {
    display: flex;
    justify-content:space-around;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
}

.profile-top-row .follow-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

/* Bio */
.bio{
width: 100%;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
color: var(--muted);
font-size: 13px;
line-height: 1.45;
margin: 0 0 12px;
padding: 0;
white-space: pre-wrap;
overflow-wrap: anywhere;
word-break: normal;
text-align: left;
}


    /* Edit Button */
.edit-btn{
    width: 100%;
min-height: 36px;
padding: 8px 12px;
font-size: 13px;
font-weight: 600;
border: 1px solid var(--input-border);
border-radius: 8px;
background: var(--input-bg);
color: var(--text);
cursor: pointer;
}

.edit-btn:hover{
    background:var(--input-border);
}

.emoji-search-box {
    width: calc(90% - 40px);
    margin:  30px auto 0;
}

.search-bar {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
     margin-top: 30px;
}



.search-bar .search-icon {
    font-size: 17px;
    color: #C0C9E0;
}


.emoji-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
   
}

.emoji-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    transition: 0.2s;
}

.emoji-card:hover {
    transform: scale(1.03);
}

.emoji {
    font-size: 42px;
    margin-bottom: 10px;
}

.post-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}



.follow-btn {
width: 100%;
min-height: 36px;
padding: 8px 12px;
font-size: 13px;
font-weight: 600;
border: 1px solid var(--input-border);
border-radius: 8px;
background: var(--following-bg);
color: var(--following-text);
cursor: pointer;
transition: background-color 0.2s ease;
}

.follow-btn {
background: var(--input-border);
}

.follow-btn:hover {
    background-color: var(--input-border);
    transform: scale(1.03);
}

.follow-btn:active {
    transform: scale(0.98);
}


.following {
    background-color: var(--following-bg);
    color: var(--following-text);
}

.following:hover {
    background-color: var(--following-bg);
}



/* Followers and Following counts */
.follow-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    width: 100%;
    margin: 5px 0 12px;
}

.follow-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.follow-stats span {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
    color: var(--text);
}

.follow-stats small {
    font-size: 12px;
    color: var(--muted);
}



.updates-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;

    padding: 8px 14px;
    border-radius: 20px;

    transition: 0.2s ease;
}

.updates-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.updates-link:active {
    transform: scale(0.96);
}


.profile-tabs {
    display: flex;
    width: 100%;
    margin-top: 18px;
    border-bottom: 1px solid var(--border);
}

.profile-tab {
    flex: 1;
    height: 58px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;
    position: relative;
    transition: color 0.2s ease;
}

.tab-icon {
    font-size: 21px;
    line-height: 1;
}

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

.profile-tab:hover {
    color: var(--muted);
}

.profile-tab.active {
    color: var(--text);
}

.profile-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
  
}



/* Profile Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 100%;
}

.videos-grid .updates-item {
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    display: block;
}

.videos-grid .updates-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}



.tab-content {
    display: none;
}

.tab-content.active {
    display: grid;
}


.video-item {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
}



.video-item .updates-item {
    display: block;
    width: 100%;
    height: 100%;
}

.video-item .updates-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.video-item {
    position: relative;
}

.video-menu-btn {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.55);
    color: white;

    font-size: 22px;
    line-height: 28px;

    cursor: pointer;
    z-index: 10;
}

.video-menu {
    display: none;

    position: absolute;
    top: 45px;
    right: 8px;

    background: var(--card);
    border-radius: 8px;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);

    z-index: 20;
}

.video-menu.show {
    display: block;
}

.delete-video-btn {
    border: none;
    background: var(--card);

    color: red;

    padding: 12px 20px;

    font-size: 14px;
    cursor: pointer;
}  




.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;

    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);

    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-decoration: none;
    color: var(--muted);
    font-size: 12px;
    gap: 4px;
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;    
    align-items: center;
    font-size: 25px;
    line-height: 1;

}

.create-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4a7b9f;
    color: #ffffff;
    font-size: 25px;
    font-weight: 400;
}

.nav-item.active {
    color: var(--text);
}

.nav-profile-photo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}


.back-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.back-btn svg {
    display: block;
    width: 24px;
    height: 24px;
}   


.nav-profile-photo {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}




/* =========================
   EDIT PROFILE ONBOARDING
========================= */

.edit-profile-onboarding {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.onboarding-bubble {
    position: absolute;

    /* Place bubble above Edit Profile */
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-35%);

    width: 330px;
    padding: 18px 20px;

    background: #eef6ff;
    border: 1px solid #c8dcf5;
    border-radius: 22px;

    box-shadow: 0 4px 14px rgba(80, 130, 190, 0.25);

    z-index: 20;
}



/* Edit Profile onboarding — matching Moments */
.onboarding-bubble {
    position: relative;
    margin: 12px 0;
    padding: 14px;
    background: #15151b;
    color: #ffffff;
    border: 1px solid #7FAFD4;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.onboarding-bubble[hidden] {
    display: none;
}

.onboarding-bubble-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #C0C9E0;
}



.moments-onboarding {
    position: relative;
    margin: 12px 0;
    padding: 14px;
    background: #15151b;
    color: #ffffff;
    border: 1px solid #7FAFD4;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.moments-onboarding[hidden] {
    display: none;
}

.moments-onboarding-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #C0C9E0;
}

.moments-onboarding p {
    margin: 4px 0;
}






