:root {
  --mn-bg: #0f1115;
  --mn-card: #181b22;
  --mn-card2: #1f232c;
  --mn-border: #2a2f3a;
  --mn-accent: #5b8cff;
  --mn-accent2: #7c5bff;
}

body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,.12), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(124,91,255,.10), transparent 55%),
              var(--mn-bg);
  color: #e8eaf0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ===== Auth (Facebook style, light theme) ===== */
.mn-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  color: #050505;
}
.mn-auth-header {
  padding: 1.4rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  background: #fff;
}
.mn-auth-brand {
  font-size: 2rem;
  font-weight: 800;
  color: #1877f2;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.mn-auth-logo-img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.mn-auth-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1877f2, #7c5bff);
  color: #fff; font-size: 1.4rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.mn-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  flex-wrap: wrap;
}
.mn-auth-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.1);
  padding: 1.25rem 1rem;
}
#loginCard { width: 396px; }
#loginCard form { display: flex; flex-direction: column; gap: .75rem; }
.mn-input {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: #f5f6f7;
  padding: .875rem 1rem;
  font-size: 1rem;
  color: #1c1e21;
  outline: none;
}
.mn-input:focus { box-shadow: 0 0 0 2px #1877f2; background: #fff; }
.mn-input::placeholder { color: #90949c; }
.mn-btn-login {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: #1877f2;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  padding: .625rem;
  cursor: pointer;
  transition: background .15s;
}
.mn-btn-login:hover { background: #166fe5; }
.mn-btn-login:active { background: #1467d3; }
.mn-auth-error { color: #f02849; font-size: .85rem; min-height: 1.1em; text-align: center; }
.mn-forgot {
  display: block;
  text-align: center;
  color: #1877f2;
  font-size: .875rem;
  text-decoration: none;
  margin-top: .5rem;
}
.mn-forgot:hover { text-decoration: underline; }
.mn-auth-create-card {
  width: 396px;
  text-align: center;
  padding-bottom: 1.75rem;
}
.mn-create-text { font-size: 1.125rem; margin: 0 0 1rem; color: #1c1e21; }
.mn-btn-create {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: #42b72a;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: .75rem;
  cursor: pointer;
  transition: background .15s;
}
.mn-btn-create:hover { background: #36a420; }
/* Register card */
.mn-auth-register-card {
  width: 432px;
  max-width: 100%;
  padding: 1.5rem 2rem;
}
.mn-register-title { font-size: 2rem; font-weight: 800; margin: 0 0 .25rem; color: #1c1e21; }
.mn-register-sub { color: #606770; margin: 0 0 1.25rem; font-size: .95rem; }
.mn-input-row { display: flex; gap: .75rem; }
.mn-input-row .mn-input { flex: 1; }
.mn-btn-create-lg { font-size: 1.125rem; padding: .875rem; margin-top: .25rem; }
.mn-back-login {
  display: inline-block;
  margin-top: 1.25rem;
  color: #1877f2;
  font-size: .95rem;
  text-decoration: none;
  font-weight: 600;
}
.mn-back-login:hover { text-decoration: underline; }
/* Footer */
.mn-auth-footer {
  background: #fff;
  padding: 1.5rem 2rem 2rem;
  text-align: center;
}
.mn-footer-lang { color: #737373; font-size: .8rem; margin: 0 0 .5rem; }
.mn-footer-line { border: none; border-top: 1px solid #dddfe2; margin: 0 0 .75rem; }
.mn-footer-links a {
  color: #8a8d91; font-size: .75rem; text-decoration: none;
  margin: 0 .5rem;
}
.mn-footer-links a:hover { text-decoration: underline; }
.mn-footer-copy { color: #8a8d91; font-size: .75rem; margin: .75rem 0 0; }
@media (max-width: 900px) {
  .mn-auth-main { flex-direction: column; }
  #loginCard, .mn-auth-create-card, .mn-auth-register-card { width: 100%; max-width: 396px; }
  .mn-auth-register-card { max-width: 432px; }
}
.brand-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--mn-accent), var(--mn-accent2));
  color: #fff; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(91,140,255,.35);
}
.brand-logo-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; }
.text-gradient {
  background: linear-gradient(90deg, var(--mn-accent), var(--mn-accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-pills .nav-link { color: #aab; }
.nav-pills .nav-link.active { background: linear-gradient(90deg, var(--mn-accent), var(--mn-accent2)); }

/* Nav */
.mn-nav {
  background: rgba(15,17,21,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mn-border);
}

/* Cards */
.mn-card {
  background: var(--mn-card);
  border: 1px solid var(--mn-border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.card { background: var(--mn-card); border: 1px solid var(--mn-border); border-radius: 16px; }
.form-control, .form-select {
  background: var(--mn-card2);
  border: 1px solid var(--mn-border);
  color: #e8eaf0;
}
.form-control:focus {
  background: var(--mn-card2);
  border-color: var(--mn-accent);
  color: #e8eaf0;
  box-shadow: 0 0 0 .2rem rgba(91,140,255,.2);
}
.btn-primary {
  background: linear-gradient(90deg, var(--mn-accent), var(--mn-accent2));
  border: none;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline-light { border-color: var(--mn-border); }
.btn-outline-light:hover { background: var(--mn-card2); }

/* Avatar */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .95rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c1, #5b8cff), var(--c2, #7c5bff));
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .8rem; }

/* Posts */
.post-card { transition: transform .15s ease, border-color .15s ease; }
.post-card:hover { border-color: #3a4152; }
.post-content { white-space: pre-wrap; word-break: break-word; }
.post-img { max-width: 100%; border-radius: 12px; margin-top: .75rem; }
.post-actions .btn { color: #aab; }
.post-actions .btn:hover { color: #fff; }
.post-actions .btn.liked { color: #ff4d6d; }
.time-ago { color: #7a8299; font-size: .8rem; }

/* Comments */
.comment { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--mn-border); }
.comment:last-child { border-bottom: none; }

/* Friends list */
.friends-list .friend-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .3rem; border-radius: 10px; cursor: pointer;
}
.friends-list .friend-item:hover { background: var(--mn-card2); }
.search-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .3rem; }
.req-item { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--mn-border); }
.req-item:last-child { border-bottom: none; }

/* Profile card */
.profile-hero {
  height: 90px; border-radius: 16px 16px 0 0;
  background: linear-gradient(120deg, var(--mn-accent), var(--mn-accent2));
}

.badge-online { width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; display: inline-block; }

@media (max-width: 991px) {
  .col-lg-3, .col-lg-6 { margin-bottom: 1rem; }
}

/* ===== Facebook layout ===== */
.fb-app { display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.fb-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1rem;
  background: var(--mn-card);
  border-bottom: 1px solid var(--mn-border);
}
.fb-topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 280px; }
.fb-logo-link { display: flex; align-items: center; gap: .4rem; text-decoration: none; }
.fb-logo-img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.fb-logo-text { font-size: 1.5rem; font-weight: 800; background: linear-gradient(90deg, var(--mn-accent), var(--mn-accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fb-search {
  display: flex; align-items: center; gap: .5rem;
  background: var(--mn-card2); border-radius: 999px; padding: .45rem .9rem;
  color: #889; min-width: 200px;
}
.fb-search input { background: transparent; border: none; outline: none; color: #e8eaf0; width: 100%; }
.fb-search input::placeholder { color: #778; }
.fb-topnav { display: flex; gap: .25rem; position: absolute; left: 50%; transform: translateX(-50%); }
.fb-tab {
  position: relative; width: 110px; height: 52px; border: none; border-radius: 8px;
  background: transparent; color: #889; font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.fb-tab:hover { background: var(--mn-card2); }
.fb-tab.active { color: var(--mn-accent); }
.fb-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 15%; right: 15%; height: 3px;
  background: var(--mn-accent); border-radius: 3px 3px 0 0;
}
.fb-tab-badge {
  position: absolute; top: 4px; right: 8px;
  background: #e41e3f; color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 999px; padding: .1rem .35rem;
}
.fb-topbar-right { display: flex; align-items: center; gap: .6rem; }
.fb-icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  border: none; background: var(--mn-card2); color: #ccc; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fb-icon-btn:hover { background: #2a3040; color: #fff; }
.fb-avatar-btn { text-decoration: none; }
.fb-dropdown { background: var(--mn-card); border: 1px solid var(--mn-border); min-width: 220px; }
.fb-dropdown .dropdown-item { color: #e8eaf0; }
.fb-dropdown .dropdown-item:hover { background: var(--mn-card2); }

/* Notif panel */
.fb-notif-wrap { position: relative; }
.fb-notif-panel {
  position: absolute; top: 52px; right: 0; width: 360px; max-height: 480px;
  overflow-y: auto; background: var(--mn-card); border: 1px solid var(--mn-border);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 200; padding: .5rem;
}
.notif-item { display: flex; gap: .7rem; padding: .7rem .6rem; border-radius: 10px; cursor: pointer; }
.notif-item:hover { background: var(--mn-card2); }
.notif-item .avatar { width: 44px; height: 44px; }

/* Body grid */
.fb-body {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 680px) 300px;
  gap: 1.5rem;
  justify-content: center;
  padding: 1.25rem 1rem 3rem;
}
.fb-left { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: .15rem; }
.fb-left-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .7rem; border-radius: 10px; cursor: pointer;
  color: #dfe3ec; text-decoration: none; font-size: .95rem; position: relative;
}
.fb-left-item:hover { background: var(--mn-card); }
.fb-left-item.active { background: var(--mn-card2); font-weight: 600; }
.fb-left-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-flex; }
.fb-left-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fb-left-icon { font-size: 1.35rem; width: 36px; text-align: center; color: #b9c0d0; }
.fb-left-label { flex: 1; }
.fb-left-badge {
  background: #e41e3f; color: #fff; font-size: .7rem; font-weight: 700;
  border-radius: 999px; padding: .15rem .45rem;
}
.fb-left-sep { border-color: var(--mn-border); margin: .6rem 0; }

.fb-center { min-width: 0; }
.fb-right { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 1rem; }
.fb-right-card { background: var(--mn-card); border: 1px solid var(--mn-border); border-radius: 16px; padding: 1rem; }
.fb-right-title { font-weight: 600; color: #b9c0d0; margin-bottom: .75rem; font-size: .95rem; }
.fb-sponsor-item { display: flex; gap: .7rem; align-items: center; padding: .45rem 0; cursor: pointer; }
.fb-sponsor-img { width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0; }
.fb-contacts .contact-item {
  display: flex; align-items: center; gap: .7rem; padding: .4rem .3rem;
  border-radius: 10px; cursor: pointer;
}
.fb-contacts .contact-item:hover { background: var(--mn-card2); }

/* Stories */
.fb-stories { display: flex; gap: .75rem; padding: 1rem; overflow-x: auto; }
.fb-story { display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; flex-shrink: 0; }
.fb-story-img {
  width: 110px; height: 190px; border-radius: 12px; object-fit: cover;
  background-size: cover; background-position: center;
  border: 3px solid var(--mn-accent); padding: 0; position: relative;
}
.fb-story-img.story-create-bg {
  background: var(--mn-card2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--mn-accent);
}
.fb-story-name { font-size: .78rem; color: #c5cad6; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-stories-row { display: contents; }

/* Composer */
.fb-composer { padding: .9rem 1rem; margin-top: 1rem; }
.fb-composer-top { display: flex; align-items: center; gap: .75rem; }
.fb-composer-btn {
  flex: 1; text-align: left; background: var(--mn-card2); border: none;
  border-radius: 999px; padding: .7rem 1.1rem; color: #8a90a2; font-size: 1rem; cursor: pointer;
}
.fb-composer-btn:hover { background: #262c3a; }
.fb-composer-sep { border-color: var(--mn-border); margin: .8rem 0 .5rem; }
.fb-composer-actions { display: flex; justify-content: space-around; }
.fb-comp-action {
  background: none; border: none; color: #b9c0d0; font-size: .9rem;
  display: flex; align-items: center; gap: .5rem; padding: .4rem .8rem;
  border-radius: 8px; cursor: pointer;
}
.fb-comp-action:hover { background: var(--mn-card2); }

/* Friends grid */
.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.friend-card { background: var(--mn-card2); border-radius: 12px; padding: .9rem; text-align: center; cursor: pointer; transition: transform .15s; }
.friend-card:hover { transform: translateY(-2px); }
.friend-card .avatar { width: 64px; height: 64px; font-size: 1.4rem; margin: 0 auto .5rem; }

/* Module empty states */
.module-empty { padding: 4rem 2rem; text-align: center; color: #889; }
.module-empty i { font-size: 4rem; display: block; margin-bottom: 1rem; color: var(--mn-accent); }
.module-empty h4 { color: #dfe3ec; }

/* Story viewer */
.story-viewer { background: #000; border: none; max-width: 480px; }
.story-viewer .modal-content { background: #000; }
.story-progress { height: 3px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.story-progress-bar { height: 100%; width: 0; background: #fff; transition: width linear; }
.story-header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; color: #fff; }
.story-body { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 1rem; color: #fff; font-size: 1.4rem; text-align: center; background-size: cover; background-position: center; }

/* Story create bg picker */
.story-bg-btn { width: 44px; height: 44px; border-radius: 10px; border: 3px solid transparent; cursor: pointer; }
.story-bg-btn.active { border-color: #fff; }

@media (max-width: 1200px) {
  .fb-body { grid-template-columns: 240px minmax(0, 1fr) 260px; gap: 1rem; }
  .fb-tab { width: 90px; }
}
@media (max-width: 992px) {
  .fb-right { display: none; }
  .fb-body { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .fb-left { display: none; }
  .fb-body { grid-template-columns: 1fr; padding: 1rem .5rem 3rem; }
  .fb-search { display: none; }
  .fb-tab { width: 60px; font-size: 1.2rem; }
  .fb-logo-text { display: none; }
}

/* ===== extras ===== */
.avatar-md { width: 46px; height: 46px; font-size: 1rem; }
.avatar-wrap { position: relative; display: inline-block; }
.dot-online { width: 11px; height: 11px; border-radius: 50%; background: #2ecc71; position: absolute; bottom: 0; right: 0; border: 2px solid var(--mn-card); }

.mn-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--mn-card2); color: #e8eaf0; border: 1px solid var(--mn-border);
  padding: .7rem 1.4rem; border-radius: 999px; font-size: .9rem;
  opacity: 0; transition: all .3s ease; z-index: 9999; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.mn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
