/* Article 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.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-bottom: 80px;
}

/* Loading State */
.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  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); }
}

/* Article Not Found */
.article-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  color: var(--text-light);
  padding: 2rem;
}

.article-not-found i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.article-not-found h2 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.back-to-blog-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  margin-top: 1.5rem;
  transition: background-color 0.3s ease;
}

.back-to-blog-btn:hover {
  background-color: #e55a00;
}

/* Article Container */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Article Header */
.article-header {
  position: sticky;
  top: 0;
  background: var(--background-color);
  z-index: 100;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.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);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.share-btn, .bookmark-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.share-btn:hover, .bookmark-btn:hover {
  background-color: var(--border-color);
}

.bookmark-btn.bookmarked {
  color: var(--primary-color);
}

.bookmark-btn.bookmarked i {
  font-weight: 900;
}

/* Article Hero */
.article-hero {
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.category {
  color: var(--primary-color);
  font-weight: 600;
  text-transform: capitalize;
}

.date {
  color: var(--text-light);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.article-excerpt {
  font-size: 1.2rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Article Image */
.article-image-container {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Article Content */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 2rem 0;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-color);
}

.article-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-color);
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  background: var(--card-background);
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.article-content code {
  background: var(--card-background);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.article-content pre {
  background: var(--card-background);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

/* Article Footer */
.article-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 3rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.article-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.action-btn.liked {
  color: #e74c3c;
  border-color: #e74c3c;
}

.action-btn.liked i {
  font-weight: 900;
}

/* Related Articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-articles h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.related-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;
  text-decoration: none;
  color: inherit;
}

.related-article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.related-image {
  height: 150px;
  overflow: hidden;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-content {
  padding: 1rem;
}

.related-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.related-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Share Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--card-background);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.modal-close-btn:hover {
  background-color: var(--border-color);
}

.share-modal-content h3 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.share-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-option:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.share-link-container {
  display: flex;
  gap: 0.5rem;
}

.share-link-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
}

.copy-btn {
  background: var(--primary-color);
  border: none;
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background-color: #e55a00;
}

/* 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) {
  .article-container {
    padding: 0 0.75rem;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .article-excerpt {
    font-size: 1.1rem;
  }
  
  .article-content {
    font-size: 1rem;
  }
  
  .article-content h2 {
    font-size: 1.5rem;
  }
  
  .article-content h3 {
    font-size: 1.2rem;
  }
  
  .article-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .share-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .article-container {
    padding: 0 0.5rem;
  }
  
  .article-title {
    font-size: 1.75rem;
  }
  
  .article-hero {
    margin-bottom: 1.5rem;
  }
  
  .article-author {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
}