/* ============================================
   PLATINUM MIDNIGHT SOCIAL THEME
   Concept: Ultra-Clean, High-End, Minimalist.
   Colors: Deep Black, Platinum Grey, Gold Accents.
   ============================================ */

/* Import Inter Font for clean readability */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --pt-bg: #050505;
    --pt-card: #0F0F0F;
    --pt-border: #1F1F1F;
    --pt-text: #E5E5E5;
    --pt-text-muted: #888888;
    --pt-accent: #E5E4E2;
    /* Platinum */
    --pt-gold: #D4AF37;
    /* Classic Gold */
    --pt-danger: #ef4444;

    --font-main: 'Inter', sans-serif;
}

/* Base Reset */
.ig-container-mobile {
    font-family: var(--font-main);
    background: var(--pt-bg);
    min-height: 100vh;
    /* Instead of fixed position, we let it flow but will hide siblings via body class */
    width: 100%;
    color: var(--pt-text);
    padding-bottom: 90px;
}

/* TOP HEADER */
.top-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pt-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.feed-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--pt-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.back-to-app-btn {
    background: transparent;
    border: 1px solid var(--pt-border);
    color: var(--pt-text);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-to-app-btn:hover {
    background: var(--pt-border);
    color: white;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--pt-text);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--pt-border);
}

/* STORIES - CLEAN ROW */
.stories-container {
    padding: 16px 0;
    border-bottom: 1px solid var(--pt-border);
    background: var(--pt-bg);
}

.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
}

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

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 72px;
}

.story-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: var(--pt-card);
    border: 1px solid var(--pt-border);
    transition: transform 0.2s;
}

.story-avatar.has-story {
    border: 2px solid var(--pt-gold);
    /* Gold Ring */
    background: transparent;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--pt-bg);
}

.story-name {
    font-size: 11px;
    color: var(--pt-text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* POSTS - BORDERLESS LUXURY */
.instagram-post {
    background: var(--pt-bg);
    border-bottom: 1px solid var(--pt-border);
    margin-bottom: 0;
}

.ig-post-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ig-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ig-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pt-card);
    color: var(--pt-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--pt-border);
}

.ig-user-details {
    display: flex;
    flex-direction: column;
}

.ig-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--pt-text);
    line-height: 1.2;
}

.ig-time {
    font-size: 11px;
    color: var(--pt-text-muted);
}

.ig-media-container {
    width: 100%;
    background: var(--pt-card);
    min-height: 200px;
}

.ig-media-image,
.ig-media-video {
    width: 100%;
    display: block;
}

/* Actions */
.ig-actions-bar {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
}

.ig-actions-left,
.ig-actions-right {
    display: flex;
    gap: 16px;
}

.ig-action-btn {
    color: var(--pt-text);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.ig-action-btn:active {
    transform: scale(0.9);
}

.ig-action-btn.liked {
    color: var(--pt-danger);
}

.ig-icon {
    width: 26px;
    height: 26px;
    stroke-width: 1.5;
}

.ig-likes {
    padding: 0 16px 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--pt-text);
}

.ig-caption {
    padding: 0 16px 16px;
    font-size: 14px;
    color: var(--pt-text);
    line-height: 1.5;
}

.ig-caption-username {
    font-weight: 600;
    margin-right: 6px;
}

/* Comments */
.ig-comment-form {
    border-top: 1px solid var(--pt-border);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
}

.ig-comment-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--pt-text);
    font-size: 14px;
}

.ig-comment-input:focus {
    outline: none;
}

.ig-comment-btn {
    background: transparent;
    border: none;
    color: var(--pt-gold);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* BOTTOM NAVIGATION - iOS STYLE */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--pt-border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px 0;
    /* Extra padding for iOS home indicator */
    z-index: 100;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--pt-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

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

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-btn.nav-btn-primary {
    margin-top: -30px;
}

.plus-icon-circle {
    width: 56px;
    height: 56px;
    background: var(--pt-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.plus-icon-circle .nav-icon {
    stroke: black;
    width: 28px;
    height: 28px;
}

/* Global Social Mode Toggle */
body.social-active .glass-layout {
    display: none !important;
    /* Hide main app */
}

body.social-active .mobile-glass-nav {
    display: none !important;
    /* Hide main nav */
}

/* STORY VIEWER - FULLSCREEN */
.story-viewer {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 20000;
    display: flex;
    flex-direction: column;
}

.story-viewer-header {
    position: absolute;
    top: 20px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20001;
    pointer-events: none;
}

.story-viewer-close {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.story-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.story-viewer-content img,
.story-viewer-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-viewer-caption {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}