:root {
  --primary-color: #d90429;
  --bg-light: #fff5f5;
  --text-color: #222;
  --card-radius: 12px;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-light);
  color: var(--text-color);
}

/* Header */
header {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 20px 0;
}
header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}
header p {
  margin-top: 5px;
  font-size: 0.9rem;
  opacity: 0.9;
}


/* Navigation bar */
.nav-container {
    background-color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-scroll {
    overflow-x: auto;        /* enable horizontal scroll */
    white-space: nowrap;     /* prevent wrapping */
    padding: 0 15px;
    -webkit-overflow-scrolling: touch; /* smooth scroll on mobile */
}

.nav-scroll::-webkit-scrollbar {
    display: none; /* hide scrollbar */
}

.nav-buttons {
    display: flex;      /* use flex layout */
    flex-wrap: nowrap;  /* prevent wrapping */
    gap: 10px;
}

.nav-btn {
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: 0.3s;
}

.nav-btn.active,
.nav-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Cards grid */
.container {
  max-width: 1200px;
  margin: auto;
}

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  padding: 15px;
}

.prompt-card {
  background: white;
  border-radius: var(--card-radius);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s;
  cursor: pointer;
}
.prompt-card:hover {
  transform: scale(1.03);
}

.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;  /* keeps width = height */
  object-fit: cover;
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}

.card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-color);
  color: white;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.card-content {
  padding: 10px;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn i {
  transition: color 0.3s;
}

.get-prompt-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.3s;
}
.get-prompt-btn:hover {
  background: #b90320;
}

/* Footer */
footer {
  text-align: center;
  background: var(--primary-color);
  color: white;
  padding: 15px;
  margin-top: 20px;
  font-size: 0.9rem;
}

/* ---------- DETAIL PAGE ---------- */
.detail-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 15px;
}

.detail-header {
  position: relative;
}
.detail-image {
  width: 100%;
  border-radius: var(--card-radius);
}
.back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #000;

  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none; /* removes underline */
}

.detail-body {
  margin-top: 20px;
  background: white;
  padding: 15px;
  border-radius: var(--card-radius);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
.detail-body h2 {
  margin: 0 0 10px;
  color: var(--primary-color);
}
.prompt-text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 15px;
  white-space: pre-line;
}
.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}
.copy-btn:hover {
  background: #b90320;
}
.copy-success {
  display: none;
  margin-left: 10px;
  color: green;
  font-weight: 600;
}

/* ---- Modal Styling ---- */
#copyDialog {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

#copyDialog.show {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background: #fff;
  color: #333;
  padding: 25px 30px;
  border-radius: 15px;
  text-align: center;
  max-width: 300px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  animation: popIn 0.25s ease;
}

.modal-icon {
  font-size: 50px;
  color: #e50914;
  margin-bottom: 10px;
}

.modal-content h3 {
  margin-bottom: 5px;
  font-size: 1.4rem;
  color: #222;
}

.modal-content p {
  font-size: 0.95rem;
  margin-bottom: 20px;
  color: #555;
}

#okBtn {
  background: #e50914;
  color: #fff;
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
}

#okBtn:hover {
  background: #c10812;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


@media (min-width: 768px) {
    .nav-buttons {
        justify-content: center;
    }
}
