/**
 * Form controls: login/signup cards, add-cafe + edit-cafe forms, cafes search
 * input, the collapsible Create Cafe panel on the dashboard, and the OAuth
 * provider buttons. Loaded after app.css.
 */

/* Login / Signup form card */
.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%;
  overflow: hidden;
}
@media screen and (min-width: 769px) {
  .add-cafe-form {
    max-width: 42rem;
  }
}
@media screen and (min-width: 1024px) {
  .add-cafe-form {
    max-width: 48rem;
  }
}
/* Lock the textarea so user drag-handles can't push it past the column. */
.add-cafe-form textarea.textarea {
  resize: vertical;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
/* Image preview + upload controls stay inside the column. */
.add-cafe-image,
.add-cafe-image-preview {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.add-cafe-image-preview {
  background: #f3f4f6;
  border-radius: 6px;
}
.add-cafe-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.add-cafe-progress {
  margin-top: 0.5rem;
  max-width: 100%;
}
.add-cafe-upload-btn {
  margin-top: 0.5rem;
}
/* Edit-cafe form mirrors add-cafe: keep image preview and textareas inside the box. */
.edit-cafe-image,
.edit-cafe-image-preview {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.edit-cafe-image-preview {
  background: #f3f4f6;
  border-radius: 6px;
}
.edit-cafe-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#edit-cafe-description {
  resize: vertical;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Cafes search bar input (results cards live in cards.css). */
.cafes-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cafes-search {
  position: relative;
  max-width: 560px;
}
.cafes-search-input {
  padding-left: 2.2rem;
  padding-right: 2.4rem;
}
.cafes-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 2;
}
.cafes-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.25);
}
.cafes-search-clear:hover {
  background-color: rgba(0, 0, 0, 0.45);
}
.cafes-search-status {
  color: #6b7280;
  font-size: 0.85rem;
}

/* Collapsible add-cafe panel on the 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); }
}

/* OAuth provider buttons on the login + signup views. */
.oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin: 1.25rem 0 1rem;
}
.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}
.oauth-divider span {
  padding: 0 0.75rem;
}
.oauth-google-btn {
  background: #fff;
  border: 1px solid #dcdcdc;
  color: #3c4043;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.oauth-google-btn:hover {
  background: #f8fafc;
  border-color: #b9b9b9;
  color: #3c4043;
}
/* Official Google "G" mark — SVG is multi-coloured so no background needed. */
.oauth-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oauth-google-icon svg {
  display: block;
}
.oauth-auth0-btn {
  background: #fff;
  border: 1px solid #dcdcdc;
  color: #3c4043;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.oauth-auth0-btn:hover {
  background: #f8fafc;
  border-color: #b9b9b9;
  color: #3c4043;
}
.oauth-auth0-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oauth-auth0-icon svg {
  display: block;
}
