@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #6366f1;
  --secondary-color: #ec4899;
  --accent-color: #f97316;
  --dark-bg: #0f172a;
  --light-bg: #ffffff;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --gradient-accent: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

html {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: inherit;
}

/* NAVIGATION */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav-back:hover {
  transform: translateX(-4px);
}

/* BLOG SECTION */
#blog {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 3rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: fadeInDown 0.8s ease-out;
}

.subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out 0.2s both;
}

.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  justify-content: center;
}

.blog-post {
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.blog-post::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.blog-post:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
  border-color: var(--primary-color);
}

.blog-post:hover::before {
  transform: scaleX(1);
}

.blog-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.blog-post:hover .blog-title {
  color: var(--primary-color);
}

.blog-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.blog-date::before {
  content: "📅";
}

.blog-summary {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0 0 1.5rem;
  line-height: 1.7;
  flex-grow: 1;
}

.btn-color-1 {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.btn-color-1:hover {
  background: var(--gradient-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* BLOG POST DETAIL */
#blog-post {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  min-height: 100vh;
}

.blog-post-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

.blog-post-title {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-post-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--text-light);
  font-weight: 500;
  flex-wrap: wrap;
}

.blog-post-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post-date::before {
  content: "📅";
}

.blog-post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post-author::before {
  content: "✍️";
}

.blog-content {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--light-bg);
  padding: 3rem;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.blog-content p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 1.75rem;
  color: var(--text-dark);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gradient-primary);
}

.blog-content h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.blog-content ul,
.blog-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.blog-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.blog-content li strong {
  color: var(--text-dark);
}

.blog-content pre {
  background: #f8f9fa;
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.blog-content code {
  font-family: "Courier New", monospace;
  color: var(--primary-color);
  font-size: 0.9rem;
  line-height: 1.5;
}

.blog-content pre code {
  color: inherit;
}

/* BACK BUTTON */
.back-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.back-btn:hover {
  background: var(--gradient-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.back-btn::before {
  content: "← ";
  margin-right: 0.5rem;
}

/* ANIMATIONS */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  #blog {
    padding: 2rem 1rem;
  }

  .title {
    font-size: 2rem;
  }

  .blog-posts {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .blog-post {
    padding: 1.5rem;
  }

  .blog-title {
    font-size: 1.25rem;
  }

  .blog-summary {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  #blog {
    padding: 1.5rem 0.75rem;
  }

  .title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .blog-post {
    padding: 1rem;
    border-radius: 1rem;
  }

  .blog-title {
    font-size: 1.1rem;
  }

  .blog-date {
    font-size: 0.8rem;
  }

  .blog-summary {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .btn-color-1 {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }

  #blog-post {
    padding: 1.5rem 0.75rem;
  }

  .blog-content {
    padding: 1.5rem;
  }

  .blog-post-title {
    font-size: 1.5rem;
  }

  .blog-content h2 {
    font-size: 1.3rem;
  }

  .blog-content h3 {
    font-size: 1.1rem;
  }

  .blog-content pre {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--dark-bg);
    color: #e2e8f0;
  }

  .blog-post {
    background: #1e293b;
    border-color: #334155;
  }

  .blog-title {
    color: #e2e8f0;
  }

  .blog-summary,
  .blog-content p,
  .blog-content li {
    color: #cbd5e1;
  }

  .blog-content {
    background: #1e293b;
    color: #cbd5e1;
  }

  .blog-content h2,
  .blog-content h3,
  .blog-post-title {
    color: #e2e8f0;
  }

  .blog-content pre {
    background: #0f172a;
  }

  nav {
    background: rgba(15, 23, 42, 0.95);
  }

  #blog,
  #blog-post {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  }
}
