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

/* System font fallbacks */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
  font-family: var(--font-family);
  background: #0a0a0a;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: #0a0a0a;
  border-bottom: 1px solid #333;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-title {
  color: #4ade80;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.site-subtitle {
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 400;
}

.new-badge {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #000;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-item {
  color: #9ca3af;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.language-selector select {
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.language-selector select:focus {
  border-color: #4ade80;
}

/* Platform Selection */
.platform-selection {
  background: #0a0a0a;
  border-bottom: 1px solid #333;
  padding: 16px 24px;
}

.platform-label {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: block;
}

.platform-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-btn {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #9ca3af;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.platform-btn:hover {
  border-color: #4ade80;
  color: #4ade80;
}

.platform-btn.active {
  background: #4ade80;
  border-color: #4ade80;
  color: #000;
  font-weight: 600;
}

/* Main Layout */
.main-content-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar for Categories */
.sidebar {
  width: 280px; /* A bit narrower */
  background: #0a0a0a;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
}

.category-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #9ca3af; /* Subdued color */
  padding: 12px 24px;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent; /* For active state indicator */
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.category-item:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.category-item.active {
  color: #4ade80; /* Highlight color */
  font-weight: 600;
  border-left-color: #4ade80;
  background: #1a2e1a; /* Subtle background for active */
}

/* Content Area */
.content-area {
  flex: 1;
  background: #0a0a0a;
  overflow-y: auto;
  padding: 24px;
}

/* Search moved to content area */
.search-section {
  margin-bottom: 24px;
}

.search-section input {
  width: 100%;
  max-width: 600px; /* Limit search bar width */
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-section input:focus {
  border-color: #4ade80;
}

.search-section input::placeholder {
  color: #666;
}

/* Prompt Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  max-width: 1400px;
}

/* Prompt Card */
.prompt-card {
  background: #111111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.prompt-card:hover {
  border-color: #4ade80;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.1);
}

.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.prompt-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-right: 16px; /* Space for actions */
}

.prompt-card-actions {
  display: flex;
  gap: 8px;
}

.prompt-action-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #9ca3af;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.prompt-action-btn:hover {
  border-color: #4ade80;
  color: #4ade80;
}

.prompt-card-description {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.prompt-card-category {
  background: #1a1a1a;
  color: #4ade80;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

.prompt-card-author {
  color: #666;
  font-size: 0.8rem;
}

/* Add Prompt FAB */
.add-prompt-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border: none;
  border-radius: 50%;
  color: #000;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
  transition: all 0.2s ease;
  z-index: 1000;
}

.add-prompt-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(74, 222, 128, 0.5);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: #111111;
  border: 1px solid #333;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #333;
}

.modal-header h3 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #fff;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #4ade80;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid #333;
}

.btn-primary {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border: none;
  color: #000;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.btn-secondary {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #9ca3af;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #444;
  border-color: #555;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #111111;
  border: 1px solid #333;
  color: white;
  padding: 16px 20px;
  border-radius: 8px;
  z-index: 3000;
  animation: slideInRight 0.3s ease;
  max-width: 350px;
}

.toast-success {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.toast-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.toast-warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.toast-info {
  border-color: #3b82f6;
  background: #3b82f6;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.sidebar::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Site Footer */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid #333;
  padding: 32px 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  margin: 0 16px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #4ade80;
  text-decoration: underline;
}

/* Styles for static content modals (About, Privacy, etc.) */
.content-modal-body {
  padding: 8px 24px 24px 24px;
  line-height: 1.7;
  color: #d1d5db; /* Lighter gray for readability */
}

.content-modal-body h4 {
  color: #4ade80;
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}

.content-modal-body strong {
  color: #ffffff;
  font-weight: 600;
}

.content-modal-body p {
  margin-bottom: 16px;
}

.content-modal-body a {
  color: #4ade80;
  text-decoration: none;
}

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

.content-modal-body ul {
  list-style-position: inside;
  padding-left: 8px;
  margin-bottom: 16px;
}

.content-modal-body .disclaimer {
  margin-top: 32px;
  padding: 16px;
  background: rgba(255, 235, 59, 0.05);
  border-left: 3px solid #facc15;
  font-size: 0.85rem;
  color: #fde047;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-left,
  .header-right {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .platform-buttons {
    justify-content: flex-start;
  }
  .platform-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
  
  .main-content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #333;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    white-space: nowrap; /* Keep categories in one line */
  }

  .category-item {
    padding: 10px 16px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .category-item.active {
    border-left: none;
    border-bottom-color: #4ade80;
  }

  .content-area {
    padding: 16px;
  }

  .add-prompt-fab {
    bottom: 16px;
    right: 16px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}

/* New styles for Prompt Detail Modal */
.modal-body {
  padding: 16px 24px;
}

.prompt-description-detail {
  color: #b0b0b0;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.modal-body h4 {
  color: #4ade80;
  font-size: 1rem;
  margin-bottom: 8px;
}

.prompt-full-text-display {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  color: #e0e0e0;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap; /* Important for wrapping long lines */
  word-wrap: break-word;
  max-height: 40vh; /* Limit height and make it scrollable */
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #333;
  text-align: right;
}
