/* Blog-specific CSS Variables and Base Styles */

/* Utility Classes */
.filtered-out {
  display: none !important;
}
:root {
  --primary-color: #ff6f61;
  --secondary-color: #4a90e2;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  --gradient-primary: linear-gradient(135deg, #ff6f61 0%, #ffa726 100%);
  --gradient-secondary: linear-gradient(135deg, #4a90e2 0%, #7b68ee 100%);
  --gradient-hero: linear-gradient(135deg, rgba(255, 111, 97, 0.9) 0%, rgba(255, 167, 38, 0.9) 100%);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --border-radius-2xl: 1.5rem;
  
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* Blog Hero Section */
.blog-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 111, 97, 0.95) 0%, rgba(255, 167, 38, 0.95) 100%),
              url('https://images.unsplash.com/photo-1601758228041-f3b2795255f1?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center/cover;
  overflow: hidden;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { filter: brightness(1) saturate(1); }
  100% { filter: brightness(1.05) saturate(1.1); }
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  animation: fadeInUp 1s ease-out;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

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

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  animation: slideInLeft 1s ease-out 0.3s both;
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3rem;
  line-height: 1.6;
  font-weight: 300;
  animation: slideInRight 1s ease-out 0.6s both;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Floating Elements Animation */
.hero-background::before,
.hero-background::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.hero-background::before {
  width: 100px;
  height: 100px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.hero-background::after {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 15%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

/* Search Container */
.search-container {
  margin-bottom: 3rem;
  animation: scaleIn 1s ease-out 0.9s both;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.search-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.search-box:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.3), var(--shadow-xl);
}

#main-blog-search {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--gray-800);
  outline: none;
  font-weight: 400;
}

#main-blog-search::placeholder {
  color: var(--gray-500);
  font-weight: 300;
}

.search-btn {
  padding: 1rem 1.5rem;
  background: var(--gradient-primary);
  border: none;
  color: white;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.search-btn:hover {
  background: linear-gradient(135deg, #e55a50 0%, #ff9800 100%);
  transform: scale(1.05);
}

.search-btn:active {
  transform: scale(0.98);
}

.search-btn i {
  font-size: 1.2rem;
  transition: transform var(--transition-fast);
}

.search-btn:hover i {
  transform: rotate(15deg);
}

/* Blog Stats */
.blog-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  animation: fadeInUp 1s ease-out 1.2s both;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-normal);
  min-width: 120px;
}

.stat-item:hover {
  transform: translateY(-5px) scale(1.05);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
  animation: countUp 2s ease-out 1.5s both;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.5rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive Design for Stats */
@media (max-width: 768px) {
  .blog-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .stat-item {
    min-width: 100px;
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 111, 97, 0.9) 0%, rgba(255, 167, 38, 0.9) 100%),
              url('../img/Screenshot 2025-01-17 032832.png') center/cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.float-element {
  position: absolute;
  font-size: 2rem;
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--delay);
  left: var(--x);
  top: var(--y);
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  color: white;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* Advanced Search Container */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

.search-box {
  position: relative;
  display: flex;
  margin-bottom: 1rem;
}

#blog-search {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 50px 0 0 50px;
  font-size: 1rem;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--dark-color);
}

.search-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 0 50px 50px 0;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  cursor: pointer;
  transition: var(--transition-normal);
}

.search-btn:hover {
  background: white;
  transform: scale(1.05);
}

.search-filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.search-filters select {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--dark-color);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

/* Blog Stats */
.blog-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.5rem;
}

/* Featured Posts Section */
.featured-posts {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
  overflow: hidden;
}

.featured-posts::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

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

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInUp 0.8s ease-out;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--gray-600);
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.featured-card {
  background: white;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  animation: slideInUp 0.8s ease-out;
}

.featured-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.featured-card:nth-child(even) {
  animation-delay: 0.2s;
}

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

.featured-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.featured-content {
  padding: 2rem;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-tag {
  background: var(--gradient-primary);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.read-time {
  color: var(--gray-500);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.read-time::before {
  content: '🕒';
  font-size: 0.8rem;
}

.featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  line-height: 1.3;
  transition: color var(--transition-fast);
}

.featured-card:hover .featured-title {
  color: var(--primary-color);
}

.featured-excerpt {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.featured-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.featured-link::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.featured-link:hover {
  color: var(--secondary-color);
}

.featured-link:hover::after {
  transform: translateX(5px);
}

/* Blog Section */
.blog-section {
  padding: 5rem 0;
  background: white;
  position: relative;
}

/* Blog Layout - Two Column */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.blog-main {
  min-width: 0; /* Prevents grid overflow */
}

/* Sidebar Positioning */
.blog-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
  background: white;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border: 1px solid var(--gray-200);
}

@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .blog-sidebar {
    position: relative;
    top: auto;
    order: -1; /* Show sidebar above content on mobile */
  }
}

.blog-header {
  margin-bottom: 3rem;
}

.blog-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.blog-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--gray-100);
  padding: 0.5rem;
  border-radius: var(--border-radius-lg);
}

.filter-tab {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
}

.filter-tab:hover {
  background: rgba(255, 111, 97, 0.1);
  color: var(--primary-color);
}

.filter-tab.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.sort-dropdown select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius-md);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.sort-dropdown select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-controls {
    justify-content: center;
  }
  
  .filter-tabs {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--gray-800);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateX(400px);
  transition: transform var(--transition-normal);
  z-index: 1000;
  font-weight: 500;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-success {
  background: var(--success-color, #10b981);
}

.toast.toast-error {
  background: var(--error-color, #ef4444);
}

.toast.toast-warning {
  background: var(--warning-color, #f59e0b);
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* Sticky Header Effects */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  transition: all var(--transition-normal);
  transform: translateY(-100%);
}

.sticky-header.scrolled {
  transform: translateY(0);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --gray-50: #1f2937;
  --gray-100: #374151;
  --gray-200: #4b5563;
  --gray-300: #6b7280;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #f3f4f6;
  --gray-800: #f9fafb;
  --gray-900: #ffffff;
}

[data-theme="dark"] .blog-hero {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

[data-theme="dark"] .featured-posts {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

[data-theme="dark"] .blog-section {
  background: #111827;
}

[data-theme="dark"] .blog-card {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .search-box {
  background: rgba(31, 41, 55, 0.95);
}

/* Sidebar Sticky Behavior */
.blog-sidebar.sticky {
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* Enhanced Animations */
.animate-in {
  animation: slideInUp 0.6s ease-out;
}

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

/* Lazy Loading Image Effects */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Enhanced Bookmark and Like Buttons */
.bookmark-btn.bookmarked,
.like-btn.liked {
  background: var(--primary-color) !important;
  color: white !important;
  transform: scale(1.1);
}

.bookmark-btn:hover,
.like-btn:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-md);
}

/* Search Results Highlighting */
.search-highlight {
  background: rgba(255, 111, 97, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Loading States */
.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.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }
  
  .toast.show {
    transform: translateY(0);
  }
  
  .theme-toggle {
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .blog-sidebar.sticky {
    position: relative;
    top: auto;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.hidden { display: none !important; }
