campus-connect / static /css /home.css
Bhuwan31's picture
feat: mobile bottom nav bar, responsive polish
c959f5c
/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: #eef0f5;
color: #1c1e21;
}
a { text-decoration: none; color: inherit; }
/* ── TOP NAVBAR ───────────────────────────────────────── */
.top-nav {
position: fixed;
top: 0; left: 0; right: 0;
height: 60px;
background: #fff;
border-bottom: 1px solid #e4e6eb;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
z-index: 100;
box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.nav-logo {
font-size: 20px;
font-weight: 800;
color: #e85d04;
letter-spacing: -0.5px;
}
.nav-links {
display: flex;
align-items: center;
gap: 6px;
}
.nav-link {
padding: 8px 16px;
font-size: 14px;
font-weight: 500;
color: #65676b;
border-radius: 8px;
transition: background 0.15s, color 0.15s;
position: relative;
cursor: pointer;
}
.nav-link:hover { background: #f0f2f5; color: #1c1e21; }
.nav-link.active {
color: #e85d04;
font-weight: 700;
}
.nav-link.active::after {
content: '';
position: absolute;
bottom: -2px; left: 16px; right: 16px;
height: 2px;
background: #e85d04;
border-radius: 2px;
}
.nav-right {
display: flex;
align-items: center;
gap: 12px;
}
.nav-bell {
width: 38px; height: 38px;
border-radius: 50%;
background: #f0f2f5;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 16px;
color: #65676b;
transition: background 0.15s;
position: relative;
}
.nav-bell:hover { background: #e4e6eb; }
.bell-badge {
position: absolute;
top: 4px; right: 4px;
width: 8px; height: 8px;
background: #e85d04;
border-radius: 50%;
border: 2px solid #fff;
display: none; /* hidden until JS shows it */
}
.nav-avatar {
width: 38px; height: 38px;
border-radius: 50%;
background: linear-gradient(135deg, #e85d04, #f4a261);
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-weight: 700;
color: #fff;
cursor: pointer;
overflow: hidden;
}
.nav-avatar img {
width: 100%; height: 100%;
object-fit: cover;
}
/* ── PAGE LAYOUT ──────────────────────────────────────── */
.page-layout {
display: flex;
margin-top: 60px;
min-height: calc(100vh - 60px);
}
/* ── LEFT SIDEBAR ─────────────────────────────────────── */
.left-sidebar {
width: 220px;
min-width: 220px;
position: fixed;
top: 60px;
bottom: 0;
left: 0;
background: #fff;
border-right: 1px solid #e4e6eb;
display: flex;
flex-direction: column;
padding: 16px 12px;
overflow-y: auto;
}
.sidebar-label {
font-size: 11px;
font-weight: 700;
color: #8a8d91;
text-transform: uppercase;
letter-spacing: 0.8px;
padding: 0 10px;
margin-bottom: 8px;
margin-top: 4px;
}
.sidebar-nav {
display: flex;
flex-direction: column;
gap: 2px;
flex: 1;
}
.sidebar-item {
display: flex;
align-items: center;
gap: 12px;
padding: 11px 14px;
border-radius: 10px;
font-size: 14px;
font-weight: 500;
color: #444;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.sidebar-item i {
width: 20px;
font-size: 16px;
color: #65676b;
text-align: center;
}
.sidebar-item:hover {
background: #f0f2f5;
color: #1c1e21;
}
.sidebar-item:hover i { color: #e85d04; }
.sidebar-item.active {
background: #e85d04;
color: #fff;
font-weight: 600;
}
.sidebar-item.active i { color: #fff; }
.sidebar-divider {
height: 1px;
background: #e4e6eb;
margin: 12px 0;
}
.sidebar-logout {
display: flex;
align-items: center;
gap: 12px;
padding: 11px 14px;
border-radius: 10px;
font-size: 14px;
font-weight: 500;
color: #65676b;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover {
background: #fff0ec;
color: #e85d04;
}
.sidebar-logout i { font-size: 16px; }
/* ── MAIN FEED ────────────────────────────────────────── */
.main-feed {
flex: 1;
margin-left: 220px;
margin-right: 300px;
padding: 24px 20px;
max-width: 100%;
}
.feed-inner {
max-width: 640px;
margin: 0 auto;
}
/* ── POST CREATOR ─────────────────────────────────────── */
.post-creator {
background: #fff;
border-radius: 14px;
padding: 18px 20px;
box-shadow: 0 1px 4px rgba(0,0,0,0.06);
margin-bottom: 18px;
}
.creator-top {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 14px;
}
.creator-avatar {
width: 44px; height: 44px;
border-radius: 50%;
background: linear-gradient(135deg, #e85d04, #f4a261);
display: flex; align-items: center; justify-content: center;
font-size: 16px; font-weight: 700; color: #fff;
flex-shrink: 0;
overflow: hidden;
}
.creator-avatar img { width: 100%; height: 100%; object-fit: cover; }
.creator-input {
flex: 1;
background: #f0f2f5;
border: none;
border-radius: 999px;
padding: 12px 18px;
font-size: 14px;
color: #1c1e21;
cursor: pointer;
outline: none;
font-family: inherit;
resize: none;
height: 44px;
transition: background 0.15s;
}
.creator-input:focus {
background: #e8eaed;
height: 80px;
}
.creator-input::placeholder { color: #8a8d91; }
.creator-actions {
display: flex;
align-items: center;
gap: 8px;
padding-top: 14px;
border-top: 1px solid #f0f2f5;
}
.creator-btn {
display: flex;
align-items: center;
gap: 7px;
padding: 8px 16px;
border: none;
border-radius: 8px;
background: transparent;
font-size: 14px;
font-weight: 500;
color: #65676b;
cursor: pointer;
transition: background 0.15s;
}
.creator-btn:hover { background: #f0f2f5; }
.creator-btn i { font-size: 16px; }
.creator-btn .photo-icon { color: #45bd62; }
.creator-btn .feeling-icon { color: #f7b928; }
.creator-post-btn {
margin-left: auto;
padding: 9px 22px;
background: #e85d04;
color: #fff;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: background 0.15s;
}
.creator-post-btn:hover { background: #cf5203; }
/* ── POST CARD ────────────────────────────────────────── */
.post-card {
background: #fff;
border-radius: 14px;
box-shadow: 0 1px 4px rgba(0,0,0,0.06);
margin-bottom: 18px;
overflow: hidden;
}
.post-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 18px 10px;
}
.post-user {
display: flex;
align-items: center;
gap: 12px;
}
.post-avatar {
width: 44px; height: 44px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea, #764ba2);
overflow: hidden;
flex-shrink: 0;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-avatar.alt { background: linear-gradient(135deg, #f093fb, #f5576c); }
/* Clickable avatar link wrapper */
.post-avatar-link {
display: inline-flex;
flex-shrink: 0;
border-radius: 50%;
transition: opacity 0.15s;
}
.post-avatar-link:hover { opacity: 0.85; }
/* Initials fallback inside post avatar */
.post-avatar-initials {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-weight: 700;
color: #fff;
border-radius: 50%;
user-select: none;
}
.post-name {
font-size: 15px;
font-weight: 700;
color: #1c1e21;
}
/* Clickable author name link */
.post-name-link {
font-size: 15px;
font-weight: 700;
color: #1c1e21;
text-decoration: none;
display: block;
}
.post-name-link:hover { text-decoration: underline; color: #e85d04; }
.post-meta {
font-size: 12.5px;
color: #8a8d91;
margin-top: 2px;
}
.post-feeling {
color: #e85d04;
font-weight: 500;
}
.post-more {
width: 34px; height: 34px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
cursor: pointer;
color: #65676b;
font-size: 16px;
transition: background 0.15s;
}
.post-more:hover { background: #f0f2f5; }
.post-content {
padding: 0 18px 12px;
font-size: 15px;
line-height: 1.6;
color: #1c1e21;
}
.post-image {
width: 100%;
max-height: 380px;
object-fit: cover;
display: block;
cursor: zoom-in;
transition: filter 0.15s;
}
.post-image:hover { filter: brightness(0.94); }
.post-stats {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 18px;
font-size: 13px;
color: #65676b;
border-top: 1px solid #f0f2f5;
}
.post-likes-info {
display: flex;
align-items: center;
gap: 6px;
}
.like-avatars {
display: flex;
}
.like-avatar-sm {
width: 20px; height: 20px;
border-radius: 50%;
border: 2px solid #fff;
margin-left: -6px;
background: linear-gradient(135deg, #667eea, #764ba2);
font-size: 9px;
display: flex; align-items: center; justify-content: center;
color: #fff;
font-weight: 700;
overflow: hidden;
}
.like-avatar-sm:first-child { margin-left: 0; }
.like-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.post-actions {
display: flex;
align-items: center;
gap: 4px;
padding: 8px 12px;
}
.action-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 8px;
border: none;
background: transparent;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
color: #65676b;
cursor: pointer;
transition: background 0.15s, color 0.15s;
font-family: inherit;
}
.action-btn:hover { background: #f0f2f5; color: #1c1e21; }
.action-btn.liked { color: #e85d04; }
.action-btn.liked i { color: #e85d04; }
.action-btn i { font-size: 16px; }
/* ── RIGHT SIDEBAR ────────────────────────────────────── */
.right-sidebar {
width: 300px;
min-width: 300px;
position: fixed;
top: 60px; right: 0; bottom: 0;
padding: 24px 16px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 16px;
}
.sidebar-card {
background: #fff;
border-radius: 14px;
padding: 18px;
box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 14px;
}
.sidebar-card-title {
font-size: 16px;
font-weight: 700;
color: #1c1e21;
}
.view-all {
font-size: 13px;
font-weight: 600;
color: #e85d04;
cursor: pointer;
}
.view-all:hover { text-decoration: underline; }
/* Announcements */
.announcement-item {
padding: 12px 14px;
border-radius: 10px;
background: #f8f9fa;
margin-bottom: 10px;
border-left: 3px solid #e85d04;
}
.announcement-item:last-child { margin-bottom: 0; }
.announcement-item.academic { border-left-color: #667eea; background: #f0f2ff; }
.ann-tag {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.6px;
color: #e85d04;
margin-bottom: 4px;
}
.ann-tag.academic { color: #667eea; }
.ann-title {
font-size: 13.5px;
font-weight: 700;
color: #1c1e21;
margin-bottom: 4px;
}
.ann-desc {
font-size: 12.5px;
color: #65676b;
line-height: 1.5;
}
/* Friend Suggestions */
.friend-item {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 14px;
}
.friend-item:last-of-type { margin-bottom: 0; }
.friend-avatar {
width: 42px; height: 42px;
border-radius: 50%;
background: linear-gradient(135deg, #f093fb, #f5576c);
overflow: hidden;
flex-shrink: 0;
}
.friend-avatar.blue { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.friend-avatar.green { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-info { flex: 1; }
.friend-name {
font-size: 13.5px;
font-weight: 700;
color: #1c1e21;
}
.friend-mutual {
font-size: 12px;
color: #8a8d91;
}
.friend-add {
width: 34px; height: 34px;
border-radius: 50%;
background: #fff0ec;
border: none;
display: flex; align-items: center; justify-content: center;
color: #e85d04;
font-size: 16px;
cursor: pointer;
transition: background 0.15s;
}
.friend-add:hover { background: #ffddd0; }
.see-more {
text-align: center;
font-size: 13px;
font-weight: 600;
color: #e85d04;
padding-top: 10px;
border-top: 1px solid #f0f2f5;
cursor: pointer;
}
.see-more:hover { text-decoration: underline; }
/* Trending */
.trending-card {
background: #1a2332;
border-radius: 14px;
padding: 18px;
}
.trending-card .sidebar-card-title { color: #fff; }
.tags-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.tag {
background: rgba(255,255,255,0.1);
color: #e0e0e0;
border-radius: 999px;
padding: 6px 14px;
font-size: 12.5px;
font-weight: 600;
cursor: pointer;
transition: background 0.15s;
}
.tag:hover { background: rgba(232,93,4,0.4); color: #fff; }
/* ── NAV SEARCH BAR (injected by nav.js, used on all pages) ── */
.nav-search-wrap {
position: relative;
flex: 1;
max-width: 340px;
margin: 0 16px;
}
.nav-search-input {
width: 100%;
padding: 8px 14px 8px 36px;
border: none;
border-radius: 20px;
background: #f0f2f5;
font-size: 14px;
color: #1c1e21;
outline: none;
transition: background 0.15s, box-shadow 0.15s;
}
.nav-search-input:focus {
background: #fff;
box-shadow: 0 0 0 2px #e85d04;
}
.nav-search-input::placeholder { color: #bcc0c4; }
.nav-search-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: #65676b;
font-size: 13px;
pointer-events: none;
}
.nav-search-dropdown {
position: absolute;
top: calc(100% + 8px);
left: 0; right: 0;
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 28px rgba(0,0,0,0.14);
z-index: 9999;
overflow: hidden;
animation: navDropIn 0.12s ease;
max-height: 380px;
overflow-y: auto;
}
@keyframes navDropIn {
from { opacity: 0; transform: translateY(-6px); }
to { opacity: 1; transform: translateY(0); }
}
.nav-dd-section-label {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #65676b;
padding: 10px 14px 4px;
}
.nav-dd-user-row {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 14px;
text-decoration: none;
color: #1c1e21;
transition: background 0.12s;
cursor: pointer;
}
.nav-dd-user-row:hover { background: #f0f2f5; }
.nav-dd-mini-avatar {
width: 34px; height: 34px;
border-radius: 50%;
object-fit: cover;
flex-shrink: 0;
}
.nav-dd-mini-init {
width: 34px; height: 34px;
border-radius: 50%;
background: #e85d04;
color: #fff;
font-size: 14px;
font-weight: 700;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
}
.nav-dd-user-name { font-size: 13px; font-weight: 600; }
.nav-dd-user-dept { font-size: 12px; color: #65676b; }
.nav-dd-post-row {
padding: 9px 14px;
cursor: pointer;
transition: background 0.12s;
border-top: 1px solid #f0f2f5;
}
.nav-dd-post-row:hover { background: #f0f2f5; }
.nav-dd-post-author {
font-size: 11px;
color: #65676b;
margin-bottom: 2px;
}
.nav-dd-post-text {
font-size: 13px;
color: #3c4043;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.nav-dd-view-all {
display: block;
text-align: center;
padding: 10px;
font-size: 13px;
font-weight: 600;
color: #e85d04;
border-top: 1px solid #f0f2f5;
text-decoration: none;
transition: background 0.12s;
}
.nav-dd-view-all:hover { background: #fff5f0; }
.nav-dd-empty {
padding: 16px;
text-align: center;
font-size: 13px;
color: #65676b;
}
/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1100px) {
.right-sidebar { display: none; }
.main-feed { margin-right: 0; }
}
@media (max-width: 768px) {
/* Hide desktop sidebars */
.left-sidebar { display: none; }
.right-sidebar { display: none; }
/* Feed takes full width, add bottom padding for the mobile nav bar */
.main-feed {
margin-left: 0;
margin-right: 0;
padding: 12px 8px 80px; /* bottom padding = mobile nav height */
}
/* Slim top navbar */
.top-nav { padding: 0 12px; }
.nav-logo { font-size: 16px; }
.nav-links { display: none; } /* hidden β€” replaced by bottom nav */
.nav-search-wrap { max-width: 160px; margin: 0 8px; }
/* Smaller nav icons */
.nav-bell { width: 32px; height: 32px; font-size: 14px; }
.nav-avatar { width: 32px; height: 32px; font-size: 13px; }
/* Post creator */
.post-creator { padding: 14px 14px; border-radius: 10px; }
.creator-input { font-size: 13px; }
.creator-btn { padding: 7px 10px; font-size: 13px; }
/* Post cards */
.post-card { border-radius: 10px; margin-bottom: 12px; }
.post-content { font-size: 14px; }
.post-image { max-height: 280px; }
.action-btn { font-size: 13px; gap: 5px; }
/* Full-width images on very small screens */
.feed-inner { max-width: 100%; }
}
/* ── MOBILE BOTTOM NAVIGATION BAR ────────────────────── */
.mobile-bottom-nav {
display: none; /* shown only on mobile via media query */
}
@media (max-width: 768px) {
.mobile-bottom-nav {
display: flex;
position: fixed;
bottom: 0; left: 0; right: 0;
height: 60px;
background: #fff;
border-top: 1px solid #e4e6eb;
z-index: 200;
align-items: stretch;
box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.mob-nav-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 3px;
text-decoration: none;
color: #65676b;
font-size: 10px;
font-weight: 500;
transition: color 0.15s;
position: relative;
cursor: pointer;
}
.mob-nav-item i {
font-size: 20px;
line-height: 1;
}
.mob-nav-item.active {
color: #e85d04;
}
.mob-nav-item.active::before {
content: '';
position: absolute;
top: 0; left: 20%; right: 20%;
height: 2px;
background: #e85d04;
border-radius: 0 0 3px 3px;
}
.mob-nav-badge {
position: absolute;
top: 8px; right: calc(50% - 18px);
background: #e85d04;
color: #fff;
font-size: 9px;
font-weight: 700;
min-width: 16px;
height: 16px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 3px;
border: 2px solid #fff;
display: none; /* JS shows it */
}
}