/* Blog Specific Styles */

/* Blog Header - Navbar Style */
.blog-header {
  background: #1f1f1f;
  padding: 1rem 0 0 0;
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 100;
}

.blog-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.back-home {
  color: #28e98c;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-home:hover {
  color: #20c77a;
}

.blog-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.blog-title {
  font-size: 1.8rem;
  color: #ffffff;
  margin: 0;
  font-weight: 700;
}

.blog-subtitle {
  color: #b3b3b3;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 400;
}

.nav-spacer {
  width: 120px; /* Balance the layout */
}

/* Mobile Category Dropdown - Hidden on desktop */
.mobile-category-dropdown {
  display: none;
  position: relative;
}

.category-dropdown-btn {
  background: #2a2a2a;
  border: 1px solid #28e98c;
  color: #28e98c;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.category-dropdown-btn:hover {
  background: rgba(40, 233, 140, 0.1);
}

.category-dropdown-btn i {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.category-dropdown-btn.open i {
  transform: rotate(180deg);
}

.category-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 160px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.category-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  color: #b3b3b3;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(40, 233, 140, 0.1);
  color: #ffffff;
}

.dropdown-item.active {
  background: rgba(40, 233, 140, 0.15);
  color: #28e98c;
}

/* Apple-style Category Navigation */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.category-nav::-webkit-scrollbar {
  width: 4px;
}

.category-nav::-webkit-scrollbar-track {
  background: transparent;
}

.category-nav::-webkit-scrollbar-thumb {
  background: #28e98c;
  border-radius: 2px;
}

.category-nav::-webkit-scrollbar-thumb:hover {
  background: #20c77a;
}

.category-btn {
  background: transparent;
  border: 1px solid #333;
  color: #b3b3b3;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  text-align: left;
  width: 100%;
}

.category-btn:hover {
  color: #ffffff;
  background: rgba(40, 233, 140, 0.1);
  border-color: #28e98c;
  transform: translateX(4px);
}

.category-btn.active {
  color: #28e98c;
  background: rgba(40, 233, 140, 0.15);
  border-color: #28e98c;
  transform: translateX(4px);
}

.category-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background: #28e98c;
  border-radius: 0 2px 2px 0;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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

/* Main Blog Content */
.blog-main {
  padding: 2rem 0;
  height: calc(100vh - 120px);
  background: #1f1f1f;
  overflow: hidden;
  /* Add scroll margin to account for sticky header */
  scroll-margin-top: 120px;
}

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

/* Blog Layout with Sidebar */
.blog-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  height: 100%;
}

/* Left Sidebar */
.blog-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 120px;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #333;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #28e98c #2a2a2a;
}

.blog-sidebar::-webkit-scrollbar {
  width: 6px;
}

.blog-sidebar::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}

.blog-sidebar::-webkit-scrollbar-thumb {
  background: #28e98c;
  border-radius: 3px;
}

.blog-sidebar::-webkit-scrollbar-thumb:hover {
  background: #20c77a;
}

.sidebar-title {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #28e98c;
}

/* Main Content Area */
.blog-content-area {
  flex: 1;
  min-width: 0;
  height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #28e98c #1f1f1f;
}

.blog-content-area::-webkit-scrollbar {
  width: 8px;
}

.blog-content-area::-webkit-scrollbar-track {
  background: #1f1f1f;
  border-radius: 4px;
}

.blog-content-area::-webkit-scrollbar-thumb {
  background: #28e98c;
  border-radius: 4px;
}

.blog-content-area::-webkit-scrollbar-thumb:hover {
  background: #20c77a;
}

.section-title {
  font-size: 2.5rem;
  color: #ffffff;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  display: none; /* Hide section titles for cleaner design */
}

.section-title:after {
  content: '';
  width: 60px;
  height: 3px;
  background: #28e98c;
  display: block;
  margin: 1rem auto 0;
}

/* Blog Cards */
.blog-card {
  background: #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2rem;
  border: 1px solid #333;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  /* Add scroll margin to prevent content hiding behind sticky header */
  scroll-margin-top: 120px;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(40, 233, 140, 0.2);
}

.blog-image {
  position: relative;
  overflow: hidden;
  height: 240px;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-image img {
  transform: scale(1.05);
}

.blog-content {
  padding: 1.5rem;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.blog-category {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-category.technology {
  background: #28e98c20;
  color: #28e98c;
}

.blog-category.development {
  background: #9c27b020;
  color: #e91e63;
}

.blog-category.career {
  background: #ff570020;
  color: #ff9800;
}

.blog-category.tutorial {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
}

.blog-category.tips {
  background: rgba(156, 39, 176, 0.15);
  color: #9c27b0;
}

.blog-category.experience {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.blog-category.ai {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.blog-category.opensource {
  background: rgba(96, 125, 139, 0.15);
  color: #607d8b;
}

.blog-category.web {
  background: rgba(233, 30, 99, 0.15);
  color: #e91e63;
}

.blog-category.mobile {
  background: rgba(0, 188, 212, 0.15);
  color: #00bcd4;
}

.blog-date {
  color: #b3b3b3;
  font-weight: 500;
}

.blog-post-title {
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.blog-card:hover .blog-post-title {
  color: #28e98c;
}

.blog-excerpt {
  color: #b3b3b3;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  color: #28e98c;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: #20c77a;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-posts {
  margin-top: 2rem;
}

/* Categories */
.blog-categories {
  margin-top: 3rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: #2a2a2a;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.3s ease, background-color 0.3s ease;
  border: 1px solid #333;
}

.category-card:hover {
  transform: translateY(-5px);
  background-color: #333;
  color: #ffffff;
}

.category-card i {
  font-size: 2.5rem;
  color: #28e98c;
  margin-bottom: 1rem;
}

.category-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.category-card span {
  color: #888;
  font-size: 0.9rem;
}

.category-card:hover span {
  color: #b3b3b3;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

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

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

  .blog-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .back-home {
    order: 1;
  }

  /* Show mobile dropdown on mobile - below Go to Portfolio */
  .mobile-category-dropdown {
    display: block;
    order: 2;
    width: 100%;
  }

  .category-dropdown-btn {
    width: 100%;
    justify-content: space-between;
  }

  .category-dropdown-menu {
    left: 0;
    right: 0;
    width: 100%;
  }

  .blog-brand {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .nav-spacer {
    display: none;
  }

  /* Hide sidebar on mobile - use !important to ensure it's completely hidden */
  .blog-sidebar {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Mobile layout adjustments */
  .blog-layout {
    flex-direction: column;
    gap: 0;
    height: auto;
  }

  .blog-main {
    height: auto;
    overflow: visible;
  }

  .blog-content-area {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

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

  .blog-meta {
    flex-direction: row;
    gap: 0.5rem;
  }
}

@media screen and (max-width: 480px) {
  .blog-main {
    padding: 1rem 0;
  }

  .blog-nav {
    gap: 0.5rem;
  }

  .back-home {
    font-size: 0.8rem;
  }

  .category-dropdown-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .blog-content {
    padding: 1.5rem;
  }

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

  .category-card {
    padding: 1.5rem;
  }

  .category-card i {
    font-size: 2rem;
  }
}

/* Loading Animation for Blog Images */
.blog-image img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-image img.loaded {
  opacity: 1;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Blog Post Navigation */
.blog-nav-pills {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.nav-pill {
  padding: 0.5rem 1.5rem;
  background: #2a2a2a;
  color: #888;
  text-decoration: none;
  border-radius: 25px;
  transition: all 0.3s ease;
  border: 1px solid #333;
}

.nav-pill:hover,
.nav-pill.active {
  background: #28e98c;
  color: #000;
  border-color: #28e98c;
}

/* Blog Search */
.blog-search {
  max-width: 400px;
  margin: 0 auto 3rem;
  position: relative;
}

.blog-search input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 25px;
  color: #ffffff;
  font-size: 1rem;
}

.blog-search input:focus {
  outline: none;
  border-color: #28e98c;
}

.blog-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

/* Individual Blog Post Styles */
.blog-post-main {
  padding: 3rem 0;
  min-height: 70vh;
}

.blog-post {
  max-width: 800px;
  margin: 0 auto;
  background: #2a2a2a;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #333;
}

.blog-post-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.blog-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post-content {
  padding: 3rem;
}

.post-intro .lead {
  font-size: 1.3rem;
  color: #28e98c;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.blog-post-content h2 {
  color: #ffffff;
  font-size: 2rem;
  margin: 2.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #28e98c;
}

.blog-post-content h3 {
  color: #ffffff;
  font-size: 1.5rem;
  margin: 2rem 0 1rem 0;
}

.blog-post-content h4 {
  color: #28e98c;
  font-size: 1.3rem;
  margin: 1.5rem 0 0.5rem 0;
}

.blog-post-content p {
  color: #b3b3b3;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.blog-post-content ul,
.blog-post-content ol {
  color: #b3b3b3;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

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

.blog-quote {
  background: #333;
  border-left: 4px solid #28e98c;
  padding: 2rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.2rem;
  color: #ffffff;
  border-radius: 0 10px 10px 0;
}

.highlight-box {
  background: linear-gradient(135deg, #28e98c15, #28e98c08);
  border: 1px solid #28e98c30;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.highlight-box h4 {
  color: #28e98c;
  margin-top: 0;
  margin-bottom: 1rem;
}

.skills-timeline {
  margin: 2rem 0;
}

.timeline-item {
  background: #333;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border-left: 4px solid #28e98c;
}

.timeline-item h4 {
  color: #28e98c;
  margin: 0 0 0.5rem 0;
}

.timeline-item p {
  margin: 0;
  color: #ffffff;
}

.advice-section {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 2rem;
  margin: 2rem 0;
}

.advice-section h3 {
  color: #28e98c;
  margin-top: 0;
}

.post-conclusion {
  background: #333;
  border-radius: 10px;
  padding: 2rem;
  margin: 3rem 0;
  text-align: center;
  border: 1px solid #28e98c30;
}

.post-conclusion em {
  color: #28e98c;
}

/* Post Footer */
.post-footer {
  border-top: 1px solid #333;
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.post-tags h4,
.post-share h4 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.tag {
  background: #28e98c20;
  color: #28e98c;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  border: 1px solid #28e98c30;
}

.share-buttons {
  display: flex;
  gap: 1rem;
}

.share-btn,
.copy-link-btn {
  background: #333;
  border: 1px solid #28e98c30;
  color: #28e98c;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn:hover,
.copy-link-btn:hover {
  background: #28e98c;
  color: #000;
  transform: translateY(-2px);
}

/* Author Bio */
.author-bio {
  background: #1a1a1a;
  padding: 2rem 3rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  border-top: 1px solid #333;
}

.author-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.author-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info h4 {
  color: #ffffff;
  margin: 0 0 0.5rem 0;
}

.author-info p {
  color: #b3b3b3;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.author-links {
  display: flex;
  gap: 1rem;
}

.author-links a {
  color: #28e98c;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.author-links a:hover {
  color: #20c77a;
}

/* Post Meta in Header */
.post-meta {
  text-align: center;
}

.post-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  color: #b3b3b3;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.post-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive Design for Blog Posts */
@media screen and (max-width: 768px) {
  .blog-post-content {
    padding: 2rem;
  }
  
  .post-footer {
    padding: 2rem;
    flex-direction: column;
  }
  
  .author-bio {
    padding: 2rem;
    flex-direction: column;
    text-align: center;
  }
  
  .post-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .blog-post-content h2 {
    font-size: 1.5rem;
  }
  
  .highlight-box,
  .blog-quote {
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

@media screen and (max-width: 480px) {
  .blog-post-content {
    padding: 1.5rem;
  }
  
  .post-footer {
    padding: 1.5rem;
  }
  
  .author-bio {
    padding: 1.5rem;
  }
  
  .blog-post-content h2 {
    font-size: 1.3rem;
  }
  
  .post-intro .lead {
    font-size: 1.1rem;
  }
}