/* =========================================================
   LINKTRUYEN REDESIGN — PHASE 2
   Global shell: Header + Footer + overlays
   Scope: body.lt-shell-v2 only
   ========================================================= */

:root{
  --lt-shell-max: 1420px;
  --lt-shell-bg: #fbf7f1;
  --lt-shell-surface: rgba(255,252,247,.93);
  --lt-shell-card: #fffdf9;
  --lt-shell-line: #eadfd2;
  --lt-shell-text: #2e211b;
  --lt-shell-muted: #81736a;
  --lt-shell-accent: #c85b25;
  --lt-shell-accent-dark: #a9461b;
  --lt-shell-soft: #f7eadf;
  --nav-h: 72px;
}

body.lt-shell-v2{
  background: var(--lt-shell-bg);
}

/* ---------- HEADER ---------- */
body.lt-shell-v2 .site-header{
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 9000;
  background: rgba(255,252,247,.88);
  border-bottom: 1px solid rgba(222,207,191,.7);
  box-shadow: 0 8px 30px rgba(78,50,32,.035);
  backdrop-filter: blur(15px) saturate(1.2);
  -webkit-backdrop-filter: blur(15px) saturate(1.2);
}
body.lt-shell-v2 .site-header.scrolled{
  background: rgba(255,252,247,.96);
  box-shadow: 0 10px 34px rgba(78,50,32,.07);
}
body.lt-shell-v2 .nav-inner{
  width: min(var(--lt-shell-max), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0;
}
body.lt-shell-v2 .logo{
  display:flex;
  align-items:center;
  gap:.58rem;
  min-width:max-content;
  color:var(--lt-shell-text);
  text-decoration:none;
}
body.lt-shell-v2 .logo-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#fff;
  background:linear-gradient(145deg,#d87037,#b8491d);
  box-shadow:0 5px 14px rgba(194,83,35,.18);
  font-size:.92rem;
}
body.lt-shell-v2 .logo-text{
  font-family:"Playfair Display", Georgia, serif;
  font-size:1.33rem;
  font-weight:700;
  letter-spacing:-.02em;
}
body.lt-shell-v2 .logo img{max-height:36px!important;width:auto}

body.lt-shell-v2 .nav-links{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2px;
  flex:1;
}
body.lt-shell-v2 .nav-link{
  position:relative;
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:0 12px;
  border-radius:999px;
  color:#685a51;
  font-size:.82rem;
  font-weight:600;
  text-decoration:none;
  white-space:nowrap;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
body.lt-shell-v2 .nav-link:hover{
  color:var(--lt-shell-accent);
  background:#f8eee5;
}
body.lt-shell-v2 .nav-link.active{
  color:var(--lt-shell-accent-dark);
  background:#faede2;
}

body.lt-shell-v2 .nav-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  min-width:max-content;
}
body.lt-shell-v2 .icon-btn{
  width:40px;
  height:40px;
  border:1px solid transparent;
  border-radius:50%;
  background:transparent;
  color:#675950;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:.18s ease;
}
body.lt-shell-v2 .icon-btn:hover{
  background:#f8eee5;
  border-color:#ebddcf;
  color:var(--lt-shell-accent);
}

/* Search becomes a compact premium search pill on desktop. */
body.lt-shell-v2 #search-btn{
  width:238px;
  height:40px;
  padding:0 14px;
  justify-content:flex-start;
  gap:9px;
  border-radius:999px;
  border:1px solid #e7dbcf;
  background:#f7f0e8;
  color:#71645c;
}
body.lt-shell-v2 #search-btn::after{
  content:"Tìm kiếm truyện, tác giả...";
  font:500 .78rem/1 "DM Sans",system-ui,sans-serif;
  color:#9b8e85;
  white-space:nowrap;
}
body.lt-shell-v2 #search-btn:hover{
  background:#fffaf5;
  border-color:#dccbbb;
}
body.lt-shell-v2 #notif-badge{
  background:var(--lt-shell-accent)!important;
  box-shadow:0 0 0 2px #fffaf5;
}
body.lt-shell-v2 .user-area-desktop .btn-primary,
body.lt-shell-v2 #login-btn{
  min-height:39px;
  padding:.55rem 1.02rem;
  border-radius:999px;
  border:0;
  background:linear-gradient(135deg,#ce632d,#b94b1d);
  color:#fff;
  box-shadow:0 6px 16px rgba(188,77,30,.19);
  font-weight:700;
  font-size:.78rem;
}
body.lt-shell-v2 .user-area-desktop .btn-primary:hover,
body.lt-shell-v2 #login-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(188,77,30,.24);
}
body.lt-shell-v2 .hamburger{
  width:40px;
  height:40px;
  border-radius:12px;
}

/* ---------- MOBILE MENU ---------- */
body.lt-shell-v2 .mobile-menu{
  position:fixed;
  top:calc(var(--nav-h) + 8px);
  left:14px;
  right:14px;
  max-height:calc(100vh - var(--nav-h) - 28px);
  overflow:auto;
  padding:10px;
  border:1px solid #eadfd4;
  border-radius:18px;
  background:rgba(255,253,249,.98);
  box-shadow:0 22px 60px rgba(63,40,26,.16);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
body.lt-shell-v2 .mobile-nav-link{
  display:flex;
  align-items:center;
  min-height:46px;
  padding:0 14px;
  border-radius:12px;
  color:#4f4138;
  font-size:.9rem;
  font-weight:650;
  text-decoration:none;
}
body.lt-shell-v2 .mobile-nav-link:hover,
body.lt-shell-v2 .mobile-nav-link:active{
  background:#f9eee5;
  color:var(--lt-shell-accent);
}
body.lt-shell-v2 #mobile-user-section{
  margin-top:6px;
  padding-top:9px;
  border-top:1px solid #eee2d7;
}

/* ---------- MAIN ---------- */
body.lt-shell-v2 #main-content{
  min-height:calc(100vh - var(--nav-h));
}

/* ---------- SEARCH / AUTH / BOOKMARK OVERLAYS ---------- */
body.lt-shell-v2 .modal-box{
  border:1px solid #ebdfd3;
  border-radius:22px;
  background:#fffdf9;
  box-shadow:0 30px 80px rgba(58,36,24,.20);
}
body.lt-shell-v2 .modal-tabs{
  background:#f8f0e8;
  border-radius:14px;
  padding:4px;
}
body.lt-shell-v2 .modal-tab{border-radius:11px}
body.lt-shell-v2 .modal-tab.active{
  background:#fff;
  color:var(--lt-shell-accent);
  box-shadow:0 2px 10px rgba(70,43,28,.07);
}
body.lt-shell-v2 .bookmarks-panel{
  border-left:1px solid #eaded2;
  background:#fffdf9;
  box-shadow:-18px 0 50px rgba(65,42,28,.12);
}

/* ---------- FOOTER ---------- */
body.lt-shell-v2 .site-footer{
  position:relative;
  margin-top:72px;
  padding:0;
  background:
    radial-gradient(circle at 10% -20%,rgba(211,119,65,.13),transparent 35%),
    linear-gradient(180deg,#f8f0e7 0%,#f4eadf 100%);
  border-top:1px solid #e7d9ca;
  color:#5e5047;
}
body.lt-shell-v2 .footer-inner{
  width:min(var(--lt-shell-max),calc(100% - 48px));
  margin:0 auto;
  padding:54px 0 38px;
  display:grid;
  grid-template-columns:minmax(300px,1.6fr) minmax(150px,.7fr) minmax(170px,.8fr);
  gap:58px;
  align-items:start;
}
body.lt-shell-v2 .footer-brand{
  display:flex;
  align-items:center;
  gap:.65rem;
  margin-bottom:14px;
  color:var(--lt-shell-text);
}
body.lt-shell-v2 .footer-logo-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:linear-gradient(145deg,#d66b34,#b8491d);
  color:#fff;
  box-shadow:0 6px 16px rgba(190,79,30,.18);
}
body.lt-shell-v2 .footer-logo-text{
  font:700 1.35rem/1 "Playfair Display",Georgia,serif;
  color:var(--lt-shell-text);
}
body.lt-shell-v2 .footer-about{
  max-width:520px;
  margin:0 0 18px;
  color:#76685e;
  font-size:.87rem;
  line-height:1.75;
}
body.lt-shell-v2 .footer-socials{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
body.lt-shell-v2 .footer-social-btn{
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#755f51;
  background:rgba(255,255,255,.7);
  border:1px solid #e6d8c9;
  transition:.18s ease;
}
body.lt-shell-v2 .footer-social-btn:hover{
  color:#fff;
  background:var(--lt-shell-accent);
  border-color:var(--lt-shell-accent);
  transform:translateY(-2px);
}
body.lt-shell-v2 .footer-col-title{
  margin:3px 0 14px;
  color:#3e3027;
  font:700 1rem/1.2 "Playfair Display",Georgia,serif;
}
body.lt-shell-v2 .footer-links{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:10px;
}
body.lt-shell-v2 .footer-links a{
  color:#75675e;
  text-decoration:none;
  font-size:.84rem;
  transition:.16s ease;
}
body.lt-shell-v2 .footer-links a:hover{
  color:var(--lt-shell-accent);
  padding-left:3px;
}
body.lt-shell-v2 .footer-bottom{
  width:min(var(--lt-shell-max),calc(100% - 48px));
  margin:0 auto;
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-top:1px solid #e2d5c7;
  color:#94867c;
  font-size:.75rem;
}

/* ---------- DARK THEME ---------- */
html[data-theme="dark"] body.lt-shell-v2{
  --lt-shell-bg:#181512;
  --lt-shell-surface:rgba(31,27,23,.94);
  --lt-shell-card:#211c18;
  --lt-shell-line:#3a3029;
  --lt-shell-text:#f2e8dc;
  --lt-shell-muted:#aa9b8f;
  --lt-shell-soft:#2b241f;
  background:#181512;
}
html[data-theme="dark"] body.lt-shell-v2 .site-header{
  background:rgba(28,24,21,.90);
  border-bottom-color:#3a3029;
}
html[data-theme="dark"] body.lt-shell-v2 .site-header.scrolled{background:rgba(28,24,21,.97)}
html[data-theme="dark"] body.lt-shell-v2 .logo,
html[data-theme="dark"] body.lt-shell-v2 .logo-text{color:#f5eadf}
html[data-theme="dark"] body.lt-shell-v2 .nav-link{color:#c6b7aa}
html[data-theme="dark"] body.lt-shell-v2 .nav-link:hover,
html[data-theme="dark"] body.lt-shell-v2 .nav-link.active{background:#322820;color:#ef9a68}
html[data-theme="dark"] body.lt-shell-v2 .icon-btn{color:#c7b8ad}
html[data-theme="dark"] body.lt-shell-v2 .icon-btn:hover{background:#302720;border-color:#44372e;color:#f19a68}
html[data-theme="dark"] body.lt-shell-v2 #search-btn{background:#26211d;border-color:#40352d;color:#b8a99d}
html[data-theme="dark"] body.lt-shell-v2 #search-btn::after{color:#9e8f84}
html[data-theme="dark"] body.lt-shell-v2 .mobile-menu{background:rgba(34,29,25,.98);border-color:#44372f}
html[data-theme="dark"] body.lt-shell-v2 .mobile-nav-link{color:#d9cbc0}
html[data-theme="dark"] body.lt-shell-v2 .mobile-nav-link:hover{background:#302720}
html[data-theme="dark"] body.lt-shell-v2 .site-footer{background:#1f1a17;border-top-color:#3a3029}
html[data-theme="dark"] body.lt-shell-v2 .footer-brand,
html[data-theme="dark"] body.lt-shell-v2 .footer-logo-text,
html[data-theme="dark"] body.lt-shell-v2 .footer-col-title{color:#f0e4d9}
html[data-theme="dark"] body.lt-shell-v2 .footer-about,
html[data-theme="dark"] body.lt-shell-v2 .footer-links a{color:#ad9e92}
html[data-theme="dark"] body.lt-shell-v2 .footer-social-btn{background:#28211d;border-color:#40342c;color:#c7b6aa}
html[data-theme="dark"] body.lt-shell-v2 .footer-bottom{border-color:#3a3029;color:#8e8075}
html[data-theme="dark"] body.lt-shell-v2 .modal-box,
html[data-theme="dark"] body.lt-shell-v2 .bookmarks-panel{background:#211c18;border-color:#40352d}
html[data-theme="dark"] body.lt-shell-v2 .modal-tabs{background:#2c251f}
html[data-theme="dark"] body.lt-shell-v2 .modal-tab.active{background:#392d25;color:#f09b69}

/* ---------- RESPONSIVE ---------- */
@media (max-width:1180px){
  body.lt-shell-v2 .nav-inner{width:min(100% - 32px,var(--lt-shell-max));gap:18px}
  body.lt-shell-v2 .nav-link{padding:0 9px;font-size:.78rem}
  body.lt-shell-v2 #search-btn{width:190px}
  body.lt-shell-v2 .footer-inner,
  body.lt-shell-v2 .footer-bottom{width:min(100% - 32px,var(--lt-shell-max))}
}

@media (max-width:960px){
  :root{--nav-h:66px}
  body.lt-shell-v2 .nav-inner{width:calc(100% - 28px);gap:10px}
  body.lt-shell-v2 .nav-links{display:none}
  body.lt-shell-v2 #search-btn{width:40px;padding:0;justify-content:center;background:transparent;border-color:transparent}
  body.lt-shell-v2 #search-btn::after{display:none}
  body.lt-shell-v2 .user-area-desktop{display:none}
  body.lt-shell-v2 .hamburger{display:flex}
  body.lt-shell-v2 .footer-inner{
    grid-template-columns:1.5fr 1fr 1fr;
    gap:28px;
    padding-top:42px;
  }
}

@media (max-width:680px){
  body.lt-shell-v2 .nav-inner{width:calc(100% - 22px)}
  body.lt-shell-v2 .logo-text{font-size:1.15rem}
  body.lt-shell-v2 .logo-icon{width:31px;height:31px;border-radius:9px}
  body.lt-shell-v2 .nav-actions{gap:3px}
  body.lt-shell-v2 .nav-actions .icon-btn{width:38px;height:38px}
  body.lt-shell-v2 #bookmark-toggle{display:none}
  body.lt-shell-v2 .footer-inner{
    width:calc(100% - 32px);
    grid-template-columns:1fr 1fr;
    gap:30px 22px;
    padding:38px 0 26px;
  }
  body.lt-shell-v2 .footer-inner>.footer-col:first-child{grid-column:1/-1}
  body.lt-shell-v2 .footer-bottom{
    width:calc(100% - 32px);
    padding:18px 0 24px;
    min-height:0;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }
}

@media (max-width:420px){
  body.lt-shell-v2 .footer-inner{grid-template-columns:1fr}
  body.lt-shell-v2 .footer-inner>.footer-col:first-child{grid-column:auto}
}
