/* ============================================================
   MASTER ENGINEERING PRO – GLOBAL STYLE
   Clean • Consistent • Scalable • Non-Conflicting
   ============================================================ */

/* ---------------------------
   1. BASE / RESET
--------------------------- */
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}


/* ---------------------------
   2. HEADER & BRAND
--------------------------- */
.header {
  background: #020617;
  padding: 15px 0;
  border-bottom: 1px solid #1e293b;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  color: #38bdf8;
}

.brand p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.brand-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #38bdf8;
  padding: 1px;
  background-color: #d9ecf3;
}


/* ---------------------------
   3. HERO AREA
--------------------------- */
.hero {
  padding: 50px 0 40px;
  text-align: center;
}

.hero-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.hero-sub,
.hero-subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: #94a3b8;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* HERO BUTTON GROUP */
.hero-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-actions a {
  text-decoration: none !important;
}


/* ---------------------------
   4. BUTTON SYSTEM
--------------------------- */

.btn-primary {
  padding: 10px 22px;
  background-color: #0ea5e9 !important;
  color: #ffffff !important;
  border-radius: 999px;
  border: 1px solid #38bdf8 !important;
  font-weight: 600;
  font-size: 14px;
  min-width: 210px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.25s ease;
}

.btn-primary:hover {
  background-color: #38bdf8 !important;
  box-shadow: 0 0 12px #38bdf8;
}


/* OUTLINE BUTTON */
.btn-outline {
  padding: 10px 22px;
  border: 1px solid #38bdf8 !important;
  color: #e5f2ff !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  min-width: 210px;
  background: transparent;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.25s ease;
}

.btn-outline:hover {
  border-color: #7dd3fc !important;
  color: #f9fafb !important;
  box-shadow: 0 0 12px #38bdf8;
  background: #020617;
}


/* Mini button (Blog page) */
.primary-btn {
  display: inline-block;
  padding: 8px 18px;
  margin-top: 16px;
  border-radius: 999px;
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  text-decoration: none;
  font-size: 14px;
}

.primary-btn:hover {
  background: #38bdf8;
  color: #020617;
}


/* ---------------------------
   5. SECTION BASE
--------------------------- */
.section {
  padding: 40px 0;
}

.section-title {
  font-size: 24px;
  color: #38bdf8;
  margin: 0 0 20px 0;
}

.intro {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.8;
}


/* ---------------------------
   6. GRID & CARD (Index)
--------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: #0c1324;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #1e293b;
  cursor: pointer;
  transition: 0.25s ease;
}

.card h3 {
  margin: 0;
  font-size: 16px;
}

.card:hover {
  background: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: translateY(-4px);
}


/* ---------------------------
   7. TOOL CARD (Tools page)
--------------------------- */
.tool-card {
  background: #020617;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 20px;
  max-width: 720px;
}

.tool-card p {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.7;
}

.tool-card label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  color: #cbd5e1;
}

.tool-card input,
.tool-card select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: #e5e7eb;
  font-size: 14px;
}

.tool-card input:focus,
.tool-card select:focus {
  border-color: #38bdf8;
  outline: none;
}

.tool-card button {
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #0ea5e9;
  border: none;
  color: #0b1120;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.tool-card button:hover {
  background: #38bdf8;
}

.result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-size: 14px;
  color: #d1fae5;
}

.note-small {
  margin-top: 6px;
  font-size: 12px;
  color: #a5b4fc;
}


/* ---------------------------
   8. BLOG LIST
--------------------------- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #020617;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.post-thumb {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s ease;
}

.post-card:hover .post-thumb img {
  transform: scale(1.05);
}

.post-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-title {
  font-size: 20px;
  margin: 0;
}

.post-title a {
  color: #e5e7eb;
  text-decoration: none;
}

.post-title a:hover {
  color: #38bdf8;
}

.post-date {
  font-size: 13px;
  color: #94a3b8;
}

.post-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5f5;
}

.post-readmore {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  margin-top: 8px;
  text-decoration: none;
  transition: 0.25s ease;
}

.post-card:hover .post-readmore {
  color: #020617;
  background: #38bdf8;
}


/* ---------------------------
   9. BLOG DETAIL + QA SECTION
--------------------------- */
.post-detail-section {
  border-top: 1px solid rgba(148,163,184,0.25);
  margin-top: 24px;
  padding-top: 24px;
}

.post-detail-title {
  font-size: 24px;
  margin: 8px 0 16px;
}

.post-detail-body p {
  margin: 8px 0;
  color: #e2e8f0;
}

.post-detail-body ul {
  padding-left: 20px;
  color: #cbd5f5;
}


/* Blog back button */
.back-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #38bdf8;
  background: transparent;
  color: #e0f2fe;
  cursor: pointer;
  margin-bottom: 16px;
}

.back-btn:hover {
  background: #38bdf8;
  color: #020617;
}


/* BLOG QA FORM */
.qa-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-form input,
.qa-form textarea {
  background: #020617;
  border: 1px solid #1e293b;
  padding: 8px 10px;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 14px;
}

.qa-form input:focus,
.qa-form textarea:focus {
  outline: none;
  border-color: #38bdf8;
}

.qa-submit {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #0ea5e9;
  color: #0b1120;
  font-weight: 600;
  cursor: pointer;
}

.qa-submit:hover {
  background: #38bdf8;
}

.qa-note {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}


/* ---------------------------
   10. POPUP (Trang index)
--------------------------- */
.qa-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.qa-box {
  background: #0f172a;
  padding: 25px;
  max-width: 420px;
  width: 90%;
  border-radius: 14px;
  border: 1px solid #1e293b;
}

.qa-box h3 {
  margin: 0 0 12px 0;
  color: #38bdf8;
}

.qa-box input,
.qa-box textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.submit-btn {
  padding: 11px;
  width: 100%;
  background: #0ea5e9;
  border: none;
  color: #0b1120;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.submit-btn:hover {
  background: #38bdf8;
}

.close-btn {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: white;
  cursor: pointer;
}


/* ---------------------------
   11. FOOTER
--------------------------- */
.footer {
  text-align: center;
  padding: 20px 0 30px;
  margin-top: 40px;
  border-top: 1px solid #1e293b;
  color: #64748b;
  font-size: 13px;
}


/* ---------------------------
   12. RESPONSIVE
--------------------------- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand-avatar {
    width: 70px;
    height: 70px;
  }

  .hero-title {
    font-size: 22px;
  }

  .post-card {
    flex-direction: column;
  }

  .post-thumb {
    width: 100%;
  }

  .tool-card {
    padding: 16px;
  }
}
