/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styling: Dark background with subtle gradient */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, #232526, #414345);
  color: #fff;
  min-height: 100vh;
}

/* Back Button Styles */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(81.02deg, rgb(250, 85, 96) -23.47%, rgb(177, 75, 244) 45.52%, rgb(77, 145, 255) 114.8%);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
}

.back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(250, 85, 96, 0.4);
}

.back-button:active {
  transform: translateY(0);
}

/* Component List: Grid Layout */
#component-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding: 40px;
  max-width: 1300px;
  margin: 0 auto; /* Center container */
}

/* Component Card Styling */
.component-card {
  background: #1e1e1e;
  border: 0.5px solid rgb(177, 75, 244);
  border-radius: 10px;

  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.component-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

/* Card Title */
.component-card h3 {
  margin-bottom: 15px;
  font-size: 1.2em;
  color: #edebeb;
}

/* Preview Container */
.preview-container {
  background: #2a2a2a;
  color: #fff;
  padding: 10px;
  border-radius: 5px;
  min-height: 150px; /* Provide space for animations */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

/* "View Code" Button */
.view-code-btn {
  background: linear-gradient(
    81.02deg,
    rgb(250, 85, 96) -23.47%,
    rgb(177, 75, 244) 45.52%,
    rgb(77, 145, 255) 114.8%
  );
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.view-code-btn:hover {
  background: linear-gradient(
    81.02deg,
    rgb(250, 85, 96) -23.47%,
    rgb(177, 75, 244) 45.52%,
    rgb(77, 145, 255) 114.8%
  );
}

/* Modal Overlay */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.7);
}

/* Modal Content */
.modal-content {
  background: #2a2a2a;
  margin: 50px auto;
  padding: 20px;
  border-radius: 8px;
  max-width: 700px;
  position: relative;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
}
.close-btn:hover {
  color: #ccc;
}

/* Code Blocks */
.modal-content h3 {
  margin-top: 30px;
  font-size: 1.1em;
  color: #e0e0e0;
  font-weight: 100;
}

pre {
  background: #1e1e1e;
  padding: 10px;
  margin-bottom: 10px;
  overflow-x: auto;
  border-radius: 5px;
  font-size: 0.9em;
  max-height: 200px; /* limit code block height */
  white-space: pre-wrap; /* wrap lines if they're too long */
  color: #fff;
}

/* Copy Buttons */
.copy-btn {
  background: linear-gradient(
    81.02deg,
    rgb(250, 85, 96) -23.47%,
    rgb(177, 75, 244) 45.52%,
    rgb(77, 145, 255) 114.8%
  );
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  margin-bottom: 20px;
  margin-right: 10px;
  transition: background 0.3s ease;
}


/* Additional styles for new components */
.component-container {
    width: 100%;
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 20px;
}

h2 {
    margin-bottom: 20px;
    justify-self: center;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

#search-input {
  margin-bottom: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 24px;
    box-sizing: border-box;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #ffffff29;
    color: #fff;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.category-tabs-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs-container::-webkit-scrollbar {
    display: none;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(
    81.02deg,
    rgb(250, 85, 96) -23.47%,
    rgb(177, 75, 244) 45.52%,
    rgb(77, 145, 255) 114.8%
  );    color: white;
}

.more-btn {
    display: flex;
    align-items: center;
    margin-left: 10px;
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 5px;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.page-num.active {
  background: linear-gradient(
    81.02deg,
    rgb(250, 85, 96) -23.47%,
    rgb(177, 75, 244) 45.52%,
    rgb(77, 145, 255) 114.8%
  );    color: white;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ellipsis {
    padding: 0 5px;
}

.no-results {
    text-align: center;
    padding: 30px;
    color: #666;
}
