/* ============================================================
   INSTAGRAM DM - iOS LIGHT MODE
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #000;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.ig-app {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    min-height: 100vh;
    padding-bottom: 90px;
    position: relative;
    overflow-y: auto;
}

.ig-app::-webkit-scrollbar { display: none; }

/* ---------- HEADER ---------- */
.ig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px 16px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.ig-header-left { width: 40px; }
.ig-header-right { width: 40px; display: flex; justify-content: flex-end; }

.ig-header-center {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.ig-username {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.3px;
}

.ig-chevron {
    width: 16px;
    height: 16px;
    fill: #000;
    margin-top: 3px;
}

.ig-edit-wrap {
    position: relative;
    display: inline-flex;
}

.ig-edit-icon {
    width: 24px;
    height: 24px;
    color: #000;
    stroke: #000;
}

.ig-notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #4CAF50;
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #fff;
}

/* ---------- SEARCH ---------- */
.ig-search-wrapper {
    padding: 4px 16px 14px 16px;
}

.ig-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #EFEFEF;
    border-radius: 10px;
    padding: 8px 12px;
    height: 36px;
}

.ig-search-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ig-search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: #000;
    width: 100%;
    font-family: inherit;
}

.ig-search-bar input::placeholder {
    color: #8e8e8e;
}

/* ---------- STORIES ROW ---------- */
.ig-stories {
    display: flex;
    gap: 18px;
    padding: 38px 16px 18px 16px;
    overflow-x: auto;
    white-space: nowrap;
    position: relative;
}

.ig-stories::-webkit-scrollbar { display: none; }

.ig-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
    min-width: 74px;
}

.ig-your-note {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 14px;
    padding: 6px 10px;
    font-size: 10px;
    color: #000;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 1px 8px rgba(0,0,0,0.12);
    white-space: normal;
    width: 82px;
    line-height: 1.2;
    z-index: 5;
}

.ig-story-circle {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.ig-your-story img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ig-your-story {
    padding: 2px;
    background: #fff;
    border: 2px solid #dbdbdb;
}

.ig-map-circle {
    background: #B3DFFF;
    font-size: 42px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-story-label {
    font-size: 12px;
    color: #000;
    font-weight: 400;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ig-story-sublabel {
    font-size: 10px;
    color: #8e8e8e;
    margin-top: -2px;
}

/* ---------- MESSAGES HEADER ---------- */
.ig-messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px 10px 16px;
}

.ig-messages-title {
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

.ig-requests {
    font-size: 15px;
    color: #0095F6;
    font-weight: 500;
    cursor: pointer;
}

/* ---------- CHAT LIST ---------- */
.ig-chat-list {
    padding: 0 16px 20px 16px;
}

.ig-chat-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    gap: 12px;
    cursor: pointer;
}

.ig-chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
}

.ig-chat-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-avatar-ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 2px;
    background: conic-gradient(from 45deg, #FFD600, #FF7A00, #FF0069, #D300C5, #7638FA, #FFD600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.ig-avatar-inner img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ig-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    background: #4CAF50;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ig-chat-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ig-chat-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ig-chat-name {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ig-verified {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.ig-muted {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 4px;
}

.ig-chat-preview {
    font-size: 13px;
    color: #8e8e8e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: 16px;
}

.ig-chat-preview.live-typing {
    color: #000;
    font-weight: 500;
}

.ig-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    padding-left: 8px;
}

.ig-chat-time {
    font-size: 12px;
    color: #8e8e8e;
}

.ig-unread-dot {
    width: 8px;
    height: 8px;
    background: #0095F6;
    border-radius: 50%;
}

/* ---------- FLOATING COMPOSE BUTTON ---------- */
.ig-fab {
    position: fixed;
    bottom: 100px;
    right: calc(50% - 195px);
    width: 52px;
    height: 52px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 14px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 20;
}

.ig-fab svg {
    width: 24px;
    height: 24px;
}

/* ---------- BOTTOM NAV ---------- */
.ig-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-top: 1px solid #EFEFEF;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0 20px 0;
    z-index: 30;
}

.ig-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    position: relative;
    cursor: pointer;
}

.ig-nav-item svg {
    width: 24px;
    height: 24px;
}

.ig-nav-badge {
    position: absolute;
    top: 3px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: #FF3040;
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.ig-profile-pic {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dbdbdb;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
    .ig-fab {
        right: 20px;
    }
}

@media (min-width: 481px) {
    .ig-fab {
        right: calc(50% - 195px);
    }
}