/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* CSS Custom Properties for Dark Theme */
:root {
  /* Primary Colors */
  --primary-color: #3b82f6;
  --primary-dark: #1d4ed8;
  
  
  /* Neutral Colors - Dark Theme */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Background Colors - Dark Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  
  /* Border Colors - Dark Theme */
  --border-color: #334155;
  --border-hover: #475569;
  
  /* Shadow Colors - Dark Theme */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  
  /* Transitions */
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* Blog Header Styles */
.blog-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--gradient-primary);
  border-color: var(--primary-color);
}

.back-icon {
  font-size: 1.2rem;
  transition: var(--transition-normal);
}

.back-btn:hover .back-icon {
  transform: translateX(-3px);
}

.back-text {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Hamburger Navigation - Used by JavaScript */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-secondary);
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.menu-links a {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.menu-links li {
  list-style: none;
}

.menu-links.open {
  max-height: 300px;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Filter Section - Used by JavaScript */
.filter-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 1rem;
  font-weight: 500;
  text-transform: capitalize;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Blog Cards Section */
#blog-cards {
  padding: 4rem 2rem;
  min-height: 60vh;
}

.blog-cards-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 400px));
  gap: 2rem;
  justify-content: center;
}

/* Blog Card Styles */
.blog-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition-normal);
  border: 1px solid var(--border-color);
  position: relative;
  cursor: pointer;
  height: fit-content;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-hover);
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: var(--transition-normal);
}

.blog-card:hover::before {
  transform: scaleX(1);
}

.blog-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.blog-card:hover .blog-image img {
  transform: scale(1.05);
}

.blog-content {
  padding: 1.5rem;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-category {
  background: var(--gradient-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.blog-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.blog-read-time {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.blog-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  grid-column: 1 / -1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px 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); }
}

.loading-spinner p {
  color: var(--text-muted);
  font-size: 1rem;
}


/* Button Styles */
.btn {
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition-normal);
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-color-1 {
  background: var(--gradient-primary);
  color: white;
}

.btn-color-1:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}


/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .blog-cards-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
    gap: 1.5rem;
    justify-content: center;
  }

  .header-container {
    padding: 0 1.5rem;
  }

  .back-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }

  .filter-buttons {
    gap: 0.75rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .blog-cards-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-content: stretch;
  }

  .blog-card {
    margin: 0 1rem;
  }

  .blog-content {
    padding: 1.25rem;
  }

  .blog-title {
    font-size: 1.25rem;
  }

  .blog-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .blog-btn {
    width: 100%;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  .header-container {
    padding: 0 1rem;
  }

  .back-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .back-text {
    display: none;
  }

  .back-icon {
    font-size: 1.5rem;
  }



  #blog-cards {
    padding: 3rem 1rem;
  }

  .blog-card {
    margin: 0;
  }

  .filter-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeInUp 0.6s ease-out;
}

/* Error and No Content Messages - Used by JavaScript */
.no-blogs-message,
.error-message {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.no-blogs-message h3,
.error-message h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.no-blogs-message p,
.error-message p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

thead {
  background: var(--gradient-primary);
}

thead th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary-dark);
}

tbody tr {
  text-align: left;
  transition: var(--transition-normal);
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  vertical-align: top;
}

tbody td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.05);
}

/* Responsive Table */
@media screen and (max-width: 768px) {
  table {
    font-size: 0.875rem;
    margin: 1.5rem 0;
  }
  
  thead th,
  tbody td {
    padding: 0.75rem 1rem;
  }
  
  thead th {
    font-size: 0.875rem;
  }
}

@media screen and (max-width: 480px) {
  table {
    font-size: 0.8rem;
    margin: 1rem 0;
  }
  
  thead th,
  tbody td {
    padding: 0.5rem 0.75rem;
  }
  
  thead th {
    font-size: 0.8rem;
  }
}

/* Table styles for 360px mobile */
@media screen and (max-width: 360px) {
  /* Prevent horizontal scroll */
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  /* Make tables scrollable but contained */
  table,
  .blog-content table {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    margin: 1rem 0;
    font-size: 0.7rem;
  }

  table thead,
  table tbody,
  table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  table thead th,
  .blog-content table thead th {
    padding: 0.5rem 0.4rem;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
  }

  table tbody td,
  .blog-content table tbody td {
    padding: 0.5rem 0.4rem;
    font-size: 0.65rem;
    word-wrap: break-word;
    white-space: normal;
    max-width: 100px;
  }

  /* Ensure blog content doesn't overflow */
  .blog-content {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  .blog-content img {
    max-width: 100% !important;
    height: auto !important;
  }

  .blog-content .code-block,
  .blog-content pre,
  .blog-content code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
  }
}

/* Code Block Styles */
.code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: "Proggy Fonts", "Courier New", "Monaco", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.code-block pre {
  margin: 0;
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}


