/* ============================================= */
/* styles.css – Global styles for bookofprompt.com */
/* ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f12;
  color: #e0e0e0;
  line-height: 1.5;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.flex {
  display: flex;
  align-items: center;
}

.d-flex {
  display: flex;
  align-items: flex-start;
}

.flex-fill {
  flex: 1 1 auto;
}


/* Header */
.header {
  background: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #222;
}

.header-inner {
  display: block;
  align-items: center;
  justify-content: space-between;
  height: 100px;
}

.auth-actions {
  position: absolute;
  right: 0.5rem;
  top:0.5rem;
}

@media (min-width: 640px) {
  .header-inner {
    display: flex;
    height: 70px;
  }

  .auth-actions {
    position:static;
  }
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
}

.logo-accent {
  color: #a78bfa;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link.active,
.nav-link:hover {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #a78bfa;
  border-radius: 2px;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-weight: 400;
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn i {
  font-style: normal;
  font-size: 18px;
}

.btn-small i {
  font-style: normal;
  font-size: 14px;
}

.btn-primary {
  background: #a78bfa;
  color: #000;
}

.btn-primary:hover {
  background: #c4b5fd;
}

.btn-outline {
  border: 1.5px solid #555;
  color: #ccc;
  background: rgba(256, 256, 256, 0.2);
  ;
}

.btn-outline:hover {
  border-color: #a78bfa;
  color: #fff;
}

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

/* Prompt Grid – Pinterest style */
.main-content {
  padding: 2rem 0;
}


.prompt-card {
  background: #29292d;

  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  max-width: 280px;
}

.prompt-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-image-link {
  display: block;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s;
}

.prompt-card:hover .card-image {
  transform: scale(1.05);
}

.card-content {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.prompt-text {
  font-size: 0.92rem;
  color: #ddd;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.author-name {
  color: #a78bfa;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 0.8rem;
  width: 100%;
  align-items: center;
}

.big-icon {
  font-size: 20px;
  line-height: 16px;
}

.action-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
}

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

.action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #222;
  border-top: 4px solid #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.hidden {
  display: none;
}

/* Footer */
.footer {
  margin-top: 6rem;
  padding: 2rem 0;
  border-top: 1px solid #222;
  color: #666;
  font-size: 0.9rem;
}

.footer-nav a {
  color: #888;
  margin-left: 1.5rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #a78bfa;
}

/* Responsive */
@media (max-width: 768px) {
  

  .nav {
    gap: 1rem;
  }



  .auth-actions .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
  }
}

/* ============= SMART TAGS ============= */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  background: #1a1a1e;
  border: 1.5px solid #333;
  border-radius: 10px 10px 0 0;
  border-bottom: none;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  background: #a78bfa;
  color: #000;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0.25rem 0.5rem 0;
  text-decoration: none;
}

.tag-chip button {
  background: none;
  border: none;
  color: #000;
  font-size: 1.1rem;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

.tag-chip button:hover {
  background: rgba(0, 0, 0, 0.2);
}

#tags-input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border-radius: 0;
  outline: none;
  color: #fff;
  font-size: 1rem;

}

#tags-input::placeholder {
  color: #666;
}

.tags-suggestions {
  max-height: 200px;
  overflow-y: auto;
  background: #1e1e24;
  border: 1.5px solid #a78bfa;
  border-top: none;
  border-radius: 0 0 10px 10px;
  display: none;
}

.suggestion-item {
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background: #a78bfa;
  color: #000;
}

.tags-suggestions.show {
  display: block;
}

/* ==================== PREMIUM FORM CONTROLS (2025 vibe) ==================== */
/* Replaces ugly default browser styles – zero dependencies, < 3 KB */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: #16161a;
  border: 1.8px solid #2a2a2e;
  border-radius: 12px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.22s ease;
  outline: none;
}

/* Focus glow – the purple magic */
input:focus,
textarea:focus,
select:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
  background: #1a1a1e;
}

/* Hover state (subtle) */
input:hover,
textarea:hover,
select:hover {
  border-color: #444;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
  color: #777;
  opacity: 1;
}

/* Custom dropdown arrow for <select> */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 3rem !important;
  /* make room for arrow */
}

/* Make the arrow purple on focus */
select:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Number input – remove ugly spinner */
input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

/* Textarea specific */
textarea {
  min-height: 120px;
  resize: vertical;
}

/* Disabled state */
input:disabled,
textarea:disabled,
select:disabled {
  background: #111114;
  color: #555;
  cursor: not-allowed;
}

.upload-grid {
  display: flex;
}

/* Optional: slightly larger tap targets on mobile */
@media (max-width: 640px) {

  input,
  textarea,
  select {
    padding: 1rem 1.1rem;
    font-size: 1.05rem;
  }

  .upload-grid {
    display: block;
  }

}



.upload-form,
.upload-preview {
  width: 100%;
}

.upload-preview {
  padding: 1rem;
}

.form-group,
summary {
  margin-bottom: 1rem;
}

summary {
  cursor: pointer;
}

.spacing {
  padding: 1rem;

}

.preview-container img {
  max-width: 100%;
  display: block;
  margin: auto;
  border-radius: 12px;
}

.dropzone-content {
  text-align: center;
  border: #444 solid 1px;
  border-radius: 12px;
}


.form-group label {
  display: inline-block;
  margin-bottom: 0.25rem;
}

details {
  padding-bottom: 1rem;
}

/* ============= PROMPT DETAIL PAGE ============= */

/*
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

*/

@media (max-width: 468px) {
  .prompt-grid {
    display: block;
  }

  .image-section {
    order: -1;
  }

  .details-section {
    padding: 0 0 2rem 0;
  }
}

.details-section,
.image-section {
  width: 100%;
}

.image-section {
  text-align: center;
}

.details-section {
  padding-left: 2rem;
}

.main-image {

  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  max-height: 768px;
  max-width: 100%;
  margin: auto;
}

.image-actions {
  margin: 1rem 0 1.5rem 0;
  gap: 1rem;


}

.prompt-title {
  font-size: 2rem;
  margin: 0 0 1rem;
  line-height: 1.2;
  font-weight: 400;
}

.author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.author {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.author-name {
  font-weight: 600;
  color: #a78bfa;
}

.author-date {
  font-size: 0.9rem;
  color: #888;
}

.stats-bar {
  display: flex;
  gap: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  margin-bottom: 1.5rem;
  justify-content: space-between;
}

.stat {
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  color: #a78bfa;
}

.stat span {
  font-size: 0.9rem;
  color: #aaa;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.section {
  margin-bottom: 2rem;
}

.section h3 {
  margin: 0 0 0.8rem;
  color: #e0e0e0;
}

.code-block {
  background: rgba(256, 256, 256, 0.12);
  ;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #444;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  background: #16161a;
  padding: 1rem;
  border-radius: 10px;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.6rem 1rem;
  background: #1a1a1e;
  border: 1px solid #444;
  border-radius: 8px;
  color: #ccc;
  min-width: 60px;
  min-height: 60px;
  ;
  background-repeat: no-repeat;
  background-position: center;
}

.share-btn.reddit {
  background-image: url(../images/icons/reddit.png);
}

.share-btn.discord {
  background-image: url(../images/icons/discord.png);
}

.share-btn.whatsapp {
  background-image: url(../images/icons/whatsapp.png);
}

.share-btn.telegram {
  background-image: url(../images/icons/telegram.png);
}


/* ============= TOAST NOTIFICATIONS – Book of Prompt Style ============= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  min-width: 320px;
  max-width: 400px;
  background: #2f2f32;
  border: 1.5px solid #333;
  border-left: 5px solid #a78bfa;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: toastSlideIn 0.4s ease-out;
  transform-origin: top right;
}

.toast.success {
  border-left-color: #a78bfa;
}

.toast.error {
  border-left-color: #ee2626;
}

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

.toast.warning {
  border-left-color: #f59e0b;
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.toast-icon span {
  font-size: 24px;
  line-height: 18px;
}

.inputerror {
  border: #F00 solid 1px;
  background-color: rgba(255, 0, 0, 0.2);
}

.close-btn {
  font-weight: 400;
}

.filter-bar {
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
}

.input-group>* {
  border-radius: 0;
}

.input-group>*:first-child {
  border-radius: 12px 0 0 12px !important;

}

.input-group>*:last-child {
  border-radius: 0 12px 12px 0 !important;
}

.no-post {
  text-align: center;
  padding: 1rem;
  position: relative !important;
}

.me {
  margin-right: 1rem;
}

/* ============= INFINITE SCROLL ============= */
.loading-trigger {
  padding: 3rem 1rem;
  text-align: center;
  color: #888;
  opacity: 0;
  transition: opacity 0.4s;
}

.loading-trigger.visible {
  opacity: 1;
}

.loading-trigger .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #222;
  border-top: 4px solid #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.spinner-orbit {
  width: 36px;
  height: 36px;
  border: 4px solid #222;
  border-top: 4px solid #a78bfa;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  /* box-shadow: 0 0 20px rgba(167,139,250,0.3);*/
}

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