/* =========================================================
   TÁC GIẢ: Trần Tiến - 231A010303
   FILE: style.css
   MỤC ĐÍCH: Định dạng giao diện cho website portfolio cá nhân.
   GHI CHÚ: Ưu tiên giao diện sáng, tối giản, responsive.
   ========================================================= */

/* Reset cơ bản để trình duyệt hiển thị đồng nhất */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f9fafb;
  color: #1e293b;
  line-height: 1.6;
}

/* Layout chung */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: #f3f4f6;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
  color: #0f172a;
}

.section-subtitle {
  text-align: center;
  color: #64748b;
  max-width: 720px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.logo-main {
  color: #111827;
}

.logo-sub {
  color: #2563eb;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #1f2933;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #2563eb;
  transition: width 0.18s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* Nút menu mobile */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #111827;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background: #ffffff;
  padding-top: 5rem;
}

.hero-inner {
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1 1 300px;
}

.hero-avatar {
  flex: 0 0 260px;
  display: flex;
  justify-content: center;
}

.hero-avatar img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.hello {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.role {
  color: #2563eb;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.desc {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.hero-meta p {
  font-size: 0.9rem;
  color: #4b5563;
}

.hero-meta p + p {
  margin-top: 0.15rem;
}

.hero-actions {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Button chung */
.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.primary-btn {
  background: #2563eb;
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.primary-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.outline-btn {
  border-color: #2563eb;
  color: #1e293b;
}

.outline-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* Grid chung */
.grid {
  display: grid;
  gap: 1.5rem;
}

/* Card kỹ năng */
.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.card ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: #4b5563;
  font-size: 0.9rem;
}

/* Projects */
.projects-grid {
  grid-template-columns: 1fr;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.3rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.project-image img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.project-content h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.project-content p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 0.7rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  list-style: none;
}

.project-tags li {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-links a {
  font-size: 0.85rem;
  color: #2563eb;
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

/* Liên hệ */
.contact-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem;
  margin-top: 1rem;
}

.contact-info p {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: #374151;
}

.contact-info a {
  color: #2563eb;
  text-decoration: none;
}
.contact-info a:hover {
  text-decoration: underline;
}

.contact-form {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #111827;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.form-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #16a34a;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1.2rem 0 1.8rem;
  background: #f3f4f6;
}

.footer-inner {
  text-align: center;
  font-size: 0.82rem;
  color: #4b5563;
}

.footer-note {
  margin-top: 0.25rem;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  /* Nav chuyển sang dạng dropdown */
  .nav {
    position: absolute;
    inset: 60px 1.5rem auto 1.5rem;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transform-origin: top;
    transform: scaleY(0.9);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .nav.show {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.9rem;
  }

  .section {
    padding: 3.2rem 0;
  }
}