/* ==========================================================================
   ULTRA-DARK INSTAGRAM UI RESTYLE (2026)
   ========================================================================== */

:root {
  --bg-main: #000000;
  --bg-card: #000000;
  --bg-card-hover: #141414;
  --border-color: #262626;
  --text-primary: #f0f2f5;
  --text-secondary: #8e96a3;
  --accent-cyan: #ff9d00;
  --accent-pink: #e1306c;
  --sidebar-width: 92px;
}

body {
  background-color: var(--bg-main) !important;
  color: var(--text-primary) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  margin: 0;
  padding: 0;
}

/* App Wrapper Grid */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
  background-color: var(--bg-main);
}

.main-content-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  gap: 48px;
}

.feed-column {
  width: 100%;
  max-width: 470px;
}

.widgets-column {
  width: 320px;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .widgets-column { display: none !important; }
  .feed-column { max-width: 100% !important; }
  .main-content-container { gap: 0 !important; }
}

@media (max-width: 768px) {
  .app-wrapper { padding-left: 0 !important; padding-bottom: 60px !important; }
}

/* Styling for End-to-End Pill-Shaped Slim Sidebar */
.slim-left-sidebar,
aside.slim-left-sidebar {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: 14px;
  width: 68px;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  border-radius: 9999px; /* Complete end-to-end pill shape */
  background: #000000 !important;
  border: 1px solid #262626 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.15) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  z-index: 1000;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.slim-left-sidebar:hover,
aside.slim-left-sidebar:hover {
  border-color: #383838 !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255, 107, 0, 0.15) !important;
}

.sidebar-top {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.brand-avatar {
  display: block;
}

.brand-avatar .brand-logo-emblem {
  border-radius: 50% !important;
  transition: transform 0.2s ease;
}

.brand-avatar:hover .brand-logo-emblem {
  transform: scale(1.1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
}

.nav-icon {
  color: var(--text-primary);
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s, transform 0.15s;
  position: relative;
  text-decoration: none;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: scale(1.08);
}

.nav-icon.active {
  background: rgba(255, 107, 0, 0.18);
  color: #ff6b00;
}

.nav-icon .badge-dot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  background: var(--accent-pink);
  border-radius: 50%;
  border: 1px solid var(--bg-main);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.brand-avatar img, .user-profile-icon img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Stories Bar */
.stories-container {
  display: flex;
  gap: 16px;
  padding: 12px 0 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}

.story-avatar-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2px;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.story-avatar-wrapper:hover {
  transform: scale(1.05);
}

.story-avatar-wrapper.has-update {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

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

.create-story .add-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-primary);
}

.story-user {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

/* Post Card */
.instagram-post-card {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.author-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.post-time {
  color: var(--text-secondary);
  font-size: 13px;
}

.btn-more-options {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.btn-more-options:hover {
  color: var(--text-primary);
}

.post-media-frame {
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
  position: relative;
}

.post-media-img, .post-media-video {
  width: 100%;
  display: block;
  max-height: 600px;
  object-fit: cover;
}

.post-actions-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 8px 0;
}

.left-actions { display: flex; gap: 16px; align-items: center; }

.action-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s, color 0.15s;
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-btn.liked {
  color: var(--accent-pink);
}

.likes-count { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text-primary); }
.caption-author { font-weight: 600; color: var(--text-primary); text-decoration: none; margin-right: 6px; font-size: 14px; }
.post-caption { font-size: 14px; line-height: 1.4; color: var(--text-primary); }
.view-comments-link { color: var(--text-secondary); font-size: 13px; text-decoration: none; display: block; margin-top: 6px; }

/* Right Sidebar / Widgets */
.user-switch-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.profile-thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.user-handle { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.user-fullname { color: var(--text-secondary); font-size: 13px; }

.btn-switch, .see-all {
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion-user {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.suggestion-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.s-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.s-reason { font-size: 11px; color: var(--text-secondary); }

.btn-follow {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-follow:hover {
  color: #fff;
}

.widget-footer {
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Ecosystem Directory */
.ecosystem-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
}

.ecosystem-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ecosystem-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 991px) {
  .ecosystem-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .ecosystem-grid { grid-template-columns: 1fr; }
}

.eco-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}

.eco-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.eco-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 157, 0, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  color: var(--accent-cyan);
  font-size: 20px;
}

.eco-card h3 { color: var(--text-primary); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.eco-card p { color: var(--text-secondary); font-size: 12px; margin: 0; }

/* Mobile Header & Bottom Nav */
.mobile-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
}

.mobile-logo { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.mobile-actions { display: flex; gap: 18px; font-size: 20px; color: #fff; }
.mobile-actions a { color: #fff; text-decoration: none; }

.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg-main);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.mobile-bottom-nav a { color: var(--text-primary); font-size: 20px; text-decoration: none; }
.mobile-nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
