/**
 * XdiaperguysV2 — X / Bluesky sleek layout overrides
 * Flattens glassmorphism boxing for a continuous feed aesthetic.
 */

:root {
  --x-accent: #1d9bf0;
  --x-accent-hover: #1a8cd8;
  --x-surface: #16181c;
  --x-border: #2f3336;
  --x-border-subtle: #eff3f4;
}

body.night-mode:not(.index-body) {
  --body-bg: #000000;
  --body-bg-dark: #000000;
  --border-divider: #2f3336;
  --border-divider-2: #2f3336;
  --header-search-bg: #202327;
  --main-link: #1d9bf0;
}

/* ---- Background: flat, no gradient glow ---- */
body:not(.index-body) {
  background: var(--body-bg) !important;
  background-attachment: scroll !important;
}

body:not(.index-body)::before {
  display: none !important;
}

/* ---- Strip glass boxing from cards / sidebars ---- */
body:not(.index-body) .card,
body:not(.index-body) .main-side-nav-card,
body:not(.index-body) .sidebar-card {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

body:not(.index-body) .card::before {
  display: none !important;
}

body:not(.index-body) .card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

body:not(.index-body) .card-header {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--border-divider) !important;
  border-radius: 0 !important;
}

/* ---- Center feed: edge-to-edge, divider-only ---- */
body:not(.index-body) .x_content_row > .col-lg-8,
body:not(.index-body) .x_content_row > .col-lg-12 {
  border-right-color: var(--border-divider);
}

body:not(.index-body) .x_content_row > .col-lg-8 .content,
body:not(.index-body) .x_content_row > .col-lg-12 .content {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

/* ---- Posts & publisher: seamless feed ---- */
body.night-mode:not(.index-body) .post.bg-white,
body.night-mode:not(.index-body) .publisher.bg-white,
body.night-mode:not(.index-body) .x_announcement.bg-white {
  background-color: transparent !important;
}

body:not(.index-body) .post {
  border-bottom-color: var(--border-divider);
  transition: background-color 0.15s ease;
}

body.night-mode:not(.index-body) .post:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
}

body:not(.index-body) .publisher,
body:not(.index-body) .x_announcement,
body:not(.index-body) .x_notification {
  border-bottom-color: var(--border-divider);
}

body:not(.index-body) .post-actions .action-btn {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 9999px !important;
  transform: none !important;
}

body.night-mode:not(.index-body) .post-actions .action-btn:hover {
  background: rgba(29, 155, 240, 0.1) !important;
}

/* ---- Top feed tabs (Discover / Popular / Recent) ---- */
body:not(.index-body) .x_top_posts {
  border-bottom-color: var(--border-divider);
}

body.night-mode:not(.index-body) .x_top_posts:before {
  background-color: rgba(0, 0, 0, 0.65) !important;
}

body:not(.index-body) .x_top_posts div.active span:before {
  background: var(--x-accent) !important;
  height: 4px;
  border-radius: 9999px 9999px 0 0;
}

body:not(.index-body) .x_top_posts.home div:not(.dropdown-menu) > a.side_item_hover {
  font-size: 15px;
  font-weight: 500;
}

body:not(.index-body) .x_top_posts div.active > a {
  font-weight: 700 !important;
}

/* ---- Left nav: X-style pill hovers ---- */
body:not(.index-body) .x-sidebar-fixed {
  border-right-color: var(--border-divider);
}

body:not(.index-body) .x_side_links > div {
  border-radius: 9999px;
  padding: 12px 16px;
  transition: background-color 0.15s ease;
}

body:not(.index-body) .x_side_links > div span.text {
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
}

body:not(.index-body) .x_side_links.fw-semibold.main > div span.text,
body:not(.index-body) .x_side_links.main > div span.text {
  font-weight: 700;
}

body:not(.index-body) .x_side_links:hover .main_bg_half:before,
body:not(.index-body) .x-sidebar .main_bg_half:hover:before {
  opacity: 0.08 !important;
  border-radius: 9999px;
}

/* Create button — X white pill */
body.night-mode:not(.index-body) .x_side_create > .btn {
  background: #eff3f4 !important;
  color: #0f1419 !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  border: none !important;
  box-shadow: none !important;
}

body.night-mode:not(.index-body) .x_side_create > .btn:hover {
  background: #d7dbdc !important;
  opacity: 1 !important;
}

/* Bottom profile chip */
body:not(.index-body) .x_user_info.main_bg_half {
  border-radius: 9999px;
  padding: 12px;
  margin-bottom: 12px;
}

/* ---- Right sidebar widgets — subtle, not heavy blocks ---- */
body:not(.index-body) .x_content_row > .col-lg-4 .content {
  background: transparent !important;
  border: 1px solid var(--border-divider) !important;
  border-radius: 16px !important;
  margin-bottom: 16px;
  overflow: hidden;
}

body.night-mode:not(.index-body) .x_content_row > .col-lg-4 .content {
  background: rgba(255, 255, 255, 0.03) !important;
}

body:not(.index-body) .side_widget_title {
  font-size: 20px;
  font-weight: 800;
  padding: 12px 16px;
}

body:not(.index-body) .side_item_list {
  padding-top: 0;
}

body:not(.index-body) .side_item_hover {
  padding: 12px 16px;
  border-radius: 0;
}

body.night-mode:not(.index-body) .side_item_hover:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ---- Search bar ---- */
body.night-mode:not(.index-body) .search-wrapper .form-control {
  background: var(--header-search-bg) !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}

body.night-mode:not(.index-body) .search-wrapper .form-control:focus {
  background: #000 !important;
  border-color: var(--x-accent) !important;
}

/* ---- Header ---- */
body.night-mode:not(.index-body) .sg-header,
body.night-mode:not(.index-body) .header-wrapper {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--border-divider) !important;
  box-shadow: none !important;
}

/* ---- Forms & inputs in feed ---- */
body.night-mode:not(.index-body) .form-control,
body.night-mode:not(.index-body) .form-select {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.night-mode:not(.index-body) .publisher textarea:not(.form-control) {
  font-size: 20px;
  line-height: 24px;
}

/* ---- Dropdowns ---- */
body.night-mode:not(.index-body) .dropdown-menu {
  background: #000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border-divider) !important;
  border-radius: 16px !important;
  box-shadow: rgba(255, 255, 255, 0.2) 0 0 15px !important;
}

/* ---- Primary links & accents ---- */
body.night-mode:not(.index-body) a:not(.btn):hover {
  text-decoration: none;
}

body.night-mode:not(.index-body) .main,
body.night-mode:not(.index-body) .text-link,
body.night-mode:not(.index-body) .post a:not(.dropdown-item):hover {
  color: var(--x-accent);
}

body.night-mode:not(.index-body) .btn-main,
body.night-mode:not(.index-body) .btn-primary {
  background: var(--x-accent) !important;
  border-color: var(--x-accent) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.night-mode:not(.index-body) .btn-main:hover,
body.night-mode:not(.index-body) .btn-primary:hover {
  background: var(--x-accent-hover) !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ---- Stories strip: inline, not boxed ---- */
body.night-mode:not(.index-body) .stories-wrapper > div {
  padding: 12px 16px;
}

/* ---- Modals keep subtle depth ---- */
body.night-mode:not(.index-body) .modal-content {
  background: #000 !important;
  border: 1px solid var(--border-divider) !important;
  border-radius: 16px !important;
  box-shadow: rgba(255, 255, 255, 0.15) 0 0 24px !important;
}

/* ---- Light mode: softer Bluesky-style surfaces ---- */
body:not(.night-mode):not(.index-body) .x_content_row > .col-lg-4 .content {
  background: #f7f9f9 !important;
  border-color: var(--x-border-subtle) !important;
}

body:not(.night-mode):not(.index-body) .post:hover {
  background-color: rgba(0, 0, 0, 0.03) !important;
}

/* ---- Post media: rounded like X ---- */
body:not(.index-body) .post-media-image img,
body:not(.index-body) .post-media-image .image,
body:not(.index-body) .post-map,
body:not(.index-body) .pg_wrapper {
  border-radius: 16px;
}

/* ---- Announcements: flat inline banner ---- */
body:not(.index-body) .x_announcement.side_item_list {
  padding: 16px;
  border-bottom: 1px solid var(--border-divider);
}

body:not(.index-body) .x_announcement .side_widget_title {
  font-size: 20px;
  font-weight: 700;
  padding: 0;
}

body:not(.index-body) .x_announcement svg[width="128"] {
  width: 48px !important;
  height: 48px !important;
  margin-bottom: 8px !important;
}

/* ---- Tighter feed rhythm ---- */
body:not(.index-body) .post .p-3 {
  padding: 12px 16px !important;
}

body:not(.index-body) .publisher .side_item_list {
  padding: 12px 16px !important;
}
