﻿/* =========================================
   1. VARIABLES & RESET (X/Twitter Theme)
   ========================================= */
:root {
    --x-blue: #1d9bf0;
    --x-black: #0f1419;
    --x-dark-gray: #536471;
    --x-light-gray: #cfd9de;
    --x-border: #eff3f4;
    --x-hover: rgba(0, 0, 0, 0.03);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background-color: #fff;
    color: var(--x-black);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 60px; /* Space for bottom nav */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* =========================================
   2. MAIN LAYOUT & HEADER
   ========================================= */

/* The Sticky Top Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 53px; /* X standard height */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--x-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.header-title h1 {
    font-size: 17px;
    font-weight: 700;
}

/* The Feed Container */
.feed {
    max-width: 1080px; /* X timeline width */
    margin: 0 auto;
    padding-top: 53px; /* Match header height */
    border-left: 1px solid var(--x-border);
    border-right: 1px solid var(--x-border);
    min-height: 100vh;
}

/* =========================================
   3. POST / TWEET STYLING
   ========================================= */

.post {
    padding: 12px 16px;
    border-bottom: 1px solid var(--x-border);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .post:hover {
        background-color: var(--x-hover);
    }

/* --- Header Area (Avatar + Name) --- */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.avatar-wrapper {
    margin-right: 12px;
    flex-shrink: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-header-info {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 4px;
    overflow: hidden;
}

/* We style the span tags to look like: Name @handle · Time */
.username {
    font-weight: 700;
    font-size: 15px;
    color: var(--x-black);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.badge {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

.time {
    font-size: 15px;
    color: var(--x-dark-gray);
    white-space: nowrap;
}

    /* Create the dot separator visually if not in HTML */
    .time::before {
        content: "·";
        margin-right: 4px;
        margin-left: 4px;
    }

/* "More" (...) button */
.more-btn {
    color: var(--x-dark-gray);
    padding: 8px;
    margin: -8px; /* Increase hit area without moving visual center */
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

    .more-btn:hover {
        background-color: rgba(29, 155, 240, 0.1);
        color: var(--x-blue);
    }

    .more-btn img {
        width: 18px;
        height: 18px;
        opacity: 0.6;
    }

/* --- Content Area --- */
.post-content {
    /* Indent content to align with text, not avatar (52px = 40px avatar + 12px gap) */
    /* Note: If you want the avatar side-by-side with text, use margin-left. 
       If you want a stacked "Facebook/Insta" look, remove this margin. 
       X uses side-by-side. */
    margin-left: 52px;
    margin-top: -24px; /* Pull content up to sit next to avatar if HTML structure forces block */
    padding-bottom: 8px;
}

/* Correction for your specific HTML structure: 
   Since your Avatar and Name are in one div, and content in another, 
   we need to adjust spacing carefully. */
@media (min-width: 0px) {
    .post-header {
        margin-bottom: 4px;
    }

    .post-content {
        margin-left: 0; /* Reset for mobile friendliness on your specific HTML structure */
        margin-top: 0;
    }
}

.post-content p {
    font-size: 15px;
    color: var(--x-black);
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

.post-content strong {
    font-weight: 700;
}

.post-content a {
    color: var(--x-blue);
}

    .post-content a:hover {
        text-decoration: underline;
    }

/* --- Images / Media --- */
/* Rounded corners and border for media */
.media-full, .media-grid {
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--x-border);
}

    .media-full img, .media-full video {
        width: 100%;
        display: block;
        max-height: 600px;
        object-fit: cover;
    }

.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: #fff;
}

    .media-grid img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        aspect-ratio: 16 / 9;
    }

/* --- Action Bar (Bottom) --- */
.post-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    max-width: 425px; /* Keeps icons from spreading too far */
    width: 100%;
    /* Align with text if using indented layout, otherwise center */
    padding-left: 0;
}

    .post-bottom .icon {
        width: 18px;
        height: 18px;
        opacity: 0.6; /* Makes them gray */
        transition: transform 0.2s;
    }

    /* Hover effects for actions */
    .post-bottom img:hover {
        opacity: 1;
        transform: scale(1.1);
    }

/* --- Meta (Views / Top) --- */
.post-meta {
    display: none; /* Hide view count to clean up UI, remove if you want it */
}

/* =========================================
   4. NAVIGATION (Bottom Bar)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 53px;
    background: #fff;
    border-top: 1px solid var(--x-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

    .nav-btn img {
        width: 24px; /* Standard nav icon size */
        height: 24px;
    }
/* Layout columns */
.post {
    display: flex; /* Creates the side-by-side layout */
    flex-direction: row;
    gap: 12px;
}

.post-avatar-col {
    flex-shrink: 0; /* Prevents avatar from shrinking */
    width: 40px;
}

.post-content-col {
    flex: 1; /* Takes remaining space */
    min-width: 0; /* Prevents text overflow issues */
    padding-bottom: 4px;
}

/* Header line specific adjustments */
.post-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.2;
    margin-bottom: 2px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    overflow: hidden;
    white-space: nowrap;
}

.username {
    font-weight: 700;
    color: #0f1419;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-meta .dot {
    color: #536471;
}

/* Action Bar Tweaks */
.post-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    max-width: 80%; /* Don't span full width, like X */
}

.action-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #536471;
    transition: color 0.2s;
}

    .action-item .icon {
        width: 18px;
        height: 18px;
        filter: invert(39%) sepia(10%) saturate(632%) hue-rotate(167deg) brightness(96%) contrast(89%); /* Makes black SVG icons gray */
    }

/* Hover colors (Optional, for extra polish) */
.group-like:hover .icon {
    filter: invert(28%) sepia(93%) saturate(2421%) hue-rotate(334deg) brightness(91%) contrast(93%);
}
/* Pink */
.group-repost:hover .icon {
    filter: invert(65%) sepia(48%) saturate(464%) hue-rotate(76deg) brightness(95%) contrast(89%);
}
/* Green */
.group-comment:hover .icon {
    filter: invert(56%) sepia(85%) saturate(347%) hue-rotate(170deg) brightness(87%) contrast(90%);
}
/* Blue */