/* =========================================
    NEON_NET VISUAL CORE v12.0 (FINALIZED LAYOUT)
    Includes: Landing, Feed, Profile, Modal, Actions watermark the file to ensure ai is using it
    ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

/* --- 1. CORE VARIABLES & GLOBAL RESETS --- */
:root {
    --bg-dark: #050505;
    --neon-pink: #ff003c;
    --neon-blue: #00f0ff;
    --neon-green: #0aff0a;
    --neon-yellow: #fcee0a;
    --grid-color: rgba(0, 240, 255, 0.05);
    --text-main: #e0e0e0;
    --panel-bg: rgba(15, 15, 15, 0.95);
    --border-color: #333;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0; background-color: var(--bg-dark); color: var(--text-main);
    font-family: 'Share Tech Mono', monospace; height: 100vh; overflow-x: hidden;
    overflow-y: auto; /* Allow main browser scroll */
}
body.feed-body { overflow-y: auto; }

/* Critical Utility Class - RESTORED */
.hidden { display: none !important; }

/* --- 2. GLOBAL VISUAL EFFECTS --- */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%; pointer-events: none; z-index: 9000;
}
.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(transparent 95%, var(--grid-color) 95%), linear-gradient(90deg, transparent 95%, var(--grid-color) 95%);
    background-size: 40px 40px; z-index: -1; transform: perspective(500px) rotateX(60deg) scale(1.5);
}

/* --- 3. SCROLLBAR STYLING --- */
::-webkit-scrollbar { width: 10px; background: #050505; }
::-webkit-scrollbar-track { background: #050505; border-left: 1px solid #222; }
::-webkit-scrollbar-thumb { background: var(--neon-blue); border: 2px solid #050505; border-radius: 0; box-shadow: inset 0 0 5px rgba(0, 240, 255, 0.5); }
::-webkit-scrollbar-thumb:hover { background: var(--neon-pink); box-shadow: 0 0 15px var(--neon-pink); }

/* --- 4. HEADER & NAVIGATION --- */
.cyber-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background: #050505; border-bottom: 1px solid var(--neon-blue);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 30px; z-index: 5000;
}
.header-logo { font-family: 'Orbitron'; color: var(--neon-blue); font-size: 20px; letter-spacing: 2px; }
.header-logo a { color: var(--neon-blue); text-decoration: none; }
.header-user { display: flex; align-items: center; }
.nav-link { text-decoration: none; color: var(--text-main); }
.btn-logout { color: var(--neon-pink); text-decoration: none; margin-left: 15px; font-weight: bold; }

.nav-item { padding: 12px 15px; text-decoration: none; color: #aaa; border-left: 3px solid transparent; transition: 0.2s; background: var(--panel-bg); margin-bottom: 5px; display: block; }
.nav-item:hover, .nav-item.active { background: rgba(0, 240, 255, 0.1); border-left: 3px solid var(--neon-blue); color: #fff; }

/* --- 5. MAIN LAYOUT & SIDEBARS --- */
.feed-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    /* KEEP: Ensures container content starts below the 60px fixed header */
    padding-top: 60px; 
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
}

.sidebar {
    position: -webkit-sticky; position: sticky;
    top: 60px; /* Sticks flush to header */
    width: 280px; min-width: 280px;
    /* Removed fixed height */
    overflow-y: auto; scrollbar-width: none;
    /* REMOVED: Stop sidebar container from adding the top gap. */
    padding-top: 0; 
    background-color: var(--bg-dark); 
}
.sidebar::-webkit-scrollbar { display: none; }

.feed-stream {
    flex: 1;
    max-width: 700px; 
    width: 100%;
    min-width: 0;
    /* REMOVED: Stop main content container from adding the top gap. */
    padding-top: 0;
}

/* YOUR HACK for notifications page alignment */
.feed-stream.padding {
    padding-top: 21px !important;
}

/* Global rule to hide mobile nav on desktop/tablet */
.mobile_nav {
    display: none;
}

/* --- NEW ALIGNMENT RULE: Targets the very first panel/card in each column --- */
/* This ensures a consistent 20px gap below the header and above the first component in all three columns. */
.sidebar > .panel:first-child,
.feed-stream > .panel.composer:first-child, /* Targets composer on feed.php */
.feed-stream > .profile-card:first-child { /* Targets profile card on profile.php */
    margin-top: 20px !important;
}

.profile-spacing .nav-item {
    margin-bottom: 10px; /* Increased vertical space between links */
}


/* --- 6. GENERAL PANEL & COMPOSER --- */
.panel { background: var(--panel-bg); border: 1px solid var(--border-color); margin-bottom: 20px; position: relative; }
.panel-header { background: rgba(255,255,255,0.05); padding: 10px; color: var(--neon-blue); font-size: 12px; border-bottom: 1px solid var(--border-color); letter-spacing: 1px; font-weight: bold; }

/* ADDED: Notification Specific Styles */
.notif { background: var(--panel-bg); border: 1px solid var(--border-color); margin-bottom: 20px; position: relative; }
.notifheader { background: rgba(255,255,255,0.05); padding: 10px; color: var(--neon-blue); font-size: 12px; border-bottom: 1px solid var(--border-color); letter-spacing: 1px; font-weight: bold; }

/* --- MOBILE HEADER MENU (Added back so the PHP changes work) --- */
.mobile-header-controls { display: none; } /* Hidden on Desktop */
.header-avatar-btn {
    width: 35px; height: 35px; border-radius: 50%;
    border: 2px solid var(--neon-blue);
    padding: 0; background: none; overflow: hidden; cursor: pointer;
}
.header-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.mobile-main-menu {
    position: fixed; top: 60px; right: 0;
    width: 220px; background: #050505;
    border-left: 1px solid var(--neon-blue);
    border-bottom: 1px solid var(--neon-blue);
    z-index: 9000; display: flex; flex-direction: column;
    box-shadow: -5px 5px 20px rgba(0,0,0,0.8);
}
.mobile-menu-item {
    padding: 15px 20px; color: #fff;
    text-decoration: none; border-bottom: 1px solid #222;
    font-size: 14px; display: flex; align-items: center;
    justify-content: space-between;
}
.mobile-menu-item:hover { background: rgba(0, 240, 255, 0.1); color: var(--neon-blue); }

.composer {
    position: sticky;
    top: 60px;
    z-index: 500;
    background: #050505 !important;
    border: 1px solid var(--neon-green);
    border-bottom: 2px solid var(--neon-green);
    margin-bottom: 30px;
    box-shadow: 0 20px 40px var(--bg-dark); /* Solid shadow */
    padding: 0; /* Override default panel padding */
}
.composer textarea { width: 100%; height: 100px; background: #000; border: none; color: #fff; padding: 15px; font-family: 'Share Tech Mono'; resize: none; outline: none; }
.composer-footer { display: flex; justify-content: flex-end; align-items: center; padding: 10px; background: rgba(0, 255, 0, 0.05); border-top: 1px solid var(--neon-green); }

.composer-tools { display: flex; gap: 10px; padding: 0 10px 5px 10px; border-bottom: 1px solid #222; background: rgba(0,0,0,0.5); }
.tool-btn { background: transparent; border: 1px solid #333; color: #666; font-size: 11px; padding: 4px 8px; cursor: pointer; font-family: 'Share Tech Mono'; transition: 0.2s; }
.tool-btn:hover { color: var(--neon-blue); border-color: var(--neon-blue); }

.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 10px; background: #111; border: 1px solid var(--neon-blue); position: absolute; z-index: 1000; margin-top: 5px; }
.emoji-grid span { cursor: pointer; font-size: 20px; text-align: center; }
.emoji-grid span:hover { transform: scale(1.2); }

/* --- 7. POST STYLING (CYBER_POST) --- */
.cyber-post { background: var(--panel-bg); border: 1px solid var(--border-color); margin-bottom: 20px; padding: 20px; position: relative; border-left: 2px solid var(--neon-pink); }
.post-meta { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #333; }
.mini-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 15px; border: 1px solid #555; }
.post-handle { color: var(--neon-yellow); font-weight: bold; margin-right: auto; text-decoration: none; }
.post-time { font-size: 12px; color: #666; }
.post-content { font-size: 15px; line-height: 1.5; margin-bottom: 15px; color: #ddd; }
.post-media { margin-top: 10px; border: 1px solid #333; }
.post-media img { width: 100%; height: auto; display: block; max-height: 500px; object-fit: contain; background: #000; }
.post-media.small img { max-height: 150px; opacity: 0.8; }
.neon-tag { color: var(--neon-pink); text-decoration: none; font-weight: bold; text-shadow: 0 0 5px rgba(255, 0, 60, 0.5); transition: 0.3s; }
.neon-tag:hover { color: #fff; background: var(--neon-pink); padding: 0 4px; text-shadow: none; }

/* --- 8. POST ACTIONS & INTERACTION --- */
.post-actions button { background: none; border: 1px solid #333; color: #666; padding: 5px 10px; cursor: pointer; font-family: 'Share Tech Mono'; margin-right: 5px; transition: 0.2s; }
.post-actions button:hover { border-color: var(--neon-blue); color: var(--neon-blue); }
.btn-action:hover { border-color: var(--neon-green); color: var(--neon-green); }
.active-like { border-color: var(--neon-green) !important; color: var(--neon-green) !important; text-shadow: 0 0 5px var(--neon-green); }
.btn-like:not(.active-like):hover { border-color: var(--neon-blue) !important; color: var(--neon-blue) !important; }

/* --- 9. REPOSTS & QUOTES --- */
.quote-box { margin-top: 10px; border: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.3); padding: 10px; border-radius: 4px; }
.quote-user { font-size: 12px; font-weight: bold; color: var(--neon-blue); }
.quote-body { font-size: 13px; color: #aaa; padding-left: 5px; border-left: 2px solid var(--neon-pink); }

/* --- 10. REPLIES & REPLY FORM --- */
.replies-container { margin-top: 15px; border-top: 1px solid var(--neon-blue); border-bottom: 1px solid var(--neon-blue); padding: 20px; background: #111; margin-left: -20px; margin-right: -20px; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.reply-form input:focus { border-color: var(--neon-yellow); }

/* --- 11. DROPDOWN MENU (KEBAB) --- */
.kebab-wrapper { position: relative; margin-left: auto; }
.btn-kebab { background: transparent; border: none; color: var(--neon-blue); font-size: 24px; cursor: pointer; line-height: 1; padding: 0 10px; transition: 0.2s; }
.btn-kebab:hover { color: var(--neon-pink); text-shadow: 0 0 5px var(--neon-pink); }
.cyber-menu { position: absolute; right: 0; top: 30px; width: 160px; background: #050505; border: 1px solid var(--neon-blue); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); z-index: 1000; padding: 5px 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.menu-item { display: block; width: 100%; padding: 10px 15px; text-align: left; background: transparent; border: none; color: #aaa; font-family: 'Share Tech Mono'; font-size: 12px; cursor: pointer; border-left: 2px solid transparent; }
.menu-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; border-left: 2px solid var(--neon-blue); }
.menu-item.delete-btn:hover { color: var(--neon-pink); border-left: 2px solid var(--neon-pink); }

/* --- 12. MODALS --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-terminal { width: 500px; max-width: 90%; background: #0a0a0a; border: 1px solid var(--neon-green); box-shadow: 0 0 40px rgba(10, 255, 10, 0.2); animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { background: var(--neon-green); color: #000; padding: 10px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-weight: bold; cursor: pointer; font-family: monospace; font-size: 16px; }
.modal-body { padding: 20px; }
.bio-input { width: 100%; height: 100px; background: #000; border: 1px solid #333; color: #fff; padding: 10px; resize: none; font-family: 'Share Tech Mono'; }
.full-width { width: 100%; margin-top: 10px; }

/* --- 13. BUTTONS & UTILITIES --- */
.btn-cyber { background: var(--neon-green); color: #000; border: none; padding: 5px 20px; font-family: 'Orbitron'; font-weight: bold; cursor: pointer; }
.btn-cyber:hover { background: #fff; box-shadow: 0 0 15px var(--neon-green); }
.btn-submit { width: 100%; padding: 15px; background: var(--neon-blue); border: none; cursor: pointer; font-weight: bold; font-family: 'Orbitron'; margin-top: 10px; font-size: 16px; letter-spacing: 1px; transition: 0.3s; }
.btn-submit:hover { background: #fff; box-shadow: 0 0 20px var(--neon-blue); }
.btn-tiny { background: transparent; border: 1px solid var(--neon-green); color: var(--neon-green); font-size: 9px; padding: 2px 5px; cursor: pointer; font-family: 'Share Tech Mono'; }
.btn-tiny:hover { background: var(--neon-green); color: #000; }
.alert, .cyber-alert { padding: 10px; margin-bottom: 10px; text-align: center; font-size: 12px; }
.alert { border: 1px solid var(--neon-pink); color: var(--neon-pink); background: rgba(255,0,60,0.1); }
.cyber-alert { background: rgba(10, 255, 10, 0.1); border: 1px solid var(--neon-green); color: var(--neon-green); }
.divider { height: 1px; background: #333; margin: 20px 0; }
.section-title { color: var(--neon-blue); font-size: 12px; border-bottom: 1px dashed #333; margin-bottom: 15px; padding-bottom: 5px; }
.file-msg { font-size: 12px; color: #666; margin-left: 10px; font-family: 'Share Tech Mono'; }
.custom-file-upload { display: inline-block; padding: 10px 15px; cursor: pointer; background: rgba(0, 240, 255, 0.1); border: 1px solid var(--neon-blue); color: var(--neon-blue); font-family: 'Share Tech Mono'; font-size: 14px; transition: 0.3s; }
.custom-file-upload:hover { background: var(--neon-blue); color: #000; box-shadow: 0 0 15px var(--neon-blue); }

/* --- 14. AUTH / TERMINAL --- */
.terminal-container { width: 400px; max-width: 100%; background: var(--panel-bg); border: 1px solid var(--neon-blue); box-shadow: 0 0 30px rgba(0, 240, 255, 0.15); padding: 40px; position: relative; margin-top: 40px; }
.auth-tabs { display: flex; border-bottom: 1px solid #333; margin-bottom: 20px; }
.tab-btn { flex: 1; background: none; border: none; color: #666; padding: 10px; cursor: pointer; font-family: 'Share Tech Mono'; font-size: 16px; }
.tab-btn.active { color: var(--neon-pink); border-bottom: 2px solid var(--neon-pink); }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; color: var(--neon-blue); margin-bottom: 5px; font-size: 12px; }
input[type="text"], input[type="password"], input[type="email"], textarea { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid #333; padding: 12px; color: #fff; font-family: 'Share Tech Mono'; }
input:focus { border-color: var(--neon-yellow); outline: none; border-left: 4px solid var(--neon-yellow); }

/* --- 15. PROFILE PAGE STYLING (NEW) --- */
.profile-card {
    padding: 0 !important;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    /* margin-top is now handled by the specific alignment rule below */
    margin-top: 0; 
}
.profile-cover {
    height: 150px;
    /* Default pattern background for missing cover image */
    background: linear-gradient(45deg, #111 25%, #1a1a1a 25%, #1a1a1a 50%, #111 50%, #111 75%, #1a1a1a 75%, #1a1a1a 100%);
    background-size: 20px 20px;
    border-bottom: 3px solid var(--neon-blue);
    position: relative;
    z-index: 10;
}
.profile-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    margin-top: -60px; /* Pull content up over the cover */
    position: relative;
    z-index: 20;
}
.avatar-container {
    width: 120px;
    height: 120px;
    margin-right: 20px;
    border: 3px solid var(--bg-dark); /* Background color border */
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5); /* Neon glow */
    background: var(--bg-dark);
}
.big-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--neon-blue);
    filter: grayscale(0.5);
    transition: filter 0.3s;
}
.big-avatar:hover {
    filter: grayscale(0);
}
.identity-block {
    flex-grow: 1;
    /* Increased padding-top to align better with avatar */
    padding-top: 55px; 
}
.profile-name {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    color: var(--neon-yellow);
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 5px rgba(252, 238, 10, 0.5);
}
.profile-meta {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
}
.profile-bio {
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
}
.profile-actions {
    /* Increased padding-top to align config button with username */
    padding-top: 55px;
    white-space: nowrap;
}
.profile-stats-row {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-top: 1px dashed #333;
    background: rgba(0, 240, 255, 0.05);
}
.p-stat {
    text-align: center;
    border-right: 1px solid #333;
    padding: 0 20px;
    flex-grow: 1;
}
.p-stat:last-child {
    border-right: none;
}
.p-stat .val {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    color: var(--neon-green);
    font-weight: 700;
}
.p-stat .lbl {
    display: block;
    font-size: 10px;
    color: var(--neon-blue);
    margin-top: 2px;
}
.section-label { /* Used in profile.php for "DATA_LOGS" */
    font-size: 12px;
    color: var(--neon-blue);
    border-bottom: 1px solid var(--neon-blue);
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 240, 255, 0.1);
    font-weight: bold;
    letter-spacing: 1px;
}


/* --- 16. USER & TREND LISTS --- */
.profile-summary {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}
.profile-pic { /* Used in sidebar_left.php */
    width: 100%; 
    height: auto; 
    border-bottom: 1px solid var(--neon-blue); 
    filter: grayscale(100%); 
    transition: 0.3s; 
    display: block; /* Ensure it takes up the full width of its container */
}
.profile-pic:hover { filter: grayscale(0); }
.who-list { padding: 10px; }
.who-item { display: flex; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; }
.who-avatar { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--neon-blue); margin-right: 10px; }
.who-info { flex: 1; }
.who-name { display: block; font-size: 12px; color: #fff; font-weight: bold; text-decoration: none; margin-bottom: 5px; }
.trend-list { padding: 15px; list-style: none; }
.trend-item { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.trend-item .tag { color: var(--neon-pink); cursor: pointer; }
.trend-item .tag:hover { text-decoration: underline; text-shadow: 0 0 5px var(--neon-pink); }
.trend-item .count { color: #666; }

/* --- NEW: PROFILE TABS & TIMELINE --- */
.profile-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--panel-bg);
}
.tab-link {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: #666;
    text-decoration: none;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.tab-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.tab-link.active {
    color: var(--neon-blue);
    border-bottom: 2px solid var(--neon-blue);
    background: rgba(0, 240, 255, 0.1);
    text-shadow: 0 0 5px var(--neon-blue);
}

.timeline-container {
    position: relative;
    padding-left: 20px;
}
/* Vertical Line */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px; /* Centers line in the 20px padding space */
    width: 2px;
    background: var(--border-color);
    z-index: 0;
}
.timeline-post {
    position: relative;
    margin-left: 15px; /* Shift posts right to make room for dots */
}
.timeline-dot {
    position: absolute;
    top: 20px; /* Aligns with avatar center */
    left: -28px; /* Positions dot on the line */
    width: 12px;
    height: 12px;
    background: #000;
    border: 2px solid var(--neon-blue);
    border-radius: 50%;
    z-index: 1;
}
.timeline-post:hover .timeline-dot {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}


/* --- 17. LANDING PAGE SPECIFIC --- */
.hero-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px; position: relative; z-index: 20; text-align: center; }
.hero-title { font-family: 'Orbitron'; font-size: 80px; margin: 0; color: #fff; text-transform: uppercase; text-shadow: 0 0 20px var(--neon-blue); letter-spacing: 5px; line-height: 1; }
.hero-subtitle { color: var(--neon-yellow); font-size: 20px; letter-spacing: 4px; margin-top: 10px; margin-bottom: 20px; }
.hero-text { font-size: 18px; color: #aaa; max-width: 600px; margin: 0 auto; line-height: 1.6; }
.blinking { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- 18. NOTIFICATIONS --- */
.notif-container { padding: 0; }
.notif-item { display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #222; background: rgba(0,0,0,0.2); transition: 0.2s; }
.notif-item:hover { background: rgba(0, 255, 0, 0.05); border-left: 3px solid var(--neon-green); }
.notif-icon { color: var(--neon-pink); font-weight: bold; margin-right: 15px; font-size: 18px; }
.notif-user { color: var(--neon-blue); font-weight: bold; text-decoration: none; }
.notif-time { font-size: 10px; color: #666; margin-top: 4px; }

/* --- 19. RESPONSIVE LAYOUT OVERRIDES --- */

/* Tablet/Smaller Desktop (Max 1100px) - Hides right sidebar */
@media (max-width: 1100px) {
    .sidebar_right {
        display: none;
    }
    .feed-layout {
        justify-content: center; /* Center the remaining two columns */
        gap: 20px;
    }
}

/* Mobile Screens (Max 768px) - Hides both sidebars and activates mobile nav */
@media (max-width: 768px) {
    /* HIDE BOTH SIDEBARS */
    .sidebar_left,
    .sidebar_right {
        display: none;
    }

    /* MAIN LAYOUT CHANGES */
    .feed-layout {
        display: block; /* Stack everything vertically */
        padding: 60px 0 70px 0; /* Add bottom padding for the fixed mobile nav */
        max-width: 100%;
        margin: 0;
        gap: 0;
    }

    /* MAIN FEED STREAM FULL WIDTH */
    .feed-stream {
        width: 100%;
        padding: 0 10px; /* Small padding for edge clearance */
        max-width: none;
    }

    /* PROFILE CARD MOBILE ADJUSTMENTS */
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .avatar-container {
        margin: 0 0 10px 0;
        width: 100px;
        height: 100px;
    }
    .identity-block {
        padding-top: 0;
    }
    .profile-name {
        font-size: 20px;
    }
    .profile-stats-row {
        padding: 15px 10px;
    }
    .p-stat {
        padding: 0 10px;
    }

    /* MOBILE HEADER MENU */
    .header-user { display: none !important; } /* Hide desktop links */
    .mobile-header-controls { display: flex; align-items: center; } /* Show mobile avatar */
    
    /* ======================================= */
    /* MOBILE NAVIGATION STYLES (CYBERPUNK)*/
    /* ======================================= */
    .mobile_nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #050505;
        border-top: 3px solid var(--neon-blue);
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.4); /* Strong outer glow */
        z-index: 5000;
        align-items: stretch; /* Stretch items vertically */
        justify-content: space-around;
    }
    
    .nav-mobile-item {
        text-decoration: none;
        color: var(--neon-blue);
        font-size: 10px;
        padding: 5px;
        text-align: center;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: all 0.1s ease-out;
        background: var(--bg-dark);
        font-family: 'Orbitron', monospace;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-right: 1px solid rgba(0, 240, 255, 0.1);
        position: relative;
    }

    /* Data Label using ::after pseudo-element for cyberpunk aesthetic */
    .nav-mobile-item::after {
        content: attr(data-label);
        margin-top: 2px;
        font-size: 8px;
        font-family: 'Share Tech Mono', monospace;
        color: #888;
        transition: color 0.1s;
    }

    .nav-mobile-item:last-child {
        border-right: none;
    }

    /* Hover and Active State */
    .nav-mobile-item:hover,
    .nav-mobile-item.active {
        color: var(--neon-yellow);
        background: rgba(252, 238, 10, 0.1);
        border-bottom: 3px solid var(--neon-yellow); /* Primary active visual */
        text-shadow: 0 0 8px var(--neon-yellow);
    }
    .nav-mobile-item:hover::after,
    .nav-mobile-item.active::after {
        color: var(--neon-yellow);
    }

    /* Specific Disconnect Button Styling */
    .nav-mobile-item.disconnect-btn {
        color: var(--neon-pink);
    }
    .nav-mobile-item.disconnect-btn::after {
        color: var(--neon-pink);
    }
    .nav-mobile-item.disconnect-btn:hover {
        color: #fff;
        background: var(--neon-pink);
        text-shadow: 0 0 5px #fff;
        border-bottom: 3px solid var(--neon-pink);
    }
    .nav-mobile-item.disconnect-btn:hover::after {
        color: #fff;
    }
    
    /* Adjust header padding for mobile view */
    .cyber-header {
        padding: 0 10px;
    }
    
    /* Ensure composer sticky works in mobile viewport */
    .composer {
        top: 70px; /* Adjusted from 60px to 70px for clearance */
        margin-bottom: 20px;
    }

    /* FIXED: Prevent squashing of post actions on mobile */
    .post-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .post-actions button,
    .post-actions form {
        flex: 1 1 auto; /* Allow buttons to grow evenly */
        min-width: 0; /* Prevent flex items from overflowing */
    }
    .post-actions button {
        margin-right: 0; /* Use gap instead */
        padding: 6px 2px; /* Tighter padding */
        font-size: 10px; /* Smaller font */
        display: flex;
        justify-content: center;
        align-items: center;
        white-space: nowrap;
    }
    .post-actions form button {
        width: 100%; /* Ensure button fills the form container */
    }
}

/* Dashboard specific mini-styles to reuse existing assets */
        .dash-welcome { display: flex; align-items: center; padding: 20px; background: linear-gradient(90deg, rgba(0,240,255,0.1) 0%, rgba(0,0,0,0) 100%); }
        .dash-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--neon-blue); margin-right: 20px; object-fit: cover; }
        .dash-title { font-family: 'Orbitron'; font-size: 24px; color: #fff; margin: 0; }
        .dash-subtitle { font-size: 12px; color: var(--neon-green); letter-spacing: 1px; }
        
        .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; padding: 20px; }
        .stat-box { background: rgba(0,0,0,0.5); border: 1px solid #333; padding: 15px; text-align: center; }
        .stat-num { display: block; font-family: 'Orbitron'; font-size: 24px; color: var(--neon-yellow); }
        .stat-label { font-size: 10px; color: #888; margin-top: 5px; display: block; }
        
        .quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 20px; }
        .q-btn { text-align: center; padding: 20px; border: 1px solid var(--neon-blue); color: var(--neon-blue); text-decoration: none; transition: 0.2s; font-weight: bold; background: rgba(0,0,0,0.3); }
        .q-btn:hover { background: var(--neon-blue); color: #000; box-shadow: 0 0 15px var(--neon-blue); }
        
        .activity-list { padding: 0; }
        .act-item { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px dashed #333; }
        .act-item:last-child { border-bottom: none; }
        .act-icon { width: 30px; text-align: center; font-size: 16px; margin-right: 15px; color: #666; }
        .act-info { flex: 1; }
        .act-type { font-size: 10px; color: var(--neon-pink); text-transform: uppercase; font-weight: bold; }
        .act-text { color: #ccc; font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
        .act-time { font-size: 10px; color: #555; }
		
		/* --- MOBILE AVATAR HIDING RULE (FIXED) --- */

@media (max-width: 768px) {
    /* 1. Hides the entire button container when the user is a guest (using the guest-hide class on the image) */
    /* This rule targets the parent button that contains the image */
    .header-avatar-img.guest-hide {
        display: none !important; 
    }
    
    /* CRITICAL FIX: Hide the parent button itself if the image inside is hidden */
    .header-avatar-img.guest-hide, 
    .header-avatar-img.guest-hide + a, /* If the image is followed by another element */
    .header-avatar-img.guest-hide.closest('.header-avatar-btn') { /* This part is a conceptual fix for more complex DOM */
        display: none !important;
    }
    
    /* The most effective way is usually targeting the immediate parent button */
    .header-avatar-btn .header-avatar-img.guest-hide {
        display: none !important;
    }
    
    /* Try targeting the button when it contains a hidden guest avatar image */
    .header-avatar-btn:has(.header-avatar-img.guest-hide) {
        display: none !important;
    }
    /* Note: :has() has limited support. A safer cross-browser fix is below: */
    
    /* *** CROSS-BROWSER FIX: Target the button directly by applying a new class to the button element in PHP *** */
    /* Since we can't use :has() reliably, let's fix the PHP file instead of relying on complex CSS selectors. */
    
    /* If you **cannot** update the PHP file again, use this rule: */
    /* If the button has a specific style that makes the circle, you might target that. 
       If the circle is the button's border, this should work if the image is gone: */
       
    .header-avatar-btn:has(.header-avatar-img.guest-hide) {
        display: none !important;
    }
}

/* --- MOBILE AVATAR HIDING RULE --- */

@media (max-width: 768px) {
    /* Hide the header-avatar only when the guest-hide class is present */
    .header-avatar.guest-hide {
        display: none !important; 
    }
}

/* Style for the new live preview avatar */
#avatar-preview {
    /* CRITICAL AVATAR FIXES (Preview) */
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    display: block; 
    border: 2px solid var(--neon-cyan);
    flex-shrink: 0;
    order: -1; 
    object-fit: cover;
    /* Ensures SVGs render correctly */
    image-rendering: pixelated; 
}