/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.2rem 0;
  border-bottom: 2px solid rgba(135, 0, 197, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-items {
  display: flex;
  justify-content: center; /* Center items horizontally */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-items li {
  margin: 0 15px; /* Space between items */
}

.nav-items a {
  color: black;
  text-decoration: none;
  font-size: 1.2rem;
  position: relative;
  padding-bottom: 5px;
}

.nav-items a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #8700c5;
  transition: width 0.3s ease-in-out;
}

.nav-items a:hover {
  color: #8700c5;
  text-decoration: none;
}

.nav-items a:hover:after {
  width: 100%;
}

/* General Reset & Body Styling */
body {
  font-family: Arial, sans-serif;
  background-color: var(--background-color, #f7f9fc);
  margin: 0;
  padding: 0;
  color: var(--text-color, #333);
}

/* Container */
.container {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(135, 0, 197, 0.1);
}

.container:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Headings */
h1, h2, h3 {
  margin-bottom: 20px;
  color: #1a202c;
  background: linear-gradient(45deg, #1a202c, #8700c5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 100%;
}

/* Links */
a {
  color: #8700c5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
button, .btn, .button-link {
  background: linear-gradient(45deg, #8700c5, #9f1cf7);
  transition: all 0.3s ease;
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(135, 0, 197, 0.2);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

button:hover, .btn:hover, .button-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(135, 0, 197, 0.3);
  background: linear-gradient(45deg, #9f1cf7, #8700c5);
}

/* Inputs & Select */
input[type="text"],
select,
textarea {
  width: 25%;
  padding: 8px 10px;
  margin-top: 6px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: #8700c5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(135, 0, 197, 0.2);
}

/* Comment Box */
.comment {
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background-color: var(--card-background, #f9fafb);
  width: 100%;
  max-width: 400px;
  transition: all 0.3s ease;
  border: 1px solid rgba(135, 0, 197, 0.1);
}

.comment:hover {
  background: rgba(135, 0, 197, 0.02);
  border-color: rgba(135, 0, 197, 0.2);
}

/* Error Messages */
.error {
  color: red;
  margin-top: 10px;
}

/* Flex Row (e.g., for buttons inline) */
.flex-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

/* Form Section */
form {
  margin-top: 20px;
}

.center-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #f0f4f8;
}

.blog-card {
  background: white;
  padding: 10px;
  border-radius: 10px;
  width: 150px !important; /* Reduced from 200px to 150px */
  max-width: 150px !important; /* Reduced from 200px to 150px */
  margin-bottom: 250px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  min-height: 50px;
  transition: all 0.3s ease;
  border: 1px solid rgba(135, 0, 197, 0.1);
  animation: fadeIn 0.6s ease-out;
}

.blog-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(2deg) translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
/* Comment Section (Right-aligned) */
.comments-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align comments to the left */
  width: 65%;
  margin-top: 2px;
}

/* Optional: Add some margin to the comment form */
/* Add left padding to the comment form */
.comment-form {
  width: 100%;
  max-width: 500px;
  padding-left: 20px; /* Adjust the value to add left padding */
}

/* Flex container to align content and comments side by side */
.blog-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Align content at the top */
  margin-top: 20px;
}

/* Add left padding to the blog content */
.blog-content {
  width: 80%; /* Adjust width to your preference */
  padding-left: 20px; /* Add left padding */
  padding-right: 20px; /* Optional: add space between content and comments */
}

/* Add left padding to the comment form */
.comment-form {
  width: 100%;
  max-width: 500px;
  padding-left: 3px; /* Add left padding to the comment form */
}

/* Flex container to align content and comments side by side */
.blog-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Align content at the top */
  margin-top: 20px;
}

.comments-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align comments to the left */
  width: 65%; /* Adjust width for comments */
}

.comment {
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background-color: var(--card-background, #f9fafb);
  width: 100%;
  max-width: 400px; /* Set a max width if necessary */
}

/* Optional: Add some margin to the comment form */
.comment-form {
  width: 100%;
  max-width: 500px;
}

.category-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  transition: background-color 0.2s;
}

.category-item:last-child {
  border-bottom: none;
}

.category-item a {
  color: var(--text-color, #333);
  text-decoration: none;
  font-size: 1.1rem;
}

.category-item a:hover {
  color: #8700c5;
}

/* Card Layout for Blog and Category Index */
.category-list {
  max-width: 1000px; /* Increased to accommodate the two-column layout */
  margin: 40px auto;
  background: var(--card-background, #fff);
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(135, 0, 197, 0.1);
}

.category-list:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.category-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  transition: background-color 0.2s;
}

.category-item:last-child {
  border-bottom: none;
}

.category-item:hover {
  background-color: var(--hover-color, #f7f9fc);
}

.category-item a {
  color: var(--text-color, #333);
  text-decoration: none;
  font-size: 1.1rem;
  display: block;
}

.category-item a:hover {
  color: var(--primary-color, #8700c5);
}

/* Headings inside cards */
.category-list h1 {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  color: var(--text-color, #1a202c);
}

.button-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color, #8700c5);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    margin: 5px;
    border: none;
    cursor: pointer;
}

.button-link:hover {
    background-color: var(--primary-hover, #670396);
    color: white;
}

/* Replace the existing delete-button styles */
.delete-button {
  background: linear-gradient(45deg, #dc3545, #ff4757);
  animation: pulse 2s infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.delete-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
  background: linear-gradient(45deg, #dc3545, #ff4757); /* Keep same gradient on hover */
}

.back-button {
    display: inline-block;
    color: var(--primary-color, #8700c5);
    text-decoration: none;
    margin-top: 10px;
}

.back-button:hover {
    color: var(--primary-hover, #670396);
}

/* Add smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Device-specific styles */
/* Mobile First Approach */
@media screen and (max-width: 480px) {
  .container {
    margin: 20px 10px;
    padding: 15px;
  }

  .blog-card {
    width: 100% !important;
    max-width: 280px !important;
    margin-bottom: 150px;
  }

  .nav-items {
    flex-direction: column;
    gap: 15px;
  }

  .nav-items li {
    margin: 0;
  }

  input[type="text"],
  select,
  textarea {
    width: 100%;
  }
}

/* Tablet */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .container {
    margin: 30px 20px;
  }

  .blog-card {
    width: 200px !important;
    max-width: 200px !important;
  }

  .nav-items {
    gap: 10px;
  }
}

/* Laptop */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 700px;
  }

  .blog-card {
    width: 180px !important;
    max-width: 180px !important;
  }
}

/* Desktop */
@media screen and (min-width: 1025px) {
  .container {
    max-width: 900px;
  }

  .blog-card {
    width: 150px !important;
    max-width: 150px !important;
  }
}