/* ============================================
   Modern Blog Design - Enhanced Engagement
   ============================================ */

:root {
  --primary-color: #2563eb;
  --secondary-color: #7c3aed;
  --accent-color: #ec4899;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  padding-top: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
  background-color: var(--bg-light);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Scroll to Top Button */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

#scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

#scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

/* Header Enhancements */
header {
  background: var(--bg-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.blog-header-logo h3 {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  margin: 0;
  transition: all 0.3s ease;
}

.blog-header-logo:hover h3 {
  transform: scale(1.05);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, 10%) scale(1.1); }
}

.hero-section h1 {
  color: white;
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.hero-section p {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  opacity: 0.95;
}

.hero-section a {
  color: white;
  font-weight: 600;
  border-bottom: 2px solid white;
  padding-bottom: 2px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.hero-section a:hover {
  border-bottom-width: 4px;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Card Styles */
.blog-card {
  background: var(--bg-white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--border-color);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--hover-shadow);
}

.blog-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: all 0.5s ease;
}

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

.blog-card-body {
  padding: 1.5rem;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.category-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

/* Article List */
.article-list-item {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.article-list-item:hover {
  transform: translateX(8px);
  box-shadow: var(--hover-shadow);
  border-left-color: var(--primary-color);
}

.article-list-item h2 {
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.article-list-item:hover h2 {
  color: var(--primary-color);
}

.article-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-meta a {
  color: var(--text-light);
  transition: color 0.3s ease;
}

.article-meta a:hover {
  color: var(--primary-color);
}

/* Sidebar */
.sidebar-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.sidebar-widget:hover {
  box-shadow: var(--hover-shadow);
}

.sidebar-widget h4 {
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

/* Recent Posts in Sidebar */
.recent-post-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.recent-post-item:last-child {
  border-bottom: none;
}

.recent-post-item:hover {
  background: var(--bg-light);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  border-radius: 8px;
}

.recent-post-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.recent-post-content h6 {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

/* Blog Entry Page */
.blog-entry-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 0;
}

.blog-entry-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 20px;
  margin: 2rem auto;
  display: block;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.blog-entry-image:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.blog-entry-content {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  font-size: 1.1rem;
  line-height: 1.8;
}

.blog-entry-content p {
  margin-bottom: 1.5rem;
}

/* Social Share Buttons */
.social-share {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 15px;
}

.social-share-label {
  font-weight: 600;
  color: var(--text-dark);
}

.twitter-share-button {
  background: #000000;
  color: white !important;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.twitter-share-button:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Search Box */
#search-form {
  position: relative;
}

#search-input {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  transition: all 0.3s ease;
  width: 100%;
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer */
footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 0;
  margin-top: 4rem;
}

footer a {
  color: white;
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--accent-color);
  transform: translateY(-2px);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

/* Loading Animation */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero-section {
    padding: 2rem 1.5rem;
  }

  .blog-entry-content {
    padding: 1.5rem;
  }

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

  #scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Legacy Bootstrap Overrides */
.container {
  max-width: 1200px;
}

.bd-placeholder-img {
  font-size: 1.125rem;
  text-anchor: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.bi {
  vertical-align: -.125em;
  fill: currentColor;
}