.library-container {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  margin: 5px;
  margin-bottom: 10px;
}
.library-block {
  padding: 20px;
  padding-bottom:20px;
  background: rgba(0, 0, 0, 0.2);
  margin: 6px;
  border-radius: 0px;
  max-width: calc(25% - 12px);
  width: 325px;
  font-size: 14px;
  line-height: 20px;
  border-radius: 10px;
  transition: all 0.2s;
  opacity: 1;
  cursor: pointer;
  color: #d4d4d4;
  border: 1px solid #ffffff0f;
  display: flex;
  flex-direction: column;
}
.new-block {
  align-items: center;
  justify-content: center;
  text-align: center;
  /* margin: 50px; */
  padding: 50px;
}
.library-block:hover {
  color:#fff;
  background: rgba(0, 0, 0, 0.7);
  /* top: -5px; */
  /* font-size:15px; */
  /* padding:10px; */
}
.library-block h3 {
  /* margin-bottom: 10px; */
  padding: 0px 0px;
  /* background: #00000030; */
  /* margin: -10px; */
  /* border-top-left-radius: 12px; */
  /* border-top-right-radius: 12px; */
  margin-bottom: 8px;
  margin-top:2px;
  color: #a4ffa7;
}

.template-preview {
  width: 100%;
  height: 195px;
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ffffff1a;
  background: #000;
  position: relative;
  /* flex: 1; */
}

.template-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  background: #000;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

.template-preview-image.image-hidden {
  opacity: 0;
}

.preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  border: 1px dashed #ffffff33;
  color: #666;
  font-size: 12px;
}

.preview-loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #ffffff33;
  border-radius: 4px;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.favorite-button:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #ffcc00;
  border-color: #ffcc0066;
  transform: scale(1.1);
}

.favorite-button.favorited {
  background: rgba(255, 204, 0, 0.2);
  color: #ffffff;
  border-color: #ffffff;
}

.favorite-button.favorited:hover {
  background: rgba(255, 204, 0, 0.3);
  color: #fff;
}

.template-info {
  flex: 1;
}

.template-info h3 {
  margin-bottom: 8px;
  margin-top: 2px;
  color: #a4ffa7;
  padding: 0;
  line-height: 24px;
}

.template-info p {
  margin: 0;
}

.load-more-container {
  text-align: center;
  padding: 20px;
  width: 100%;
}

.load-more-button {
  background: rgba(164, 255, 167, 0.1);
  border: 1px solid #a4ffa7;
  color: #a4ffa7;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  transition: all 0.3s;
}

.load-more-button:hover {
  background: rgba(164, 255, 167, 0.2);
  transform: translateY(-2px);
}

.loading-more {
  text-align: center;
  padding: 20px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff26;
  border-top: 2px solid #a4ffa7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.websim-terminal-input {
  font-size: 15px;
  margin: 5px 12px;
  margin-bottom: 0px !important;
  padding: 12px 20px;
  border-radius: 7px;
  background: #00000040;
  color: #e0e0e0;
  font-family: 'Fira Code', monospace;
  border: none;
  /* text-align: center; */
}

.websim-terminal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.websim-terminal-loading-bar {
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.websim-terminal-loading-bar div {
  width: 8px;
  height: 8px;
  background: linear-gradient(45deg, #00ff88, #00ccff, #ff6b9d);
  border-radius: 50%;
  position: absolute;
  animation: orbit 2s infinite linear;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

.websim-terminal-loading-bar div:nth-child(1) {
  animation-delay: 0s;
  background: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

.websim-terminal-loading-bar div:nth-child(2) {
  animation-delay: -0.66s;
  background: #00ccff;
  box-shadow: 0 0 20px rgba(0, 204, 255, 0.8);
  animation-direction: reverse;
}

.websim-terminal-loading-bar div:nth-child(3) {
  animation-delay: -1.33s;
  background: #ff6b9d;
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.8);
}

/* Central pulsing core */
.websim-terminal-loading-bar::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.1) 100%);
  border-radius: 50%;
  animation: pulse 1s infinite ease-in-out alternate;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateX(40px) rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) translateX(40px) rotate(-90deg) scale(1.2);
  }
  50% {
    transform: rotate(180deg) translateX(40px) rotate(-180deg) scale(0.8);
  }
  75% {
    transform: rotate(270deg) translateX(40px) rotate(-270deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) translateX(40px) rotate(-360deg) scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Save button inside the iframe */
#saveButton {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  padding: 8px 16px;
  background-color: #42b983;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Hover effect for the save button */
#saveButton:hover {
  background-color: #369b72;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .editor-area,
  .preview-frame {
    height: 400px;
  }

  .toggle-menu button {
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* Optional: Styling for editable elements inside the iframe */
[contenteditable="true"] {
  outline: 2px dashed #ccc;
}

/* Scrollbar styling for editors and preview */
.editor-area ::-webkit-scrollbar,
.preview-frame ::-webkit-scrollbar {
  width: 8px;
}

.editor-area ::-webkit-scrollbar-track,
.preview-frame ::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.editor-area ::-webkit-scrollbar-thumb,
.preview-frame ::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.editor-area ::-webkit-scrollbar-thumb:hover,
.preview-frame ::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.prompt-text-area {
  background: #00000033;
  padding: 12px;
  margin-top: 0px;
  color: #fff;
  border: 1px solid #ffffff3b;
  width: calc(100% - 0px) !important;
  margin: 6px 0px;
  border-radius: 14px;
  height: 42px;
}
.prompt-text-area.error {
  border: 1px solid #ff0000;
}
.prompt-container {
  position:relative;
}
.prompt-container button {
  position: absolute;
  top: 12px;
  right: 6px;
  padding: 8px;
  background: #ffffff1f;
  /* border: 1px solid rgb(255 255 255 / 30%); */
  /* border-radius: 0px; */
  color: #fff;
  /* border-bottom-left-radius: 5px; */
  /* border-top-right-radius: 4px; */
  border: none;
  border-right: none;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
  border-radius: 7px;
}
.prompt-container button:hover {
  background: #ffffff11;
}