@import url('https://fonts.googleapis.com/css2?family=Niconne&display=swap');

/**
 * Main app styles.
 */

:root {
  --ink-black: #001524;
  --ink-black-light: #003052;
  --ash-grey: #9db5b2;
  --light-cyan: #daf0ee;
  --walnut: #6d3d14;
  --espresso: #551b14;

  --body-background: rgb(246, 246, 246);
}

body {
  background-color: var(--body-background);
  background-image:
    linear-gradient(rgba(246, 246, 246, 0.92), rgba(246, 246, 246, 0.92)),
    url("/assets/images/abf8ac6b2585fcc6e834867cae7699c60a3961b1d62577d30462aceb8d1b238c.jpg");
  background-size: auto, cover;
  background-attachment: fixed;
  background-position: center;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Niconne', cursive;
}

/* Undo Bulma's negative-margin overlap between adjacent .title / .subtitle. */
.title:not(:last-child),
.subtitle:not(:last-child) {
  margin-bottom: 0.75rem;
}
.title + .subtitle,
.subtitle + .title {
  margin-top: 0;
}

.panel .panel-icon {
  color: var(--walnut);
}

/* Toast: fixed position + slide-in (Bulma .notification does the rest) */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 22rem;
  animation: toast-in 0.35s ease-out;
}

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

/* Login / Signup / Account form cards */
.form-card {
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0.5rem 1rem rgba(0, 21, 36, 0.08);
}

/* Add cafe form: constrained width on large screens, responsive columns */
.add-cafe-form {
  max-width: 100%;
}
@media screen and (min-width: 769px) {
  .add-cafe-form {
    max-width: 42rem;
  }
}
@media screen and (min-width: 1024px) {
  .add-cafe-form {
    max-width: 48rem;
  }
}

/* List cafes: image-first card grid (dashboard) */
.list-cafe-card {
  background-color: #fff;
  box-shadow: 0 0.5rem 1rem rgba(0, 21, 36, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.list-cafe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.4rem rgba(0, 21, 36, 0.12);
}
.list-cafe-card .card-image {
  position: relative;
  background-color: #eee;
}
.list-cafe-card .card-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.list-cafe-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: #fff !important;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.list-cafe-private-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.cafe-detail-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}
.list-cafe-card .card-content {
  flex-grow: 1;
  padding: 1rem 1.1rem 0.75rem;
}
.list-cafe-name {
  font-family: 'Niconne', cursive;
  font-size: 1.6rem;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.list-cafe-name a:hover {
  color: var(--walnut) !important;
}
.list-cafe-description {
  color: #4a4a4a;
  font-size: 0.85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.list-cafe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-size: 0.75rem;
  color: #6b7280;
}
.list-cafe-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.list-cafe-card .card-footer {
  border-top: 1px solid rgba(10, 10, 10, 0.08);
  padding: 0;
}
.list-cafe-link {
  font-weight: 600;
  color: var(--walnut) !important;
}
.list-cafe-link:hover {
  background-color: rgba(109, 61, 20, 0.06);
}
.list-cafe-delete {
  padding: 0.45rem;
}

section {
  min-width: 50vw;
}

/* ----- Map ---------------------------------------------------------- */

.cafe-map-wrap {
  width: 100%;
}
#cafe-map {
  width: 100%;
  height: 360px;
  border-radius: 6px;
  box-shadow: 0 0.5rem 1rem rgba(0, 21, 36, 0.08);
  z-index: 0;
}
.cafe-map-hint {
  margin-top: 0.5rem;
}
@media screen and (min-width: 769px) {
  #cafe-map {
    height: 420px;
  }
}

/* Custom bean marker — Leaflet wraps divIcon HTML in a wrapper we need to clear. */
.bean-marker,
.bean-marker svg {
  background: transparent;
  border: none;
}
.bean-marker--picker svg {
  animation: bean-pulse 1.4s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes bean-pulse {
  0%   { transform: scale(1);    }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1);    }
}

/* Branded popup */
.leaflet-popup-content {
  margin: 0.75rem;
}
.cafe-popup {
  min-width: 12rem;
  max-width: 16rem;
  font-family: inherit;
}
.cafe-popup-image {
  margin: -0.5rem -0.5rem 0.5rem -0.5rem;
}
.cafe-popup-image img {
  width: 100%;
  height: 7rem;
  object-fit: cover;
  display: block;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}
.cafe-popup-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-black);
  margin: 0 0 0.35rem 0;
}
.cafe-popup-chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.cafe-popup-meta {
  font-size: 0.8rem;
  color: #4a4a4a;
  margin: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cafe-popup-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--walnut);
}
.cafe-popup-link:hover {
  text-decoration: underline;
}

/* ----- Tinted category chip (works wherever the chip context has colour) - */

.category-chip {
  color: #fff !important;
}
.category-chip.is-light-when-inactive:not(.is-active) {
  background: rgba(0, 21, 36, 0.06) !important;
  color: var(--ink-black) !important;
}

/* ----- Cafes directory page (cafe-view.hbs) ------------------------------ */

.cafes-directory-header {
  margin-bottom: 1.5rem;
}
.cafes-directory-header .title {
  margin-bottom: 0.25rem;
}

.directory-card {
  background-color: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0.5rem 1rem rgba(0, 21, 36, 0.08);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.directory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.4rem rgba(0, 21, 36, 0.12);
}
.directory-card-image {
  position: relative;
  background-color: #eee;
}
.directory-card-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.directory-card .card-content {
  flex-grow: 1;
  padding: 1rem 1.1rem;
}
.directory-card-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.directory-card-views {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.directory-card-name {
  font-family: 'Niconne', cursive;
  font-size: 1.6rem;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.directory-card-name a:hover {
  color: var(--walnut) !important;
}
.directory-card-description {
  color: #4a4a4a;
  font-size: 0.85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.directory-card-meta {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.directory-card-footer {
  border-top: 1px solid rgba(10, 10, 10, 0.08);
}
.directory-card-link {
  font-weight: 600;
  color: var(--walnut);
}
.directory-card-link:hover {
  background-color: rgba(109, 61, 20, 0.06);
}
.directory-card-delete {
  padding: 0.5rem;
}

/* Aside */
.cafes-aside-box {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 21, 36, 0.06);
}
.cafes-aside-box .heading {
  color: #6b7280;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}
.cafes-aside-stat {
  font-family: 'Niconne', cursive;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink-black);
}
.cafes-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cafes-aside-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.25rem;
  border-radius: 4px;
  color: var(--ink-black);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.cafes-aside-row:hover {
  background-color: rgba(0, 21, 36, 0.05);
}
.cafes-aside-row.is-active {
  background-color: rgba(109, 61, 20, 0.10);
  color: var(--walnut);
  font-weight: 600;
}
.cafes-aside-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.cafes-aside-name {
  flex-grow: 1;
  font-size: 0.9rem;
}
.cafes-aside-count {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
}
.cafes-aside-cta {
  background: linear-gradient(135deg, #fff 0%, var(--light-cyan) 130%);
}

/* ----- Cafe detail page -------------------------------------------------- */

.cafe-detail-card {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 21, 36, 0.10);
}
.cafe-detail-image {
  position: relative;
  background-color: #eee;
}
.cafe-detail-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.cafe-detail-tag {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.cafe-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.cafe-detail-name {
  margin-bottom: 0 !important;
}
.cafe-detail-views {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #6b7280;
  font-size: 0.85rem;
}
.cafe-detail-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cafe-detail-shares {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #6b7280;
  font-size: 0.85rem;
}
.cafe-detail-share-btn {
  font-size: 0.8rem;
}
.share-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: rgba(33, 33, 33, 0.9);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.share-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cafe-detail-description p {
  font-size: 1.02rem;
  color: #2a2a2a;
}
.cafe-detail-coords {
  font-size: 0.85rem;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* ----- Admin section ---------------------------------------------------- */

.admin-section .title {
  margin-bottom: 0.25rem;
}
.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stats {
  margin-bottom: 1rem;
}
.admin-stat {
  text-align: left;
  border-left: 4px solid var(--walnut);
  padding: 1rem 1.1rem;
}
.admin-stat .heading {
  color: #6b7280;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-stat-value {
  font-family: 'Niconne', cursive;
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--ink-black);
}

.admin-heading {
  font-family: 'Niconne', cursive;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--ink-black);
}

.admin-top-list,
.admin-cat-list,
.admin-user-cafe-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-top-row,
.admin-user-cafe-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.4rem;
  color: var(--ink-black);
  border-bottom: 1px solid rgba(10, 10, 10, 0.06);
  text-decoration: none;
}
.admin-top-row:hover,
.admin-user-cafe-row:hover {
  background-color: rgba(0, 21, 36, 0.04);
}
.admin-top-rank {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background-color: var(--walnut);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}
.admin-top-tag,
.admin-user-cafe-tag {
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.65rem;
}
.admin-top-name,
.admin-user-cafe-name {
  flex-grow: 1;
  font-weight: 500;
}
.admin-top-views,
.admin-user-cafe-views {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-cat-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid rgba(10, 10, 10, 0.06);
}
.admin-cat-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.admin-cat-name {
  flex-grow: 1;
}
.admin-cat-count {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.85rem;
}

.admin-cta {
  background: linear-gradient(135deg, #fff 0%, var(--light-cyan) 130%);
}

.admin-users-table-wrap {
  padding: 0.5rem;
}
.admin-users-table th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}
.admin-users-actions .button + form {
  margin-left: 0.35rem;
}
.admin-role-tag {
  background-color: rgba(0, 21, 36, 0.08) !important;
  color: var(--ink-black) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
}
.admin-role-tag.is-admin {
  background-color: var(--walnut) !important;
  color: #fff !important;
}

.admin-nav-link {
  color: var(--walnut) !important;
  font-weight: 600;
}

/* ----- Collapsible add-cafe (dashboard) ---------------------------------- */

.add-cafe-collapse {
  margin-top: 1.5rem;
}
.add-cafe-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background-color: var(--walnut);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
  user-select: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.add-cafe-collapse > summary::-webkit-details-marker { display: none; }
.add-cafe-collapse > summary:hover {
  background-color: var(--espresso);
}
.add-cafe-collapse > summary::before {
  content: "\f067"; /* fa-plus */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}
.add-cafe-collapse[open] > summary::before {
  content: "\f068"; /* fa-minus */
}
.add-cafe-collapse[open] > summary {
  background-color: var(--espresso);
}
.add-cafe-collapse-body {
  margin-top: 1rem;
  animation: add-cafe-slide 0.25s ease-out;
}
@keyframes add-cafe-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- Cafe card image shine (hover) ------------------------------------- */

.list-cafe-card .card-image .image,
.directory-card-image .image,
.cafe-detail-image .image {
  overflow: hidden;
}
.list-cafe-card .card-image .image::after,
.directory-card-image .image::after,
.cafe-detail-image .image::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.7s ease;
  z-index: 1;
}
.list-cafe-card:hover .card-image .image::after,
.directory-card:hover .directory-card-image .image::after,
.cafe-detail-card:hover .cafe-detail-image .image::after {
  left: 125%;
}

/* Hover-revealed edit pill in the top-right of any cafe card image. */
.cafe-card-edit-overlay {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  transform: translateY(-4px);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.cafe-card-edit-overlay:hover {
  background: #fff;
  color: var(--espresso);
}
.list-cafe-card:hover .cafe-card-edit-overlay,
.directory-card:hover .cafe-card-edit-overlay,
.cafe-detail-card:hover .cafe-card-edit-overlay {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Reviews section on cafe detail. */
.cafe-detail-reviews-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cafe-detail-reviews-count {
  font-weight: 400;
  font-size: 0.85em;
}
.cafe-detail-reviews-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cafe-detail-review {
  padding: 0.85rem 0;
  border-bottom: 1px solid #eee;
}
.cafe-detail-review:last-child {
  border-bottom: none;
}
.cafe-detail-review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.3rem;
}
.cafe-detail-review-stars {
  display: inline-flex;
  gap: 0.1rem;
  color: #ddd;
}
.cafe-detail-review-star.is-filled {
  color: #f5b400;
}
.cafe-detail-review-meta {
  font-size: 0.85rem;
  color: #4a4a4a;
}
.cafe-detail-review-author {
  font-weight: 600;
}
.cafe-detail-review-delete {
  margin-left: auto;
}
.cafe-detail-review-comment {
  margin: 0;
  color: #2a2a2a;
  line-height: 1.4;
  white-space: pre-wrap;
}
.cafe-detail-review-form {
  background-color: #fafafa;
}