* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #f7f8ff;
}

h1 {
  font-size: 42px;
  margin: 10px 0;
}

h2 {
  font-size: 38px;
  color: #6c5ce7;
  margin: 0;
}

a {
  text-decoration: none;
}

/* ============================================
   2. PAGE LAYOUT
============================================ */
.body {
  margin: 0;
  padding: 0 60px;
  box-sizing: border-box;
}

/* ============================================
   NAVBAR
============================================ */
.navbar {
  height: 75px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  position: sticky !important;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #ececec;
  overflow: visible;
}

.navbar {
  height: var(--nav-h);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid #e2e4f0;
  box-shadow:
    0 1px 3px rgba(15, 16, 33, 0.06),
    0 1px 2px rgba(15, 16, 33, 0.04);
  padding: 0 30px;
  gap: 6px;
  overflow: visible;
}

.cat {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: visible;
}

.cat a {
  text-decoration: none;
  color: #333;
  font-weight: 550;
}

/* ============================================
   LOGO
============================================ */
.logo {
  background-image: url("../../image/logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  width: 140px;
  height: 70px;
}

/* ============================================
   NAVIGATION DROPDOWNS
============================================ */

/* --- Shared Dropdown Button --- */
.tools-btn,
.categories-btn {
  height: 44px;
  padding: 0 18px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}

.tools-btn:hover,
.categories-btn:hover {
  background: #f5f5f5;
}

.tools-btn svg,
.categories-btn svg {
  transition: transform 0.25s;
}

/* --- Shared Dropdown Menu --- */
.tools-dropdown,
.categories-dropdown {
  position: relative;
  display: inline-block;
}

.tools-menu,
.categories-menu {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 980px;
  background: #fff;
  border-radius: 24px;
  padding: 28px 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.08),
    0 5px 15px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease,
    transform 0.28s ease;
  z-index: 999999;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tools-menu::-webkit-scrollbar,
.categories-menu::-webkit-scrollbar {
  display: none;
}

.tools-dropdown:hover .tools-menu,
.categories-dropdown:hover .categories-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tools-dropdown:hover .tools-btn svg,
.categories-dropdown:hover .categories-btn svg {
  transform: rotate(180deg);
}

/* --- Tools Column Links --- */
.tools-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tools-column a {
  text-decoration: none;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    background 0.22s ease,
    transform 0.22s ease,
    color 0.22s ease;
}

.tools-column a i {
  width: 18px;
  font-size: 16px;
  color: #e5322d;
  transition: transform 0.22s ease;
}

.tools-column a span {
  flex: 1;
}

.tools-column a:hover {
  background: #f4f7fb;
  transform: translateX(4px);
}

.tools-column a:hover i {
  transform: scale(1.1);
}

/* --- Category Box --- */
.category-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-box h3 {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.category-box a {
  text-decoration: none;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    background 0.22s ease,
    transform 0.22s ease;
}

.category-box a i {
  width: 18px;
  font-size: 16px;
  color: #e5322d;
  transition: transform 0.22s ease;
}

.category-box a:hover {
  background: #f4f7fb;
  transform: translateX(4px);
}

.category-box a:hover i {
  transform: scale(1.08);
}

/* ============================================
   QUICK TOOLS
============================================ */
.quick-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-tool a {
  height: 44px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #222;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition:
    background 0.22s ease,
    color 0.22s ease;
}

.nav-tool a:hover {
  background: #f4f7fb;
  color: #e5322d;
}

/* ============================================
   THEME SWITCH
============================================ */
.theme-switch {
  width: 150px;
  height: 40px;
  position: relative;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(145deg, #eaf2ff, #cfe0ff);
  box-shadow:
    inset 1px 1px 4px rgba(255, 255, 255, 0.8),
    inset -1px -1px 4px rgba(0, 0, 0, 0.08),
    0 3px 10px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.theme-switch:hover .slider {
  transform: scale(1.03);
}

.slider {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  transition:
    left 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.slider i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  width: 100%;
  height: 100%;
}

.fa-sun {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.fa-moon {
  color: white;
}

.theme-text {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
  pointer-events: none;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.theme-switch:not(.active) .theme-text {
  transform: translate(-50%, -50%) translateX(12px);
}

.theme-switch.active .theme-text {
  transform: translate(-50%, -50%) translateX(-10px);
}

.theme-switch.active .slider {
  left: 114px;
}

/* ============================================
   MOBILE SIDEBAR
============================================ */
.mobile-sidebar {
  display: none;
}

.menu-btn {
  display: none;
}

/* ============================================
   DARK MODE — NAVBAR
============================================ */
body.dark .navbar {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark .logo {
  filter: brightness(0) invert(1);
}

body.dark .cat a,
body.dark .tools-btn,
body.dark .categories-btn,
body.dark .nav-tool a {
  color: #e2e8f0 !important;
}

body.dark .tools-btn svg,
body.dark .categories-btn svg {
  stroke: #e2e8f0;
}

body.dark .tools-btn:hover,
body.dark .categories-btn:hover,
body.dark .nav-tool a:hover {
  background: #334155;
  color: #a5b4fc !important;
}

/* Dropdown Menus Dark */
body.dark .tools-menu,
body.dark .categories-menu {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.dark .tools-column a,
body.dark .category-box a {
  color: #e2e8f0;
}

body.dark .tools-column a i,
body.dark .category-box a i {
  color: #f87171;
}

body.dark .tools-column a:hover,
body.dark .category-box a:hover {
  background: #334155;
  color: #e2e8f0;
}

body.dark .category-box h3 {
  color: #f1f5f9;
  border-bottom-color: #334155;
}

/* Theme Switch Dark */
body.dark .theme-switch {
  background: linear-gradient(145deg, #1d4ed8, #0f172a);
  box-shadow:
    inset 1px 1px 4px rgba(255, 255, 255, 0.04),
    inset -1px -1px 4px rgba(0, 0, 0, 0.4),
    0 3px 10px rgba(37, 99, 235, 0.25);
}

body.dark .theme-text {
  color: #dbeafe;
}

body.dark .slider {
  background: #2563eb;
  color: white;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
}

/* ============================================
   RESPONSIVE — NAVBAR
============================================ */
@media (max-width: 950px) {
  .quick-tools {
    display: none;
  }
}

@media (max-width: 900px) {
  .navbar {
    height: 70px;
  }

  .cat {
    gap: 18px;
  }

  .cat a {
    font-size: 13px;
  }

  .logo {
    width: 120px;
    height: 65px;
  }

  .theme-switch {
    width: 125px;
    height: 36px;
  }

  .slider {
    width: 28px;
    height: 28px;
    top: 4px;
    left: 4px;
  }

  .slider i {
    font-size: 13px;
  }

  .theme-text {
    font-size: 11px;
  }

  .theme-switch:not(.active) .theme-text {
    transform: translate(-50%, -50%) translateX(10px);
  }

  .theme-switch.active .theme-text {
    transform: translate(-50%, -50%) translateX(-12px);
  }

  .theme-switch.active .slider {
    left: 93px;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 62px;
    padding: 0 12px;
    justify-content: space-between;
  }

  .cat {
    display: none !important;
  }

  .logo {
    width: 110px;
    height: 50px;
    margin-left: 0;
  }

  .theme-switch {
    width: 100px;
    height: 32px;
    margin-right: 0;
    margin-left: auto;
  }

  .slider {
    width: 24px;
    height: 24px;
    top: 4px;
    left: 4px;
  }

  .slider i {
    font-size: 11px;
  }

  .theme-text {
    font-size: 10px;
  }

  .theme-switch:not(.active) .theme-text {
    transform: translate(-50%, -50%) translateX(10px);
  }

  .theme-switch.active .theme-text {
    transform: translate(-50%, -50%) translateX(-10px);
  }

  .theme-switch.active .slider {
    left: 72px;
  }

  /* Hamburger */
  .menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    margin-right: 10px;
    background: none;
    border: none;
    padding: 0;
    position: relative;
    z-index: 1010;
  }

  .hamburger-line {
    display: block;
    width: 22px;
    height: 2.4px;
    background: #222;
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
  }

  .menu-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7.4px) rotate(45deg);
  }

  .menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .menu-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.4px) rotate(-45deg);
  }

  body.dark .hamburger-line {
    background: #e2e8f0;
  }

  /* Mobile Sidebar */
  .mobile-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }

  .mobile-sidebar.active {
    transform: translateX(0);
  }

  body.dark .mobile-sidebar {
    background: #1e293b;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    height: 62px;
    min-height: 62px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
  }

  body.dark .sidebar-header {
    border-bottom-color: #334155;
    background: #1e293b;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
  }

  .sidebar-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
  }

  body.dark .sidebar-logo-img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
  }

  .sidebar-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    border-radius: 10px;
    transition: background 0.2s ease;
  }

  .sidebar-close:hover {
    background: #f5f5f5;
  }

  body.dark .sidebar-close:hover {
    background: #334155;
  }

  .close-line {
    display: block;
    width: 20px;
    height: 2.6px;
    background: #333;
    border-radius: 2px;
    position: absolute;
  }

  .close-line:nth-child(1) {
    transform: rotate(45deg);
  }

  .close-line:nth-child(2) {
    transform: rotate(-45deg);
  }

  body.dark .close-line {
    background: #e2e8f0;
  }

  .sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0 40px;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-body::-webkit-scrollbar {
    width: 4px;
  }

  .sidebar-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
  }

  body.dark .sidebar-body::-webkit-scrollbar-thumb {
    background: #475569;
  }

  .sidebar-category {
    padding: 4px 0;
  }

  .sidebar-category + .sidebar-category {
    border-top: 1px solid #f0f0f0;
  }

  body.dark .sidebar-category + .sidebar-category {
    border-top-color: #2a3040;
  }

  .sidebar-category h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    padding: 18px 26px 8px;
    margin: 0;
  }

  body.dark .sidebar-category h3 {
    color: #64748b;
  }

  .sidebar-category a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 26px;
    text-decoration: none;
    color: #222;
    font-size: 16px;
    font-weight: 500;
    transition:
      background 0.2s ease,
      color 0.2s ease,
      padding-left 0.2s ease;
  }

  .sidebar-category a:hover {
    background: #f7f7fb;
    color: #e5322d;
    padding-left: 30px;
  }

  body.dark .sidebar-category a {
    color: #e2e8f0;
  }

  body.dark .sidebar-category a:hover {
    background: #282d3e;
    color: #f87171;
  }

  .sidebar-category a i {
    width: 22px;
    font-size: 18px;
    color: #e5322d;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .sidebar-category a:hover i {
    transform: scale(1.12);
  }

  body.dark .sidebar-category a i {
    color: #f87171;
  }

  body.dark .sidebar-category a:hover i {
    color: #fca5a5;
  }

  .sidebar-category a span {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .navbar {
    height: 58px;
    padding: 0 10px;
  }

  .logo {
    width: 95px;
    height: 44px;
  }

  .theme-switch {
    width: 88px;
    height: 28px;
  }

  .slider {
    width: 20px;
    height: 20px;
    top: 4px;
    left: 4px;
  }

  .slider i {
    font-size: 10px;
  }

  .theme-text {
    font-size: 9px;
  }

  .theme-switch:not(.active) .theme-text {
    transform: translate(-50%, -50%) translateX(10px);
  }

  .theme-switch.active .theme-text {
    transform: translate(-50%, -50%) translateX(-10px);
  }

  .theme-switch.active .slider {
    left: 64px;
  }

  .hamburger-line {
    width: 19px;
    height: 2.2px;
  }

  .menu-btn {
    gap: 4.5px;
    width: 34px;
    height: 34px;
    margin-right: 6px;
  }

  .sidebar-header {
    padding: 0 16px;
    height: 56px;
    min-height: 56px;
  }

  .sidebar-logo-img {
    height: 28px;
  }

  .sidebar-close {
    width: 36px;
    height: 36px;
  }

  .close-line {
    width: 18px;
    height: 2.4px;
  }

  .sidebar-category a {
    font-size: 15px;
    padding: 11px 20px;
    gap: 12px;
  }

  .sidebar-category a i {
    font-size: 16px;
    width: 20px;
  }

  .sidebar-category h3 {
    font-size: 10px;
    padding: 14px 20px 6px;
  }
}

@media (max-width: 320px) {
  .navbar {
    height: 50px !important;
    padding: 0 6px !important;
  }

  .logo {
    width: 80px !important;
    height: 38px !important;
  }

  .theme-switch {
    width: 72px !important;
    height: 24px !important;
  }

  .slider {
    width: 18px !important;
    height: 18px !important;
  }

  .slider i {
    font-size: 8px !important;
  }

  .theme-text {
    font-size: 7px !important;
  }

  .theme-switch.active .slider {
    left: 50px !important;
  }

  .menu-btn {
    width: 30px !important;
    height: 30px !important;
    margin-right: 4px !important;
  }

  .hamburger-line {
    width: 16px !important;
    height: 2px !important;
  }

  .sidebar-header {
    padding: 0 12px !important;
    height: 50px !important;
    min-height: 50px !important;
  }

  .sidebar-logo-img {
    height: 24px !important;
  }

  .sidebar-close {
    width: 30px !important;
    height: 30px !important;
  }

  .close-line {
    width: 14px !important;
    height: 2px !important;
  }

  .sidebar-category a {
    font-size: 13px !important;
    padding: 10px 16px !important;
    gap: 10px !important;
  }

  .sidebar-category a i {
    width: 18px !important;
    font-size: 14px !important;
  }

  .sidebar-category h3 {
    font-size: 9px !important;
    padding: 12px 16px 6px !important;
  }
}

/* ============================================
   LARGE SCREENS
============================================ */
@media (max-width: 1100px) {
  .logo {
    width: 135px;
  }

  .tools-menu,
  .categories-menu {
    width: 90%;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1100px) {
  .tools-menu,
  .categories-menu {
    width: 90%;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 24px;
  }
}

@media (max-width: 900px) {
  .tools-menu,
  .categories-menu {
    width: 92%;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .tools-menu,
  .categories-menu {
    width: calc(100vw - 20px);
    top: 70px;
    left: 10px;
    transform: translateY(10px);
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    max-height: 75vh;
    overflow-y: auto;
    border-radius: 18px;
  }

  .tools-dropdown:hover .tools-menu,
  .categories-dropdown:hover .categories-menu {
    transform: translateY(0);
  }

  .tools-column a,
  .category-box a {
    padding: 10px 12px;
    font-size: 14px;
  }

  .category-box h3 {
    font-size: 15px;
    margin-bottom: 10px;
  }
}

@media (min-width: 1200px) {
  .body {
    padding: 0 40px;
  }
}

@media (min-width: 1360px) {
  .navbar {
    height: 82px;
  }

  .logo {
    width: 156px;
    height: 78px;
  }

  .tools-btn,
  .categories-btn,
  .nav-tool a {
    font-size: 15px;
    height: 46px;
  }

  .theme-switch {
    width: 162px;
    height: 42px;
  }

  .theme-switch.active .slider {
    left: 122px;
  }

  .tools-menu,
  .categories-menu {
    width: min(1100px, 88vw);
    padding: 30px 32px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .navbar {
    padding: 18px 40px !important;
  }

  .logo {
    font-size: 22px !important;
  }

  .tools-btn,
  .categories-btn {
    font-size: 16px !important;
    padding: 10px 18px !important;
  }

  .nav-tool a {
    font-size: 15px !important;
  }

  .theme-switch {
    transform: scale(1.05);
  }

  .navbar {
    height: 88px;
  }

  .logo {
    width: 170px;
    height: 84px;
  }

  .tools-menu,
  .categories-menu {
    width: min(1240px, 86vw);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 2000px) {
  .navbar {
    padding: 22px 60px !important;
  }

  .tools-btn,
  .categories-btn {
    font-size: 18px !important;
    padding: 12px 22px !important;
  }

  .nav-tool a {
    font-size: 17px !important;
  }

  .logo {
    font-size: 26px !important;
  }
}

@media (min-width: 1920px) {
  .navbar {
    height: 92px;
  }

  .logo {
    width: 182px;
    height: 90px;
  }

  .tools-menu,
  .categories-menu {
    width: min(1450px, 84vw);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 2560px) {
  .navbar {
    height: 100px;
  }

  .logo {
    width: 198px;
    height: 96px;
  }

  .tools-menu,
  .categories-menu {
    width: min(1800px, 82vw);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 34px 36px;
  }
}

@media (min-width: 3000px) {
  .navbar {
    padding: 28px 80px !important;
  }

  .tools-btn,
  .categories-btn {
    font-size: 22px !important;
    padding: 14px 26px !important;
  }

  .nav-tool a {
    font-size: 20px !important;
  }

  .logo {
    font-size: 30px !important;
  }
}

@media (min-width: 3200px) {
  .navbar {
    height: 108px;
  }

  .logo {
    width: 220px;
    height: 106px;
  }

  .tools-menu,
  .categories-menu {
    width: min(2100px, 80vw);
  }
}

@media (min-width: 3840px) {
  .navbar {
    height: 116px;
  }

  .logo {
    width: 240px;
    height: 114px;
  }

  .tools-menu,
  .categories-menu {
    width: min(2400px, 78vw);
  }
}

/* ============================================
   MOBILE OVERLAY
============================================ */
.mobile-overlay,
.menu-overlay {
  display: none;
}
