/* Prompts Page Specific Styles */

/* Custom Scrollbar Styling */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 5px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.5);
  border-radius: 5px;
  border: 2px solid var(--bg-secondary);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

*::-webkit-scrollbar-corner {
  background: var(--bg-secondary);
}

/* Textarea and modal scrollbar */
textarea::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.5);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  min-height: calc(100vh - 80px);
}

.prompts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-new-prompt {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-new-prompt svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

.btn-new-prompt:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
}

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.prompt-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.prompt-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.prompt-card:hover::before {
  transform: translateX(100%);
}

.prompt-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prompt-title {
  margin-top: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.prompt-models-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0; /* Remove gap to eliminate spacing */
}

.prompt-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.prompt-model:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.prompt-model:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.prompt-model:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.prompt-model .like-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  margin-left: 0.5rem; /* Added margin */
}

.prompt-model .like-count svg {
  width: 11px;
  height: 11px;
  stroke: var(--text-secondary);
}

.prompt-model.winner {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.prompt-model.winner .like-count {
  color: var(--accent);
}

.prompt-model.winner .like-count svg {
  stroke: var(--accent);
  fill: var(--accent);
}

.prompt-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-preview {
  background: linear-gradient(
    135deg,
    var(--bg) 0%,
    rgba(16, 185, 129, 0.03) 100%
  );
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  padding: 0.875rem;
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.825rem;
 
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: all 0.3s ease;
}

.prompt-preview::before {
  content: "PROMPT";
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  opacity: 0.3;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.prompt-card:hover .prompt-preview {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(
    135deg,
    var(--bg) 0%,
    rgba(16, 185, 129, 0.05) 100%
  );
}

.prompt-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.prompt-tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.prompt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
}

.prompt-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

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

.stat-item svg {
  width: 16px;
  height: 16px;
}

.prompt-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  font-weight: 600;
}

/* Modal Styles - Enhanced and Modern */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  max-width: 1400px;
  width: 95%;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 100px rgba(16, 185, 129, 0.1);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: -2rem;
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  z-index: 10;
  gap: 1rem;
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-close {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: 1rem;
}

.btn-close:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(239, 68, 68, 0.1);
}

.btn-close svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Fixed button alignment */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 140px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-submit svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}

.prompt-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Dark theme for prompt sections - Enhanced */
.prompt-section {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.prompt-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.prompt-section:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.section-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Dark theme for text content */
.prompt-content {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;

  padding: 1rem;
}

/* Markdown content styling */
.prompt-content h1,
.prompt-content h2,
.prompt-content h3,
.prompt-content h4,
.prompt-content h5,
.prompt-content h6 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prompt-content p {
  margin-bottom: 1rem;
}

.prompt-content code {
  background: var(--bg-secondary);
  color: var(--accent-light);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", monospace;
}

.prompt-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.prompt-content pre code {
  background: transparent;
  padding: 0;
}

.prompt-content a {
  color: var(--accent);
  text-decoration: none;
}

.prompt-content a:hover {
  text-decoration: underline;
}

.prompt-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
}

.prompt-content ul,
.prompt-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.prompt-content li {
  margin-bottom: 0.5rem;
}

.response-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1rem;
  overflow: hidden;
  width: 100%;
}

.preview-header {
  padding: 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header .section-label {
  margin-bottom: 0;
  width: 100%;
}

.preview-iframe {
  width: 100%;
  height: 600px;
  max-height: 60vh;
  border: none;
  background: white;
  display: block;
  isolation: isolate;
  contain: layout style paint;
}

.preview-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-maximize {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-maximize:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-maximize svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Fullscreen preview overlay */
.fullscreen-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 2000;
  display: none;
  flex-direction: column;
}

/* Prevent background scrolling when fullscreen preview is open */
body.fullscreen-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.fullscreen-preview.active {
  display: flex;
}

.fullscreen-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  min-height: 48px;
}

.fullscreen-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fullscreen-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.fullscreen-model {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
  height: 24px;
  display: inline-flex;
  align-items: center;
}

.btn-like-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  height: 24px !important;
  max-height: 24px !important;
  min-height: 24px !important;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  flex-shrink: 0;
  align-self: center;
}

.btn-like-compact:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-like-compact.liked {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-like-compact.liked svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.btn-like-compact svg {
  width: 14px;
  height: 14px;
}

.fullscreen-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

.btn-close-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  height: 24px !important;
  max-height: 24px !important;
  min-height: 24px !important;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  flex-shrink: 0;
  align-self: center;
}

.btn-close-fullscreen:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Like button - consistent positioning */
.btn-like {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  height: 28px;
  line-height: 1;
}

.btn-like:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-like.liked {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-like.liked svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.btn-like svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.like-count {
  font-weight: 600;
}

/* Response actions - consistent positioning */
.response-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.response-model {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  height: 28px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.btn-edit-response {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-edit-response:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-edit-response svg {
  width: 14px;
  height: 14px;
}

.model-likes {
  color: #e91e63;
  font-weight: 600;
  color: var(--accent);
}

/* Loading States */
.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
  0% {
    background-color: rgba(16, 185, 129, 0.05);
  }
  100% {
    background-color: rgba(16, 185, 129, 0.15);
  }
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.skeleton-line {
  height: 1rem;
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.1) 25%,
    rgba(16, 185, 129, 0.2) 50%,
    rgba(16, 185, 129, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: wave 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
}

.skeleton-line.title {
  height: 1.25rem;
  width: 60%;
}

.skeleton-line.description {
  height: 0.875rem;
  width: 100%;
}

.skeleton-line.tag {
  height: 1.5rem;
  width: 4rem;
  display: inline-block;
  margin-right: 0.5rem;
}

@keyframes wave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-like.loading {
  pointer-events: none;
  opacity: 0.7;
  min-width: 60px; /* Maintain minimum width during loading */
}

.btn-like.loading svg {
  display: none;
}

.btn-like.loading .like-count {
  display: none;
}

.btn-like.loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.load-more-container {
  text-align: center;
  padding: 2rem;
}

.btn-load-more {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-load-more.loading {
  pointer-events: none;
  opacity: 0.8;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Form Styles */
.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn-cancel {
  padding: 0.875rem 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-cancel:hover {
  border-color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* LLM Provider Tabs - Enhanced */
.llm-tabs {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
  position: relative;
}

.llm-tabs::-webkit-scrollbar {
  height: 6px;
}

.llm-tabs::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.llm-tabs::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.llm-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  min-width: max-content;
  flex-shrink: 0;
}

.llm-tab:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent);
  transform: translateY(-2px);
}

.llm-tab.active {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.llm-tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.llm-response-container {
  min-height: 300px;
  position: relative;
}

.llm-response-content {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg));
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInContent 0.3s ease;
}

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

.add-response-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 6px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.add-response-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.provider-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.provider-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.provider-option {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.provider-option:hover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.provider-option.selected {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border-color: var(--accent);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .prompts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Modal improvements for mobile */
  .modal.active {
    padding: 0;
    align-items: stretch;
  }

  .modal-content {
    border-radius: 20px 20px 0 0;
    margin: auto 0 0 0;
    padding: 1.5rem;
    max-height: 95vh;
    min-height: 50vh;
    width: 100%;
    max-width: 100%;
    animation: slideUpMobile 0.3s ease;
  }

  .preview-iframe {
    height: 400px;
    max-height: 50vh;
  }

  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .modal-header {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    position: relative;
    top: 0;
  }

  .modal-title {
    font-size: 1.5rem;
    flex: 1;
    margin-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    margin-left: 0.75rem;
  }

  .prompt-detail {
    gap: 1rem;
  }

  .prompt-section {
    padding: 1.25rem;
  }

  .prompt-content {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  /* LLM tabs mobile optimization */
  .llm-tabs {
    padding: 0.5rem;
    gap: 0.5rem;
    margin-bottom: 1rem;
    /* Add scroll indicators */
    position: relative;
  }

  @keyframes pulse {
    0%,
    100% {
      opacity: 0.7;
    }
    50% {
      opacity: 1;
    }
  }

  .llm-tab {
    padding: 0.6rem 1rem;
    font-size: 0.825rem;
    min-width: max-content;
    flex-shrink: 0;
  }

  .llm-tab-icon {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .llm-response-content {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Buttons mobile optimization */
  .btn-submit,
  .btn-cancel {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-like {
    padding: 0 0.5rem;
    height: 32px;
    min-height: 32px;
    font-size: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 55px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  .btn-like svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
  }

  .btn-like .like-count {
    min-width: 1ch;
  }

  .btn-maximize {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-maximize svg {
    width: 14px !important;
    height: 14px !important;
  }

  .btn-edit-response {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    flex-shrink: 0;
  }

  .btn-edit-prompt {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-edit-prompt svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
  }

  /* Fullscreen header mobile fixes */
  .fullscreen-header {
    height: 48px;
    min-height: 48px;
    padding: 0.75rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow: hidden;
    align-items: center;
  }

  .fullscreen-left {
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow: hidden;
    align-items: center;
  }

  .fullscreen-title {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }

  .fullscreen-model {
    font-size: 0.6rem;
    height: 16px;
    padding: 0 0.35rem;
    flex-shrink: 0;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
  }

  .fullscreen-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    align-items: center;
  }

  .fullscreen-preview .btn-like-compact {
    height: 22px !important;
    max-height: 22px !important;
    min-height: 22px !important;
    padding: 0 0.4rem !important;
    font-size: 0.65rem !important;
    min-width: 42px;
    border-radius: 5px;
    background: transparent;
    border: 1px solid var(--border);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .fullscreen-preview .btn-like-compact svg {
    width: 11px !important;
    height: 11px !important;
  }

  .fullscreen-preview .btn-close-fullscreen {
    height: 22px !important;
    max-height: 22px !important;
    min-height: 22px !important;
    padding: 0 0.5rem !important;
    font-size: 0.65rem !important;
    gap: 0.2rem;
    border-radius: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .fullscreen-preview .btn-close-fullscreen svg {
    width: 11px !important;
    height: 11px !important;
  }

  .response-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
  }

  .response-actions .response-model {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Preview improvements */
  .response-preview {
    margin-top: 0.75rem;
  }

  .preview-header {
    padding: 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .preview-header .section-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
  }

  .preview-header .section-label > span {
    font-size: 0.8rem;
  }

  .preview-controls {
    width: 100%;
    justify-content: space-between;
  }

  .preview-iframe {
    height: 300px;
    max-height: 300px;
  }

  /* Form improvements */
  .provider-form {
    padding: 1rem;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .form-actions .btn-submit,
  .form-actions .btn-cancel {
    width: 100%;
    padding: 0.875rem;
  }

  /* Loading states mobile */
  .loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* Better touch targets */
  button,
  .filter-chip,
  .llm-tab {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .modal-content {
    padding: 1.25rem;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .prompt-section {
    padding: 1rem;
  }

  .llm-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-width: 80px;
  }

  .section-label {
    font-size: 0.8rem;
  }

  .btn-submit,
  .btn-cancel {
    padding: 0.875rem;
  }

  /* Fullscreen header on very small screens */
  .fullscreen-header {
    padding: 0.6rem;
    height: 44px;
    min-height: 44px;
  }

  .fullscreen-left {
    flex: 1;
    min-width: 0;
  }

  .fullscreen-title {
    font-size: 0.7rem;
    max-width: 120px;
  }

  .fullscreen-model {
    font-size: 0.55rem;
    height: 14px;
    padding: 0 0.3rem;
    line-height: 14px;
  }

  .fullscreen-actions {
    flex-shrink: 0;
  }

  .fullscreen-preview .btn-like-compact {
    height: 20px !important;
    max-height: 20px !important;
    min-height: 20px !important;
    min-width: 38px;
    font-size: 0.6rem !important;
    padding: 0 0.35rem !important;
  }

  .fullscreen-preview .btn-close-fullscreen {
    font-size: 0.6rem !important;
    padding: 0 0.45rem !important;
    height: 20px !important;
    max-height: 20px !important;
    min-height: 20px !important;
  }

  .fullscreen-preview .btn-like-compact svg,
  .fullscreen-preview .btn-close-fullscreen svg {
    width: 10px !important;
    height: 10px !important;
  }

  .response-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
  }

  .response-actions .response-model {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Preview improvements */
  .response-preview {
    margin-top: 0.75rem;
  }

  .preview-header {
    padding: 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .preview-header .section-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
  }

  .preview-header .section-label > span {
    font-size: 0.8rem;
  }

  .preview-controls {
    width: 100%;
    justify-content: space-between;
  }

  .preview-iframe {
    height: 300px;
    max-height: 300px;
  }

  /* Form improvements */
  .provider-form {
    padding: 1rem;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .form-actions .btn-submit,
  .form-actions .btn-cancel {
    width: 100%;
    padding: 0.875rem;
  }

  /* Loading states mobile */
  .loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* Better touch targets */
  button,
  .filter-chip,
  .llm-tab {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .llm-tab:hover,
  .prompt-section:hover {
    transform: none;
  }

  /* Add active states for touch */
  .llm-tab:active {
    transform: scale(0.98);
  }

  button:active {
    transform: scale(0.98);
  }

  /* Increase tap targets */
  .llm-tab,
  button {
    position: relative;
  }

  .llm-tab::before,
  button::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
  }
}

/* Form Styling for Add/Edit Response */
.add-response-form,
.edit-response-form {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg));
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInContent 0.3s ease;
}

.add-response-form .form-group,
.edit-response-form .form-group {
  margin-bottom: 1.25rem;
}

.add-response-form .form-label,
.edit-response-form .form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.add-response-form .form-input,
.edit-response-form .form-input,
.add-response-form select,
.edit-response-form select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.add-response-form textarea,
.edit-response-form textarea {
  min-height: 150px;
  resize: vertical;
  font-family: inherit;
}

.add-response-form .form-input:focus,
.edit-response-form .form-input:focus,
.add-response-form select:focus,
.edit-response-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.response-form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-save-response,
.btn-update-response {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-save-response:hover,
.btn-update-response:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-cancel-response {
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel-response:hover {
  border-color: var(--text-secondary);
  background: var(--bg-secondary);
}

.btn-edit-prompt {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-edit-prompt:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-edit-prompt svg {
  width: 16px;
  height: 16px;
}
