/* =========================================================
   Mobile shell / navigation
   - Header: menu | logo | account
   - Drawer menu (hamburger)
   - Bottom nav: Trang Chủ / Tài Liệu / Bài Tập / Giải Đấu / Tài Khoản
   ========================================================= */

.xq-mobile-shell,
.xq-mobile-bottomnav{
  display:none;
}

body.xq-mobile-menu-open{
  overflow:hidden;
}

@media (max-width: 1024px){
  :root{
    --xq-mobile-accent:#1199cc;
    --xq-mobile-accent-dark:#0f7ea9;
    --xq-mobile-border:#dbe3ea;
    --xq-mobile-text:#1f2937;
    --xq-mobile-muted:#667085;
  }

  .xq-wrap{
    max-width:100%;
    padding:0 0 96px;
    box-shadow:none;
    background:#f3f4f6;
  }

  .xq-mobile-shell{
    display:block;
    position:sticky;
    top:0;
    z-index:1200;
    background:#fff;
    box-shadow:0 1px 0 rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .05);
  }

  .xq-mobile-header{
    display:grid;
    grid-template-columns:46px minmax(0,1fr) 46px;
    align-items:center;
    gap:10px;
    padding:calc(10px + env(safe-area-inset-top)) 12px 10px;
  }

  .xq-mobile-iconbtn{
    width:46px;
    height:46px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:12px;
    background:var(--xq-mobile-accent);
    color:#fff;
    text-decoration:none;
    font-size:20px;
    box-shadow:0 8px 18px rgba(17, 153, 204, .22);
  }

  .xq-mobile-logo{
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
  }

  .xq-mobile-logo img{
    display:block;
    width:auto;
    max-width:180px;
    max-height:52px;
    height:auto;
  }

  .xq-mobile-backdrop{
    position:fixed;
    inset:0;
    background:rgba(15, 23, 42, .48);
    opacity:0;
    pointer-events:none;
    transition:opacity .22s ease;
    z-index:1290;
  }

  .xq-mobile-backdrop.is-open{
    opacity:1;
    pointer-events:auto;
  }

  .xq-mobile-drawer{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:min(86vw, 360px);
    background:#fff;
    transform:translateX(-105%);
    transition:transform .22s ease;
    z-index:1300;
    display:flex;
    flex-direction:column;
    box-shadow:18px 0 32px rgba(15, 23, 42, .16);
  }

  .xq-mobile-drawer.is-open{
    transform:translateX(0);
  }

  .xq-mobile-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:calc(14px + env(safe-area-inset-top)) 16px 14px;
    border-bottom:1px solid var(--xq-mobile-border);
    background:#fff;
  }

  .xq-mobile-drawer-title{
    font-size:18px;
    font-weight:800;
    color:var(--xq-mobile-text);
  }

  .xq-mobile-drawer-close{
    width:36px;
    height:36px;
    border:0;
    border-radius:10px;
    background:#eef6fb;
    color:var(--xq-mobile-accent-dark);
    font-size:26px;
    line-height:1;
  }

  .xq-mobile-drawer-body{
    flex:1;
    overflow:auto;
    padding:14px 14px calc(18px + env(safe-area-inset-bottom));
    background:#fff;
  }

  .xq-mobile-usercard,
  .xq-mobile-guestcard{
    margin-bottom:14px;
    padding:14px;
    border:1px solid var(--xq-mobile-border);
    border-radius:16px;
    background:#f8fbfd;
  }

  .xq-mobile-usercard-title{
    font-size:16px;
    font-weight:800;
    color:var(--xq-mobile-text);
    margin-bottom:8px;
  }

  .xq-mobile-usercard-meta,
  .xq-mobile-guesttext{
    color:var(--xq-mobile-muted);
    font-size:13px;
    line-height:1.6;
  }

  .xq-mobile-usercard-meta div + div{
    margin-top:4px;
  }

  .xq-mobile-guestactions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:12px;
  }

  .xq-mobile-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:0 14px;
    border-radius:999px;
    border:1px solid var(--xq-mobile-border);
    background:#fff;
    color:var(--xq-mobile-text);
    font-weight:700;
    text-decoration:none;
  }

  .xq-mobile-pill.is-primary{
    border-color:var(--xq-mobile-accent);
    background:var(--xq-mobile-accent);
    color:#fff;
  }

  .xq-mobile-menu-section + .xq-mobile-menu-section{
    margin-top:14px;
  }

  .xq-mobile-menu-heading{
    margin:0 0 8px;
    padding-left:2px;
    font-size:13px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--xq-mobile-muted);
  }

  .xq-mobile-menu-list{
    list-style:none;
    margin:0;
    padding:0;
    border:1px solid var(--xq-mobile-border);
    border-radius:16px;
    overflow:hidden;
    background:#fff;
  }

  .xq-mobile-menu-list li + li{
    border-top:1px solid #edf1f5;
  }

  .xq-mobile-menu-list a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:48px;
    padding:12px 14px;
    color:var(--xq-mobile-text);
    text-decoration:none;
    font-weight:700;
  }

  .xq-mobile-menu-list a::after{
    content:"›";
    font-size:18px;
    color:#98a2b3;
  }

  .xq-mobile-menu-list a.is-active{
    color:var(--xq-mobile-accent-dark);
    background:#eef8fc;
  }

  .xq-mobile-menu-list.is-compact a{
    min-height:42px;
    font-weight:600;
  }

  .xq-header,
  .xq-topnav,
  .xq-sidebar,
  .xq-breadcrumb{
    display:none !important;
  }

  .xq-layout{
    display:block;
    width:100%;
    margin:0;
    padding:12px;
  }

  .xq-content{
    width:100%;
    flex:none;
    min-width:0;
  }

  .xq-box{
    border:1px solid #e5e7eb;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 6px 18px rgba(15, 23, 42, .05);
  }

  .xq-box-head{
    margin:0;
    padding:12px 14px;
    background:#fff;
    border-bottom:1px solid #eef2f6;
  }

  .xq-box-badge{
    display:none;
  }

  .xq-box-title{
    font-size:15px;
  }

  .xq-box-body{
    padding:14px;
    background:#fff;
  }

  /* Home mobile: giữ kiểu khung cũ (vuông góc + border vàng) */
  .xq-home-box{
    border:1px solid var(--xq-border);
    border-radius:0;
    overflow:visible;
    box-shadow:none;
    background:#fff;
  }

  .xq-home-box.xq-slideshow-box{
    border:2px solid var(--xq-border);
    margin-bottom:12px;
  }

  .xq-home-box .xq-box-head{
    display:flex;
    align-items:center;
    gap:8px;
    margin:6px 8px 0;
    padding:6px 10px;
    background:var(--xq-panel);
    border:0;
    box-shadow:none;
  }

  .xq-home-box .xq-box-badge{
    display:block;
    width:28px;
    height:28px;
    flex:0 0 28px;
    background:url("../images/box-title.png") center/contain no-repeat;
    border:0;
    border-radius:0;
  }

  .xq-home-box .xq-box-title{
    font-size:15px;
    font-weight:800;
    letter-spacing:.3px;
  }

  .xq-home-box .xq-box-body{
    padding:12px;
    padding-top:0;
    background:#fff;
  }

  .xq-home-box.xq-slideshow-box > .xq-box-body.xq-slideshow-body{
    padding:0 !important;
  }

  .xq-footer{
    min-height:0;
    margin:10px 12px 0;
    padding-bottom:0;
    background:transparent;
    overflow:visible;
  }

  .xq-footer::before{
    display:none;
  }

  .xq-footer-inner,
  .xq-footer-links{
    max-width:none;
    border-radius:16px;
    border:1px solid #e5e7eb;
    box-shadow:0 4px 14px rgba(15, 23, 42, .04);
  }

  .xq-footer-inner{
    margin:0 0 10px;
  }

  .xq-mobile-bottomnav{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:0;
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:1200;
    padding:8px 6px calc(8px + env(safe-area-inset-bottom));
    background:rgba(255, 255, 255, .96);
    backdrop-filter:blur(10px);
    box-shadow:0 -8px 24px rgba(15, 23, 42, .10);
  }

  .xq-mobile-bottomnav-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height:58px;
    padding:4px 2px;
    color:#6b7280;
    text-decoration:none;
    font-size:11px;
    font-weight:700;
    border-radius:14px;
  }

  .xq-mobile-bottomnav-item i{
    font-size:18px;
  }

  .xq-mobile-bottomnav-item span{
    display:block;
    line-height:1.15;
    text-align:center;
  }

  .xq-mobile-bottomnav-item.is-active{
    color:var(--xq-mobile-accent-dark);
    background:#eef8fc;
  }
}

@media (max-width: 480px){
  .xq-mobile-header{
    grid-template-columns:44px minmax(0,1fr) 44px;
    gap:8px;
    padding-left:10px;
    padding-right:10px;
  }

  .xq-mobile-iconbtn{
    width:44px;
    height:44px;
    border-radius:11px;
    font-size:18px;
  }

  .xq-mobile-logo img{
    max-width:156px;
    max-height:48px;
  }

  .xq-layout{
    padding:10px;
  }

  .xq-box-body{
    padding:12px;
  }

  .xq-mobile-bottomnav-item{
    font-size:10px;
  }

  .xq-mobile-bottomnav-item i{
    font-size:17px;
  }
}
