/* Reset */
    * {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background-color: #f0f4f8;
      color: #222;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      line-height: 1.5;
    }
    a {
      color: #1e40af; /* blue-800 */
      text-decoration: none;
      transition: color 0.3s ease;
    }
    a:hover,
    a:focus {
      text-decoration: underline;
      color: #1e3a8a; /* blue-900 */
      outline: none;
    }

    /* Header */
    header {
      background-color: #2563eb; /* blue-600 */
      color: white;
      padding: 1.25rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      box-shadow: 0 3px 8px rgba(37, 99, 235, 0.6);
      position: sticky;
      top: 0;
      z-index: 10000;
    }
    header .logo {
      font-weight: 700;
      font-size: 1.7rem;
      user-select: none;
      letter-spacing: 1px;
      cursor: default;
      flex-shrink: 0;
    }
    header .logo a {
        color:#FFF;
    }
    header .search-box {
      flex: 1 1 320px;
      margin-left: 2rem;
      max-width: 350px;
      position: relative;
      order: 3;
      width: 100%;
    }
    header .search-box input[type="search"] {
      width: 100%;
      padding: 0.6rem 1.2rem;
      border-radius: 25px;
      border: none;
      font-size: 1rem;
      outline: none;
      box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
      transition: box-shadow 0.3s ease;
      color: #222;
    }
    header .search-box input[type="search"]:focus {
      box-shadow: 0 0 12px rgba(37, 99, 235, 0.7);
    }

    /* Menu */
    nav.main-menu {
      display: flex;
      gap: 1.25rem;
      flex-shrink: 0;
      position: relative;
      order: 2;
    }
    nav.main-menu > ul {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      gap: 1rem;
      align-items: center;
    }
    nav.main-menu li {
      position: relative;
    }
    nav.main-menu > ul > li > a {
      font-weight: 600;
      padding: 0.4rem 0.6rem;
      display: inline-block;
      cursor: pointer;
      user-select: none;
      color: white;
    }
    nav.main-menu > ul > li > a:hover,
    nav.main-menu > ul > li > a:focus {
        color: #bfdbfe;
      outline: none;
      text-decoration: underline;
    }

    /* Dropdown */
    nav.main-menu li ul.dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      background: white;
      border-radius: 6px;
      box-shadow: 0 6px 15px rgba(0,0,0,0.15);
      min-width: 160px;
      padding: 0.5rem 0;
      display: none;
      z-index: 1000;
    }
    nav.main-menu li:hover > ul.dropdown,
    nav.main-menu li:focus-within > ul.dropdown {
      display: block;
    }
    nav.main-menu li ul.dropdown li a {
      color: #2563eb;
      padding: 0.5rem 1rem;
      font-weight: 500;
      display: block;
      white-space: nowrap;
    }
    nav.main-menu li ul.dropdown li a:hover,
    nav.main-menu li ul.dropdown li a:focus {
      background-color: #dbeafe; /* blue-100 */
      color: #1e40af;
      outline: none;
      text-decoration: none;
    }

    /* Hamburger for mobile */
    .hamburger {
      display: none;
      flex-direction: column;
      justify-content: space-around;
      width: 28px;
      height: 24px;
      cursor: pointer;
      order: 1;
      z-index: 10001;
    }
    .hamburger span {
      width: 100%;
      height: 3px;
      background-color: white;
      border-radius: 2px;
      transition: all 0.3s;
    }
    /* Hamburger open state */
    .hamburger.active span:nth-child(1) {
      transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger.active span:nth-child(2) {
      opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
      transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Layout chính */
    .container {
      display: flex;
      flex: 1;
      max-width: 1200px;
      margin: 2rem auto 3rem;
      padding: 0 1.25rem;
      gap: 1.75rem;
      width: 100%;
    }

    /* Sidebar Category */
    aside.sidebar {
      width: 240px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 15px rgba(0,0,0,0.08);
      padding: 1.5rem 0.5rem 2rem;
      height: fit-content;
      position: sticky;
      top: 80px; /* header height + margin */
      scrollbar-width: thin;
      scrollbar-color: #2563eb #e0e7ff; /* blue-600, blue-100 */
      overflow-y: auto;
      max-height: calc(100vh - 100px);
      user-select: none;
      flex-shrink: 0;
    }
    aside.sidebar::-webkit-scrollbar {
      width: 8px;
    }
    aside.sidebar::-webkit-scrollbar-track {
      background: #e0e7ff; /* blue-100 */
      border-radius: 8px;
    }
    aside.sidebar::-webkit-scrollbar-thumb {
      background-color: #2563eb; /* blue-600 */
      border-radius: 8px;
    }
    aside.sidebar h2 {
      font-size: 1.3rem;
      margin-bottom: 1.25rem;
      border-bottom: 3px solid #2563eb; /* blue-600 */
      padding-bottom: 0.35rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      color: #1e40af; /* blue-800 */
    }
    aside.sidebar ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    aside.sidebar li {
      margin-bottom: 1rem;
    }
    aside.sidebar li a {
      font-weight: 600;
      color: #444;
      display: block;
      padding: 0.45rem 0.75rem;
      border-radius: 8px;
      transition: background-color 0.3s ease, color 0.3s ease;
      box-shadow: inset 0 0 0 0 #2563eb;
      border: 2px solid transparent;
      user-select: text;
      cursor: pointer;
    }
    aside.sidebar li a:hover,
    aside.sidebar li a:focus {
      background-color: #2563eb; /* blue-600 */
      color: white;
      box-shadow: inset 0 0 0 2px white;
      outline: none;
    }

    /* Main content */
    main.content {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2.8rem;
      min-width: 0;
    }

    section.block {
      background: white;
      border-radius: 12px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.06);
      padding: 1.5rem 1rem;
      transition: box-shadow 0.3s ease;
    }
    section.block:hover {
      box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }
    section.block h2 {
      margin-top: 0;
      border-bottom: 3px solid #2563eb; /* blue-600 */
      padding-bottom: 0.5rem;
      font-weight: 800;
      color: #1e40af; /* blue-800 */
      font-size: 1.6rem;
      letter-spacing: 0.03em;
      user-select: none;
    }

    /* Danh sách câu hỏi */
    ul.question-list {
      list-style: none;
      padding: 0;
      margin: 1.25rem 0 0 0;
    }
    ul.question-list li {
      padding: 0.85rem 0;
      border-bottom: 1px solid #ddd;
      display: flex;
      gap: 1.25rem;
      align-items: center;
      flex-wrap: wrap;
      transition: background-color 0.2s ease;
      border-radius: 8px;
      cursor: default;
    }
    ul.question-list li:last-child {
      border-bottom: none;
    }
    ul.question-list li:hover {
      background-color: #e0e7ff; /* blue-100 */
    }
    .vote {
      flex-shrink: 0;
      width: 46px;
      height: 46px;
      background-color: #2563eb; /* blue-600 */
      color: white;
      font-weight: 700;
      font-size: 1.15rem;
      border-radius: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      user-select: none;
      box-shadow: 0 3px 8px rgba(37, 99, 235, 0.6);
      transition: background-color 0.3s ease;
    }
    .vote:hover {
      background-color: #1e40af; /* blue-800 */
      box-shadow: 0 5px 14px rgba(30, 64, 175, 0.7);
    }
    .question-info {
      flex: 1;
      min-width: 0;
    }
    .question-title {
      margin: 0;
      font-weight: 700;
      font-size: 1.15rem;
      color: #1e3a8a; /* blue-900 */
      transition: color 0.3s ease;
    }
    .question-title a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    }
    .question-title a:hover,
    .question-title a:focus {
      color: #1e40af; /* blue-800 */
      outline: none;
    }
    .question-description {
        overflow-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
    }
    .question-meta {
      font-size: 0.82rem;
      color: #666;
      margin-top: 0.35rem;
      user-select: none;
    }
    .question-meta span {
      margin-right: 1.3rem;
    }

    /* Tiêu đề danh mục với background xanh nhạt, bo góc */
    .category-title {
      display: inline-block;
      background-color: #dbeafe; /* blue-100 */
      border-radius: 8px;
      padding: 0.35rem 1rem;
      color: #2563eb; /* blue-600 */
      font-weight: 700;
      font-size: 1.4rem;
      margin-bottom: 1rem;
      user-select: none;
    }

    /* Footer */
    footer {
      background-color: #1e3a8a; /* blue-900 */
      color: #dbeafe; /* blue-100 */
      text-align: left;
      padding: 2rem 1rem 1.5rem;
      margin-top: auto;
      font-size: 0.95rem;
      user-select: none;
      letter-spacing: 0.02em;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
      display: block;
      flex-wrap: wrap;
      justify-content: center;
      gap: 3rem;
    }
    footer .footer-block {
      min-width: 160px;
      max-width: 300px;
      text-align: left;
    }
    footer .footer-block h4 {
      margin-top: 0;
      margin-bottom: 0.75rem;
      font-weight: 700;
      font-size: 1.1rem;
      color: #bfdbfe; /* blue-300 */
      user-select: none;
    }
    footer .footer-block ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    footer .footer-block ul li {
      margin-bottom: 0.5rem;
    }
    footer .footer-block ul li a {
      color: #a5b4fc; /* blue-400 */
      font-weight: 500;
    }
    footer .footer-block ul li a:hover,
    footer .footer-block ul li a:focus {
      color: #3b82f6; /* blue-500 */
      text-decoration: underline;
      outline: none;
    }
    .copyright{
      text-align:center;
    }
    .w-8 {
      width: 2rem;
    }
    .mt-5{
      margin-top:5px !important;
    }
    .mb-5{
      margin-bottom:5px !important;
    }
    .mt-10{
      margin-top:10px !important;
    }
    .mb-10{
      margin-bottom:10px !important;
    }
    /* Responsive */
    @media only screen and (min-width: 990px){
      .question-description{
        max-height:50px;
        overflow:hidden;
      }
    }
    @media (max-width: 1024px) {
      .container {
        flex-direction: column;
        max-width: 99%;
      }
      aside.sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
        max-height: none;
        overflow-y: visible;
        user-select: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
      }
    }
    @media (max-width: 768px) {
      /* Hide menu by default */
      nav.main-menu {
        position: fixed;
        top: 78px;
        right: 0;
        background: #2563eb;
        height: calc(100vh - 60px);
        width: 268px;
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -3px 0 10px rgba(0,0,0,0.3);
        z-index: 10001;
      }
      nav.main-menu.open {
        transform: translateX(0);
      }
      nav.main-menu > ul {
        flex-direction: column;
        gap: 0;
      }
      nav.main-menu li {
        width: 100%;
      }
      nav.main-menu > ul > li > a {
        padding: 1rem 1.5rem;
        display: block;
        font-weight: 700;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        color: white;
      }
      nav.main-menu > ul > li > a:hover,
      nav.main-menu > ul > li > a:focus {
        background-color: #1e40af;
        color: white;
        outline: none;
        text-decoration: none;
      }
      nav.main-menu li ul.dropdown {
        position: static;
        background: transparent;
        box-shadow: none;
        padding-left: 1rem;
        display: none;
      }
      nav.main-menu li.open > ul.dropdown {
        display: block;
      }
      nav.main-menu li ul.dropdown li a {
        padding: 0.7rem 2rem;
        color: #bfdbfe;
        border-bottom: 1px solid rgba(255,255,255,0.1);
      }
      nav.main-menu li ul.dropdown li a:hover,
      nav.main-menu li ul.dropdown li a:focus {
        background-color: #3b82f6;
        color: white;
        outline: none;
        text-decoration: none;
      }

      /* Hamburger */
      .hamburger {
        display: flex;
      }

      /* Adjust header layout */
      header .search-box {
        order: 4;
        margin: 1rem 0 0 0;
        max-width: 100%;
      }
      nav.main-menu {
        order: 3;
      }

      .container {
        margin-top: 1rem;
      }
    }
    @media (max-width: 480px) {
    ul.question-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    .vote {
        width: 100%;
        height: auto;
        border-radius: 10px;
        margin-bottom: 0.6rem;
        font-size: 1.3rem;
        padding: 0.6rem 0;
        text-align: center;
        box-shadow: 0 3px 8px rgba(37, 99, 235, 0.6);
    }
    .question-description {
        white-space: normal;
    }
    }