/* Blog Styles */
:root {
  --primary-color: #ff6500;
  --secondary-color: #1a1a1a;
  --text-color: #333;
  --text-light: #666;
  --background-color: #ffffff;
  --card-background: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dark {
  --text-color: #ffffff;
  --text-light: #cccccc;
  --background-color: #1a1a1a;
  --card-background: #2a2a2a;
  --border-color: #404040;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-bottom: 80px;
}

/* Header Styles */
.blog-header {
  background: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.back-btn:hover {
  background-color: var(--border-color);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.search-btn:hover {
  background-color: var(--border-color);
}

/* Search Container */
.search-container {
  padding: 0 1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-light);
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 25px;
  background: var(--card-background);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary-color);
}

.search-clear {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
}

/* Main Content */
.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Featured Section */
.featured-section {
  margin: 2rem 0;
}

.featured-article {
  background: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.featured-article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.featured-image {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.featured-content {
  padding: 1.5rem;
}

.featured-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.category {
  color: var(--primary-color);
  font-weight: 600;
}

.date {
  color: var(--text-light);
}

.featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.featured-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.featured-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.read-time {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* Filter Section */
.filter-section {
  margin: 2rem 0;
}

.filter-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-btn {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.filter-btn:hover {
  border-color: var(--primary-color);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Articles Section */
.articles-section {
  margin: 2rem 0;
}

.articles-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-light);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.article-card {
  background: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.article-image {
  height: 200px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-content {
  padding: 1.25rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-excerpt {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-footer .author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-footer .author-avatar {
  width: 30px;
  height: 30px;
}

.article-footer .author-name {
  font-size: 0.8rem;
}

.article-footer .read-time {
  font-size: 0.8rem;
}

/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.load-more-btn {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results h3 {
  margin-bottom: 0.5rem;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-background);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  color: var(--text-light);
  font-size: 0.8rem;
}

.nav-item:hover {
  background-color: var(--border-color);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item i {
  font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .featured-article {
    margin: 1rem 0;
  }
  
  .featured-image {
    height: 200px;
  }
  
  .featured-title {
    font-size: 1.25rem;
  }
  
  .filter-container {
    gap: 0.25rem;
  }
  
  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .blog-main {
    padding: 0 0.5rem;
  }
  
  .header-container {
    padding: 0.75rem;
  }
  
  .page-title {
    font-size: 1.25rem;
  }
  
  .featured-content {
    padding: 1rem;
  }
  
  .article-content {
    padding: 1rem;
  }
}