/* ====== HEADER ====== */
.header {
  background: #ffffff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header .container {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111;
  font-weight: bold;
  font-size: 20px;
}
.logo img {
  height: 32px;
}
.nav {
  display: flex;
  gap: 20px;
}
.nav a {
  text-decoration: none;
  font-weight: 500;
  color: #333;
}
.nav a:hover {
  color: #0078ff;
}

/* Dark mode button */
.theme-btn {
  padding: 6px 10px;
  border: none;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

/* ====== FOOTER ====== */
.footer {
  background: #111;
  color: #eee;
  padding: 40px 0;
  margin-top: 60px;
}
.footer .container {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links a {
  color: #ccc;
  text-decoration: none;
}
.footer-links a:hover {
  color: white;
}

.footer-right {
  font-size: 14px;
}

/* Dark mode */
body.dark {
  background: #111;
  color: #eee;
}
body.dark .header {
  background: #222;
  border-bottom: 1px solid #333;
}
body.dark .nav a {
  color: #ddd;
}
body.dark .nav a:hover {
  color: #4aa3ff;
}
body.dark .footer {
  background: #000;
}
/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, #ffbb55, #ff7f50);
  color: white;
}
.hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
}
.hero p {
  font-size: 18px;
  margin-bottom: 20px;
}
.btn {
  background: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  color: black;
  font-weight: bold;
}
.btn:hover {
  background: #eee;
}

/* ===== TOOLS ===== */
.tools-section h2 {
  margin-top: 40px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.tool-card {
  background: white;
  border: 1px solid #ddd;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: black;
  border-radius: 8px;
  transition: 0.2s;
}
.tool-card:hover {
  border-color: #007bff;
  transform: translateY(-4px);
}
.tool-card .icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* ===== BLOG ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.blog-card {
  background: #fafafa;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  color: #222;
  transition: 0.2s;
}
.blog-card:hover {
  border-color: #007bff;
  transform: translateY(-4px);
}
.blog-card h3 {
  margin-bottom: 10px;
}
/* ===== TOOLS PAGE ===== */

.tools-header {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 30px;
}
.tools-header h1 {
  font-size: 36px;
}

.search-bar {
  margin-top: 20px;
  padding: 12px 15px;
  width: 100%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}
.about-section {
  margin-top: 40px;
  line-height: 1.7;
}
.about-section h1 {
  font-size: 36px;
}
.about-section .subtitle {
  margin-bottom: 20px;
  color: #555;
}
.about-section ul {
  padding-left: 20px;
}
.about-section ul li {
  margin-bottom: 8px;
}
.privacy-section {
  margin-top: 40px;
  line-height: 1.7;
}
.privacy-section h1 {
  font-size: 32px;
}
.privacy-section h2 {
  margin-top: 25px;
  margin-bottom: 8px;
}
.privacy-section ul {
  padding-left: 20px;
}

.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.mobile-nav a {
  padding: 14px 20px;
  border-top: 1px solid #eee;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}
.mobile-nav a:hover {
  background: #f4f4f4;
}

.mobile-nav.show {
  display: flex;
}

.tool-container {
  margin-top: 40px;
  text-align: center;
}

.tool-container h1 {
  font-size: 32px;
}

.tool-container .subtitle {
  margin-bottom: 20px;
  color: #555;
}

#textInput {
  width: 100%;
  max-width: 700px;
  height: 200px;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
  resize: vertical;
}

.result-box {
  margin-top: 20px;
  display: flex;
  gap: 30px;
  justify-content: center;
  font-size: 18px;
}

.clear-btn {
  margin-top: 20px;
}

/* Dark mode */
body.dark #textInput {
  background: #222;
  border-color: #444;
  color: white;
}
body.dark .result-box div {
  color: #ddd;
}
.random-box {
  margin: 30px auto;
  max-width: 400px;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  text-align: left;
}

.input-group label {
  font-weight: bold;
  margin-bottom: 6px;
}

.input-group input {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.random-btn {
  width: 100%;
  margin-top: 10px;
}

.copy-btn {
  width: 100%;
  margin-top: 15px;
}

#result {
  margin-top: 20px;
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  color: #007bff;
}

/* Dark mode */
body.dark .random-box {
  background: #222;
  border-color: #444;
}
body.dark .input-group input {
  background: #333;
  color: white;
  border-color: #555;
}
body.dark #result {
  color: #4aa3ff;
}
.qr-box {
  margin: 30px auto;
  max-width: 500px;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

#qrInput {
  width: 100%;
  height: 120px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  font-size: 16px;
  margin-bottom: 15px;
}

.input-group {
  text-align: left;
  margin-bottom: 15px;
}

.input-group label {
  font-weight: bold;
}

.input-group input {
  width: 120px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}

.qr-result {
  margin-top: 20px;
  text-align: center;
}

.qr-result img {
  margin-top: 10px;
  width: 100%;
  max-width: 300px;
}

.download-btn {
  margin-top: 15px;
  width: 100%;
}

/* Dark mode */
body.dark .qr-box {
  background: #222;
  border-color: #444;
}
body.dark #qrInput,
body.dark .input-group input {
  background: #333;
  color: white;
  border-color: #555;
}
body.dark .qr-result img {
  filter: brightness(0.9);
}

.compress-box {
  margin: 30px auto;
  max-width: 500px;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.upload-label {
  font-weight: bold;
  display: block;
  margin-bottom: 15px;
}

.input-group {
  text-align: left;
  margin-bottom: 15px;
}

.input-group input {
  width: 120px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}

.preview-box {
  margin-top: 20px;
  text-align: center;
}

.preview-img {
  margin-top: 10px;
  width: 100%;
  max-width: 320px;
  border-radius: 6px;
}

/* Dark mode */
body.dark .compress-box {
  background: #222;
  border-color: #444;
}

body.dark .input-group input {
  background: #333;
  border-color: #555;
  color: white;
}
/* BLOG LIST FIX UI */

.blog-item {
  padding: 18px 20px;
  margin-bottom: 20px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blog-item:hover {
  border-color: #007bff;
  transform: translateY(-3px);
}

.blog-title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
}

.blog-desc {
  font-size: 15px;
  color: #555;
}

.blog-date {
  font-size: 14px;
  color: #777;
  margin-top: 4px;
}

/* DARK MODE */
body.dark .blog-item {
  background: #222;
  border-color: #444;
}

body.dark .blog-title {
  color: #eee;
}

body.dark .blog-desc {
  color: #ccc;
}

body.dark .blog-date {
  color: #aaa;
}

/* Mobile */
@media (max-width: 600px) {
  .preview-img {
    max-width: 260px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  #qrInput {
    height: 100px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .random-box {
    padding: 20px;
  }
  #result {
    font-size: 32px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .result-box {
    flex-direction: column;
    gap: 12px;
  }

  #textInput {
    height: 180px;
  }
}

/* Tools grid dùng lại từ trang chủ */

/* ===== Responsive ===== */
@media (max-width: 700px) {
  /* HEADER */
  .nav {
    display: none;
  }
  .hamburger {
    display: block;
  }

  .header .container {
    padding: 10px 16px;
  }
  .logo span {
    font-size: 18px;
  }
  #themeToggle {
    margin-right: 8px;
  }

  /* HERO */
  .hero {
    padding: 60px 20px;
  }
  .hero h1 {
    font-size: 32px;
  }

  /* TOOLS GRID */
  .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .tool-card {
    padding: 16px;
  }
  .tool-card .icon {
    font-size: 32px;
  }

  /* BLOG GRID */
  .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  /* FOOTER */
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
  .footer-right {
    margin-top: 10px;
  }
}
