@import url("/assets/bootstrap-f3f91c0f.css");
@import url("/assets/enrich-d68b1767.css");
@import url("/assets/account-58bcda0e.css");
@import url("/assets/actiontext-e646701d.css");

body {
  margin-top: 87px;
}

abbr {
  font-weight: bold;
  color: red;
}

form.simple_form fieldset legend {
  float: unset;
}

fieldset.user_communities legend {
  font-weight: bold;
}

#contents_text_content {
  height: 300px;
  overflow-y: auto;
}

.community_profile_answer_text {
  text-align: justify;
}

#messaging_message_body {
  height: 250px;
  overflow-y: auto;
}

.toggle-permission-button {
  border: 0px;
  background-color: #fff;
}

#contents_comment_body {
  height: 200px;
  overflow-y: auto;
}

#messaging_community_mail_body {
  height: 350px;
  overflow-y: auto;
}

.root-comment:not(:first-child) {
  border-top: 1px solid gray;
  padding-top: 10px;
  width: 90%;
}

#event figcaption {
  display: none;
}

#event #event-body h1 {
  font-size: 1.2em;
  color: #000;
}

.copy-to-clipboard button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

#news-body h1 {
  font-size: 1.2em;
  color: #000;
}

.news-show-body {
  text-align: justify;
  text-justify: inter-word;
}

.egcp-event {
  padding-left: 2px !important;
  white-space: normal !important; /* Allow text to wrap */
  overflow: visible !important; /* Prevent clipping */
  display: block !important; /* Ensure block display */
  word-wrap: break-word; /* Break long words */
  line-height: 1.2; /* Improve readability */
}

.fc-day-disabled {
  display: none;
  pointer-events: none; /* Prevents interaction */
}

.leaflet-sidebar-tabs {
  background-color: #fefefe !important;
}

/* useful for the mapping tool */
.fixed-top {
  z-index: 8888;
}

.modal {
  z-index: 9999;
}

label.hidden {
  display: none;
}

.toast {
  width: 360px;
}

a.dropdown-item {
  text-decoration: none;
}

#inline-message-form {
  margin-top: -15px;
  margin-bottom: 15px;
  .messaging_message_body #messaging_message_body {
    height: 100px;
  }

  .messaging_message_body label {
    display: none;
  }
}

/* Dropzone styles for file uploads */
.dropzone-area {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fafafa;
}

.dropzone-area:hover {
  border-color: #0d6efd;
  background-color: #f0f7ff;
}

.dropzone-area.dropzone-highlight {
  border-color: #0d6efd;
  background-color: #e7f1ff;
  border-style: solid;
}

.dropzone-area .dropzone-icon {
  font-size: 2rem;
  color: #6c757d;
  margin-bottom: 10px;
}

.dropzone-area .dropzone-text {
  color: #6c757d;
  margin-bottom: 5px;
}

.dropzone-area .dropzone-hint {
  font-size: 0.85rem;
  color: #adb5bd;
}

.dropzone-area .dropzone-browse {
  color: #0d6efd;
  text-decoration: underline;
  cursor: pointer;
}

.dropzone-area .dropzone-browse:hover {
  color: #0a58ca;
}

.dropzone-preview {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin-top: 10px;
}

.dropzone-error {
  margin-top: 5px;
}

/* Multi-image uploader styles */
.multi-image-upload-wrapper {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
  background-color: #fafafa;
  min-height: 150px;
}

.multi-image-upload-wrapper:hover {
  border-color: #0d6efd;
  background-color: #f0f7ff;
}

.multi-image-upload-wrapper.dragover {
  border-color: #0d6efd;
  background-color: #e7f1ff;
  border-style: solid;
  transform: scale(1.01);
}

.multi-image-upload-wrapper.has-images {
  padding: 15px;
  background-color: #ffffff;
}

.multi-image-dropzone-content {
  text-align: center;
  padding: 20px;
  cursor: pointer;
}

.multi-image-upload-wrapper.has-images .multi-image-dropzone-content {
  padding: 10px;
  margin-bottom: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px dashed #dee2e6;
}

.multi-image-dropzone-content .dropzone-icon {
  font-size: 3rem;
  color: #6c757d;
  margin-bottom: 15px;
}

.multi-image-upload-wrapper.has-images .multi-image-dropzone-content .dropzone-icon {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.multi-image-dropzone-content .dropzone-text {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.multi-image-upload-wrapper.has-images .multi-image-dropzone-content .dropzone-text {
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.multi-image-dropzone-content .dropzone-hint {
  font-size: 0.9rem;
  color: #adb5bd;
}

.multi-image-upload-wrapper.has-images .multi-image-dropzone-content .dropzone-hint {
  font-size: 0.75rem;
}

.multi-image-dropzone-content .dropzone-browse {
  color: #0d6efd;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.multi-image-dropzone-content .dropzone-browse:hover {
  color: #0a58ca;
}

/* Preview container - grid layout */
.multi-image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.multi-image-upload-wrapper.has-images .multi-image-preview-container {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Individual preview card */
.multi-image-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.multi-image-preview:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.multi-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay with info and remove button */
.preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  padding: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.multi-image-preview:hover .preview-overlay {
  opacity: 1;
}

.preview-info {
  color: white;
  font-size: 0.75rem;
}

.preview-filename {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.preview-size {
  opacity: 0.8;
}

/* Remove button */
.preview-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  color: #dc3545;
  font-size: 1.2rem;
}

.preview-remove-btn:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

.preview-remove-btn i {
  line-height: 1;
}

/* Empty state - hide when container has images */
.multi-image-upload-wrapper:not(.has-images) .multi-image-preview-container:empty::after {
  content: "";
  display: none;
}

/* Existing pictures display */
.existing-pictures .card {
  transition: all 0.2s ease;
  border: 1px solid #dee2e6;
}

.existing-pictures .card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.existing-pictures .card-img-top {
  border-bottom: 1px solid #dee2e6;
}

.existing-pictures .btn-danger {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

/* Marketplace item thumbnails (legacy - used on profile pages) */
.marketplace-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background-color: #f8f9fa;
}

.marketplace-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marketplace-thumbnail-small {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background-color: #f8f9fa;
}

.marketplace-thumbnail-small img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   MARKETPLACE INDEX PAGE
   ============================================= */

/* --- Type colors --- */
:root {
  --mp-product: #2e7d32;
  --mp-product-bg: #e8f5e9;
  --mp-service: #1565c0;
  --mp-service-bg: #e3f2fd;
  --mp-opportunity: #e65100;
  --mp-opportunity-bg: #fff3e0;
  --mp-expertise: #6a1b9a;
  --mp-expertise-bg: #f3e5f5;
  --mp-project: #00838f;
  --mp-project-bg: #e0f7fa;
}

/* --- Hero --- */
.marketplace-hero {
  padding: 1.5rem 0 0.5rem;
}

.marketplace-title {
  font-family: Raleway, sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: #1a1a2e;
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
}

.marketplace-subtitle {
  color: #6e7185;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.marketplace-count {
  display: inline-block;
  background: var(--bs-enrich-bg-subtle);
  color: var(--bs-enrich);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Filters panel --- */
.marketplace-filters-panel {
  background: #fff;
  border: 1px solid #e2e5ed;
  border-radius: 12px;
  overflow: visible;
  position: sticky;
  top: 100px;
}

.marketplace-filters-header {
  background: linear-gradient(135deg, #014996 0%, #0162c8 100%);
  color: #fff;
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.marketplace-filters-reset {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}

.marketplace-filters-reset:hover {
  color: #fff;
  text-decoration: underline;
}

.marketplace-filter-section {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f0f1f5;
}

.marketplace-filter-section:last-of-type {
  border-bottom: none;
}

.marketplace-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e7185;
  margin-bottom: 0.5rem;
}

/* Type groups with collapsible categories */
.mp-type-group {
  border-bottom: 1px solid #f0f1f5;
  transition: background-color 0.2s ease;
}

.mp-type-group:last-child {
  border-bottom: none;
}

.mp-type-group--active {
  background-color: #f8f9fc;
}

.mp-type-group--active.mp-type-group--product { background-color: var(--mp-product-bg); }
.mp-type-group--active.mp-type-group--service { background-color: var(--mp-service-bg); }
.mp-type-group--active.mp-type-group--opportunity { background-color: var(--mp-opportunity-bg); }
.mp-type-group--active.mp-type-group--expertise { background-color: var(--mp-expertise-bg); }
.mp-type-group--active.mp-type-group--project { background-color: var(--mp-project-bg); }

/* --- Toggle switch --- */
.mp-type-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  user-select: none;
}

.mp-type-toggle:hover {
  background-color: #f4f5f9;
}

.mp-type-group--active .mp-type-toggle:hover {
  background-color: transparent;
}

.mp-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mp-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  background: #c8ccd8;
  border-radius: 99px;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.mp-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mp-toggle-input:checked ~ .mp-toggle-track .mp-toggle-thumb {
  transform: translateX(16px);
}

.mp-toggle-input:checked ~ .mp-toggle-track.mp-toggle--product { background: var(--mp-product); }
.mp-toggle-input:checked ~ .mp-toggle-track.mp-toggle--service { background: var(--mp-service); }
.mp-toggle-input:checked ~ .mp-toggle-track.mp-toggle--opportunity { background: var(--mp-opportunity); }
.mp-toggle-input:checked ~ .mp-toggle-track.mp-toggle--expertise { background: var(--mp-expertise); }
.mp-toggle-input:checked ~ .mp-toggle-track.mp-toggle--project { background: var(--mp-project); }

.mp-toggle-input:focus-visible ~ .mp-toggle-track {
  outline: 2px solid var(--bs-enrich);
  outline-offset: 2px;
}

.mp-toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a4e69;
  transition: color 0.2s ease;
}

.mp-toggle-input:checked ~ .mp-toggle-label {
  color: #1a1a2e;
}

/* Nested categories revealed under a checked type */
.mp-type-categories {
  padding: 0.2rem 0.8rem 0.6rem 1.2rem;
  border-left: 3px solid #e2e5ed;
  margin-left: 1.2rem;
  margin-bottom: 0.4rem;
}

.mp-type-group--product .mp-type-categories { border-left-color: var(--mp-product); }
.mp-type-group--service .mp-type-categories { border-left-color: var(--mp-service); }
.mp-type-group--opportunity .mp-type-categories { border-left-color: var(--mp-opportunity); }
.mp-type-group--expertise .mp-type-categories { border-left-color: var(--mp-expertise); }
.mp-type-group--project .mp-type-categories { border-left-color: var(--mp-project); }

.mp-type-category-section {
  margin-bottom: 0.5rem;
}

.mp-type-category-section:last-child {
  margin-bottom: 0;
}

.mp-type-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #898faa;
  margin-bottom: 0.3rem;
}

.marketplace-filter-actions {
  padding: 0.8rem 1rem 1rem;
}

/* --- Item cards --- */
.mp-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8eaef;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 42, 87, 0.12);
}

/* Image area */
.mp-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #f0f2f7;
}

.mp-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.mp-card:hover .mp-card-img {
  transform: scale(1.04);
}

/* Placeholder when no picture */
.mp-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #b0b3c4;
}

.mp-card--product .mp-card-placeholder { background: var(--mp-product-bg); color: var(--mp-product); }
.mp-card--service .mp-card-placeholder { background: var(--mp-service-bg); color: var(--mp-service); }
.mp-card--opportunity .mp-card-placeholder { background: var(--mp-opportunity-bg); color: var(--mp-opportunity); }
.mp-card--expertise .mp-card-placeholder { background: var(--mp-expertise-bg); color: var(--mp-expertise); }
.mp-card--project .mp-card-placeholder { background: var(--mp-project-bg); color: var(--mp-project); }

/* Type badge */
.mp-card-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.mp-type-product { background: var(--mp-product-bg); color: var(--mp-product); }
.mp-type-service { background: var(--mp-service-bg); color: var(--mp-service); }
.mp-type-opportunity { background: var(--mp-opportunity-bg); color: var(--mp-opportunity); }
.mp-type-expertise { background: var(--mp-expertise-bg); color: var(--mp-expertise); }
.mp-type-project { background: var(--mp-project-bg); color: var(--mp-project); }

/* Photo count */
.mp-card-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Card body */
.mp-card-body {
  padding: 0.9rem 1rem 0.5rem;
  flex: 1;
}

.mp-card-title {
  font-family: Raleway, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a2e;
  margin-bottom: 0.3rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-card-desc {
  font-size: 0.78rem;
  color: #6e7185;
  line-height: 1.45;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.mp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
}

.mp-card-tag {
  display: inline-block;
  background: #f0f2f7;
  color: #4a4e69;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-card-tag--more {
  background: #e2e5ed;
  color: #6e7185;
  font-weight: 600;
}

/* Card footer */
.mp-card-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid #f0f2f7;
}

.mp-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mp-card-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e8eaef;
  flex-shrink: 0;
}

.mp-card-author-name {
  font-size: 0.75rem;
  color: #6e7185;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Empty state --- */
.marketplace-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed #d1d5e0;
}

.marketplace-empty-icon {
  font-size: 3rem;
  color: #b0b3c4;
  margin-bottom: 1rem;
}

.marketplace-empty-state h5 {
  color: #2d323e;
  font-family: Raleway, sans-serif;
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .marketplace-filters-panel {
    position: static;
    margin-bottom: 1rem;
  }

  .mp-card-image {
    height: 160px;
  }
}

@media (max-width: 575px) {
  .mp-card-image {
    height: 140px;
  }

  .marketplace-title {
    font-size: 1.3rem;
  }
}

/* --- Turbo Frame loading state --- */
turbo-frame#marketplace-results {
  display: block;
  transition: opacity 0.15s ease;
}

turbo-frame#marketplace-results[busy] {
  opacity: 0.4;
}
