/* Modern Blog Platform Styles */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-bg: #f8fafc;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  background-attachment: fixed;
  margin: 0;
  padding-top: 80px;
}

/* Navbar Styles */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color) !important;
  transition: transform 0.2s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  font-weight: 500;
  color: var(--gray-600) !important;
  transition: all 0.2s ease;
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background-color: var(--gray-50);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(59, 130, 246, 0.1);
  font-weight: 600;
}

/* Search Container */
.search-container {
  position: relative;
}

.search-input {
  padding-left: 2.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  background: var(--white);
  width: 250px;
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

/* Hero Section */
.hero-section {
  background: #1a1a1a; /* Dark background */
  color: #ffffff;      /* Light text color for contrast */
  padding: 4rem 0;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  background: #1a1a1a;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Filter Section */
.filter-section {
  background: var(--white);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.filter-container {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.filter-title {
  color: var(--gray-800);
  margin-bottom: 1rem;
  font-weight: 600;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.category-btn {
  background: var(--gray-100);
  border: 2px solid transparent;
  color: var(--gray-700);
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-btn:hover {
  background: var(--gray-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-btn.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.category-btn .badge {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.category-btn.active .badge {
  background: rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  background: var(--white);
  border-radius: var(--border-radius);
  margin: 2rem 0;
}

.spinner-container {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--gray-600);
  font-weight: 500;
  margin: 0;
}

/* Blog Section */
.blog-section {
  background: var(--white);
  padding: 2rem 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.results-info {
  background: var(--gray-50);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--primary-color);
}

/* Blog Card Styles */
.blog-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  cursor: pointer;
  border: 2px solid transparent;
}

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

.blog-card.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.blog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-image {
  transform: scale(1.05);
}

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

.blog-category {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-category.tech {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.blog-category.health {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.blog-category.finance {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.blog-excerpt {
  color: var(--gray-600);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.blog-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Blog Detail Styles */
.blog-detail {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.blog-detail-header {
  position: relative;
  height: 400px;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
}

.blog-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.blog-detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  display: flex;
  align-items: end;
  padding: 2rem;
}

.blog-detail-content {
  padding: 2rem;
}

.blog-detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.blog-detail-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
}

.blog-detail-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--gray-700);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  color: var(--white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-brand h5 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-title {
  color: var(--white);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--white);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  color: var(--white);
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1rem;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .search-input {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .category-buttons {
    justify-content: center;
  }
  
  .category-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  
  .blog-detail-title {
    font-size: 2rem;
  }
  
  .blog-detail-overlay {
    padding: 1rem;
  }
  
  .blog-detail-content {
    padding: 1.5rem;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .filter-section {
    padding: 1rem 0;
  }
  
  .filter-container {
    padding: 1rem;
  }
  
  .category-buttons {
    flex-direction: column;
  }
  
  .category-btn {
    width: 100%;
  }
  
  .blog-detail-header {
    height: 250px;
  }
  
  .blog-detail-title {
    font-size: 1.75rem;
  }
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .filter-section,
  .footer {
    display: none;
  }
  
  body {
    padding-top: 0;
    background: white;
  }
  
  .blog-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}