/* ==========================================================================
   PORTFOLIO - LÊ VỦ LỰC
   Theme: Modern Dark Mode (Blue & Purple Glow)
   ========================================================================== */

/* --- Biến giao diện CSS (Design Tokens) --- */
:root {
  --bg-main: #0a0d14;
  --bg-card: #121826;
  --bg-card-hover: #172033;
  --bg-elevated: #1e293b;
  --bg-nav: rgba(10, 13, 20, 0.85);
  
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --accent-gradient-glow: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(139, 92, 246, 0.35);
  --glow-shadow: 0 0 25px rgba(139, 92, 246, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --container-width: 1100px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* --- Thiết lập cơ bản (Reset & Base) --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(139, 92, 246, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: 1.35rem; }

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

a {
  color: var(--accent-blue-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-purple-light);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* --- Bố cục (Layout) --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: 5rem 0 4rem;
}

/* --- Thanh điều hướng (Navbar) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-purple);
  display: inline-block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0.6rem;
  right: 0.6rem;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* Nút menu di động (Hamburger) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-main);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* --- Nút bấm (Buttons) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-blue-light);
  color: var(--text-main);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* --- Huy hiệu & Nhãn (Badges & Tags) --- */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--accent-gradient-glow);
  border: 1px solid var(--border-highlight);
  color: var(--accent-purple-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Khối giao diện (Cards & Containers) --- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-4px);
  box-shadow: var(--glow-shadow);
}

/* --- Trang Chủ (Hero Section) --- */
.hero {
  padding: 3rem 0 5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 3.5rem;
}

.hero-content h1 {
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.avatar-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  background: var(--accent-gradient);
  padding: 6px;
  animation: morphShape 8s ease-in-out infinite;
  box-shadow: 0 0 35px rgba(139, 92, 246, 0.3);
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 1.5rem;
}

.avatar-icon {
  width: 72px;
  height: 72px;
  color: var(--accent-purple-light);
  margin-bottom: 0.75rem;
}

.avatar-inner span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

@keyframes morphShape {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Highlights Section */
.section-title-wrap {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 3rem;
}

.section-title-wrap h2 {
  margin-bottom: 0.75rem;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.highlight-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue-light);
  margin-bottom: 0.5rem;
}

.highlight-icon svg {
  width: 24px;
  height: 24px;
}

/* --- Trang About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.skills-section {
  margin-top: 3.5rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.skill-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
}

.skill-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue-light);
  font-weight: 700;
  font-size: 1.1rem;
}

.skill-info h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.skill-info span {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.quotes-section {
  margin-top: 4rem;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.quote-card {
  border-left: 3px solid var(--accent-purple);
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.quote-card p {
  font-style: italic;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.quote-card span {
  font-size: 0.85rem;
  color: var(--accent-blue-light);
  font-weight: 600;
}

/* --- Trang Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-header-thumb {
  height: 160px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  color: var(--accent-purple-light);
}

.project-header-thumb svg {
  width: 48px;
  height: 48px;
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-body h3 {
  margin-bottom: 0.6rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.5rem;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
}

/* --- Trang Blog --- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 2rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.blog-date {
  color: var(--accent-blue-light);
  font-weight: 500;
}

.blog-title a {
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.blog-title a:hover {
  color: var(--accent-purple-light);
}

.blog-excerpt {
  margin-bottom: 0.5rem;
}

/* Chi tiết bài viết Blog (Post Detail) */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.post-header h1 {
  margin-bottom: 1rem;
}

.post-content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #d1d5db;
}

.post-content h2 {
  margin: 2rem 0 1rem;
  color: var(--text-main);
}

.post-content h3 {
  margin: 1.5rem 0 0.8rem;
  color: var(--text-main);
}

.post-content p {
  margin-bottom: 1.4rem;
  color: #d1d5db;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.5rem 1.8rem;
  color: #d1d5db;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content pre {
  background: #0d1117;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* --- Trang Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.contact-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple-light);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* --- Footer --- */
.site-footer {
  background-color: #07090e;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-desc {
  max-width: 360px;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1.2rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-purple-light);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 868px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    margin: 0 auto 2rem;
  }

  .about-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .nav-link {
    display: block;
    padding: 0.75rem 1rem;
  }

  .nav-link.active::after {
    display: none;
  }
  
  .nav-link.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple-light);
  }
}
