/* Blog Custom Styles */

/* Root variables for consistent theming and easy customization */
:root {
  /* Blue-Purple gradient color palette */
  --primary-color: #667eea;          /* Soft blue */
  --primary-dark: #5a67d8;           /* Darker blue */
  --secondary-color: #9f7aea;        /* Medium purple */
  --success-color: #68d391;          /* Green accent */
  --danger-color: #fc8181;           /* Pink-red accent */
  --warning-color: #f6e05e;          /* Yellow accent */
  --info-color: #63b3ed;             /* Light blue */
  --light-color: #f7fafc;            /* Very light blue-white */
  --dark-color: #4c51bf;             /* Deep purple-blue */
  
  /* Additional blue-purple colors */
  --primary-blue: #4299e1;           /* Sky blue */
  --secondary-blue: #3182ce;         /* Medium blue */
  --accent-purple: #805ad5;          /* Rich purple */
  --accent-indigo: #6366f1;          /* Indigo */
  --light-purple: #e9d8fd;           /* Very light purple */
  
  /* Typography */
  --font-family-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  
  /* Spacing and effects with blue-purple shadows */
  --border-radius: 0.75rem;
  --box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.2), 0 2px 4px -1px rgba(102, 126, 234, 0.1);
  --box-shadow-lg: 0 10px 15px -3px rgba(102, 126, 234, 0.2), 0 4px 6px -2px rgba(102, 126, 234, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Blue-Purple gradients for modern appearance */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-sunset: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9f7aea 100%);
  --gradient-ocean: linear-gradient(135deg, #4299e1 0%, #667eea 50%, #805ad5 100%);
}

/* General body styling with blue-purple gradient background */
body {
  font-family: var(--font-family-primary);
  line-height: 1.6;
  color: #2d3748;  /* Dark gray for readability on bright backgrounds */
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #ddd6fe 100%);  /* Light blue-purple gradient */
  min-height: 100vh;
}

/* Heading styles with bright gradient text effect for h1 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #2d3748;  /* Dark gray for readability */
}

/* Bright gradient text effect for main headings */
h1 {
  background: var(--gradient-primary);
  -webkit-background-clip: text;  /* Webkit prefix for Safari */
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Links */
a {
  color: var(--primary-color);
  transition: var(--transition);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Glass morphism effect for modern card design */
.card {
  border: none;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.8);  /* Semi-transparent background */
  backdrop-filter: blur(10px);  /* Glass effect blur */
}

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

/* Image hover effect with scaling */
.card-img-top {
  height: 200px;
  object-fit: cover;  /* Maintain aspect ratio */
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  transition: var(--transition);
}

.card-img-top:hover {
  transform: scale(1.05);  /* Subtle zoom on hover */
}

/* Enhanced button styling with gradients and micro-interactions */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: var(--transition);
  border: none;
  text-transform: uppercase;  /* Modern button styling */
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: var(--box-shadow);
}

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

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--info-color) 100%);
  border: none;
  box-shadow: var(--box-shadow);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-2px);
}

/* Glass morphism form controls with enhanced focus states */
.form-control, .form-select {
  border-radius: var(--border-radius);
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.8);  /* Semi-transparent background */
  backdrop-filter: blur(10px);  /* Glass effect */
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);  /* Custom focus ring */
  transform: translateY(-1px);  /* Lift effect on focus */
}

/* Post Cards */
.post-card {
  transition: var(--transition);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.post-card:hover {
  box-shadow: var(--box-shadow-lg);
  transform: translateY(-4px);
}

.post-meta {
  font-size: 0.875rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.post-meta i {
  margin-right: 0.25rem;
}

.post-excerpt {
  color: #666;
  line-height: 1.5;
}

/* Featured post with blue-purple gradient effect for better text readability */
.featured-post {
  background: var(--gradient-ocean);
  color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
}

.featured-post .card-body {
  position: relative;
  z-index: 2;  /* Above overlay */
}

/* Blue-purple overlay for better text contrast */
.featured-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.2);  /* Semi-transparent blue overlay */
  z-index: 1;
}

/* Tags and Categories */
.tag, .category-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 1rem;
  text-decoration: none;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.tag {
  background-color: var(--info-color);
  color: white;
}

.tag:hover {
  background-color: var(--accent-purple);
  color: white;
  text-decoration: none;
}

.category-badge {
  background-color: var(--secondary-color);
  color: white;
}

.category-badge:hover {
  background-color: var(--accent-indigo);
  color: white;
  text-decoration: none;
}

/* Comment styling with visual hierarchy using borders */
.comment {
  border-left: 3px solid var(--primary-color);  /* Visual indicator */
  padding-left: 1rem;
  margin-bottom: 1rem;
}

/* Nested comment replies with different styling */
.comment-reply {
  margin-left: 2rem;  /* Indent for visual hierarchy */
  border-left-color: var(--secondary-color);  /* Different color for replies */
}

.comment-author {
  font-weight: 600;
  color: var(--primary-color);
}

.comment-date {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.comment-content {
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* Forms */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* Pagination */
.pagination .page-link {
  color: var(--primary-color);
  border-color: var(--secondary-color);
  transition: var(--transition);
}

.pagination .page-link:hover {
  color: var(--accent-purple);
  background-color: var(--light-color);
  border-color: var(--secondary-color);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Search and Filter Section */
.search-filter-section {
  background-color: var(--light-color);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
}

/* Sidebar */
.sidebar {
  background-color: var(--light-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.sidebar h5 {
  color: var(--dark-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar .list-group-item {
  border: none;
  background-color: transparent;
  padding: 0.5rem 0;
}

.sidebar .list-group-item:hover {
  background-color: rgba(0, 123, 255, 0.1);
  border-radius: var(--border-radius);
}

/* Profile */
.profile-header {
  background: linear-gradient(135deg, var(--gradient-primary));
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  margin-bottom: 1rem;
  object-fit: cover;
}

.profile-stats {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  margin-top: -2rem;
  position: relative;
  z-index: 2;
}

/* Reading Time */
.reading-time {
  font-size: 0.875rem;
  color: var(--secondary-color);
  font-style: italic;
}

/* Fixed positioned back-to-top button with smooth interactions */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;  /* Circular button */
  width: 50px;
  height: 50px;
  display: none;  /* Hidden by default, shown via JavaScript */
  cursor: pointer;
  transition: var(--transition);
  z-index: 1000;  /* Above all other content */
}

.back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);  /* Lift effect on hover */
}

/* Social Links */
.social-links a {
  font-size: 1.25rem;
  transition: var(--transition);
}

.social-links a:hover {
  transform: translateY(-2px) scale(1.1);
  opacity: 1 !important;
  color: var(--primary-color) !important;
}

/* Custom utility classes for advanced effects */

/* Hover utility class for opacity effects */
.hover-opacity-100:hover {
  opacity: 1 !important;
}

/* Glass morphism utility class for modern design */
.glass-morphism {
  background: rgba(255, 255, 255, 0.1);  /* Semi-transparent background */
  backdrop-filter: blur(10px);  /* Blur effect */
  border: 1px solid rgba(255, 255, 255, 0.2);  /* Subtle border */
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse-hover:hover {
  animation: pulse 0.6s ease-in-out;
}

/* Responsive design adjustments for mobile devices */
@media (max-width: 768px) {
  .post-card {
    margin-bottom: 1.5rem;
  }
  
  /* Reduce comment reply indentation on mobile */
  .comment-reply {
    margin-left: 1rem;
  }
  
  .profile-header {
    padding: 2rem 0;
  }
  
  /* Smaller avatar on mobile */
  .profile-avatar {
    width: 80px;
    height: 80px;
  }
  
  /* Adjust back-to-top button for mobile */
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* Blue-purple mode support - override any dark mode preferences */
@media (prefers-color-scheme: dark) {
  .card {
    background-color: var(--light-purple);
    color: #2d3748;
  }
  
  .sidebar {
    background-color: var(--info-color);
    color: #2d3748;
  }
}

/* Print-friendly styles - hide interactive elements */
@media print {
  .navbar,
  .footer,
  .sidebar,
  .btn,
  .back-to-top {
    display: none !important;  /* Hide navigation and interactive elements */
  }
  
  /* Simplified card styling for print */
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Accessibility improvements for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);  /* Legacy clip property */
  white-space: nowrap;
  border: 0;
}

/* Enhanced focus styles for better keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);  /* Custom focus outline */
  outline-offset: 2px;  /* Space between element and outline */
}

/* High contrast mode support for accessibility compliance */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--primary-color);  /* Strong bright border for high contrast */
  }
  
  .btn-primary {
    background-color: var(--primary-color);  /* Bright primary background */
    border-color: var(--primary-color);
    color: #fff;  /* Pure white text */
  }
}

/* About page specific styling with blue-purple gradients */
.about-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9f7aea 100%) !important;
  position: relative;
  overflow: hidden;
  border: none !important;
  color: white !important;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4) !important;
  transition: all 0.3s ease !important;
}

/* Hover effect for the entire hero section */
.about-hero:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5) !important;
}

.about-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(102, 126, 234, 0.2));  /* Blue-purple light overlay */
  z-index: 1;
  transition: all 0.3s ease !important;
}

/* Animate the overlay on hover */
.about-hero:hover::before {
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.15), rgba(102, 126, 234, 0.25));
}

.about-hero * {
  position: relative;
  z-index: 2;  /* Ensure text appears above overlay */
}

.about-hero .about-title {
  color: #ffffff !important;  /* Pure white for maximum contrast */
  background: none !important;  /* Remove any background gradients */
  -webkit-background-clip: initial !important;  /* Reset background clipping */
  -webkit-text-fill-color: #ffffff !important;  /* Force white text fill */
  background-clip: initial !important;  /* Reset background clip */
  font-family: 'Arial', 'Helvetica', sans-serif !important;  /* Clear, clean font */
  text-shadow: none !important;  /* No shadows for crystal clear text */
  font-weight: 700 !important;  /* Bold but not too heavy */
  letter-spacing: 2px !important;
  text-transform: none !important;
  opacity: 1 !important;
  font-size: 4rem !important;
  transition: all 0.3s ease !important;  /* Smooth transitions */
  cursor: pointer !important;  /* Show it's interactive */
}

/* Fancy hover animation for the title */
.about-hero .about-title:hover {
  transform: scale(1.05) translateY(-5px) !important;  /* Scale up and lift */
  text-shadow: 0 5px 15px rgba(255, 255, 255, 0.3) !important;  /* Subtle white glow on hover */
  letter-spacing: 3px !important;  /* Expand letter spacing */
  color: #ffffff !important;  /* Keep white on hover */
  -webkit-text-fill-color: #ffffff !important;  /* Force white text fill on hover */
}

.about-hero .about-subtitle {
  color: #ffffff !important;  /* Pure white for subtitle */
  background: none !important;  /* Remove any background gradients */
  -webkit-background-clip: initial !important;  /* Reset background clipping */
  -webkit-text-fill-color: #ffffff !important;  /* Force white text fill */
  background-clip: initial !important;  /* Reset background clip */
  font-family: 'Arial', 'Helvetica', sans-serif !important;  /* Clean font */
  text-shadow: none !important;  /* No shadows for clarity */
  opacity: 1 !important;
  font-weight: 400 !important;  /* Normal weight for subtitle */
  font-size: 1.3rem !important;
  transition: all 0.3s ease !important;
}

/* Hover effect for subtitle */
.about-hero .about-subtitle:hover {
  transform: translateY(-2px) !important;  /* Subtle lift */
  opacity: 0.9 !important;  /* Slight fade effect */
  color: #ffffff !important;  /* Keep white on hover */
  -webkit-text-fill-color: #ffffff !important;  /* Force white text fill on hover */
}