/* 09-modals.css — Post modal, field errors, global button spinner, manage/edit modal,
   plus the original profile header basics.
   Part of the old css/styles.css (lines 1771–2008); unused rules since removed.
   The number is the load order: later files override earlier ones, exactly
   as later lines in the single file used to. Keep them linked in order. */

/* ── Post Modal ── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 540px) {
  .modal { align-items: center; padding: 20px; }
}
.modal.active { display: flex; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.5rem; border: 1px solid #ddd;
  border-radius: 8px; font-size: 0.9rem; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* Price + currency row — !important overrides .form-group width:100% */
.price-currency-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.price-currency-row input[type="number"] { flex: 1; min-width: 0; width: auto !important; }
.price-currency-row select { width: 96px !important; min-width: 96px; flex-shrink: 0; padding-right: 4px; }
/* mkFieldError() inserts the error span as a sibling inside whichever
   element is the field's parentNode — for every OTHER field that's a
   normal block-flow .pg-field div, so an unstyled span just drops to its
   own line beneath the input. Price/currency share this flex ROW as their
   parent instead, so without this the error span became a THIRD flex
   item and squeezed/wrapped the row rather than sitting below it. */
.price-currency-row .mk-field-err { flex-basis: 100%; order: 3; }

/* Inline field validation errors (validation.js) — was entirely unstyled
   everywhere in the app, not just this field; the currency row is just
   where the missing layout handling made it visibly break rather than
   merely look plain. */
.mk-field-err { display: block; color: #e74c3c; font-size: 12px; margin-top: 4px; }
.mk-input-error { border-color: #e74c3c !important; }

.req { color: #e74c3c; font-size: 12px; }
.condition-hint { font-size: 11px; color: #7f8c8d; margin-top: 4px; min-height: 16px; font-style: italic; }
select:disabled { background: #f8f9fa; color: #adb5bd; cursor: not-allowed; }
.btn {
  flex: 1; padding: 0.7rem; border: none; border-radius: 8px;
  font-weight: 600; cursor: pointer; transition: background 0.2s ease;
  font-family: inherit; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn:active:not(:disabled) { opacity: 0.88; }
.btn-primary { background: #19378C; color: white; }
.btn-primary:hover:not(:disabled) { background: #0f2460; }
.btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #ddd; }
.btn-secondary:hover:not(:disabled) { background: #e0e0e0; }

/* Global button spinner - used by LayoutManager.btnLoading() everywhere */
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpinAnim 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn-secondary .btn-spinner,
.manage-btn-danger .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: currentColor;
}
@keyframes btnSpinAnim { to { transform: rotate(360deg); } }

/* ── Manage / Edit Modal — now uses shared .modal + .modal-content styles ── */
/* Status badge used inside the manage modal header */
.manage-status-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.manage-status-badge.available { background: #e8f9e5; color: #2d7a2d; }
.manage-status-badge.sold      { background: #ffe6e6; color: #d63447; }

/* manage-btn base + variants used in the Edit Post modal */
.manage-btn-danger    { background: #fff0f0; color: #d63447; border: 1px solid #ffcdd2; }
.manage-btn-danger:hover    { background: #d63447; color: #fff; border-color: #d63447; }

/* ── Plastay ── */
#plastay {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Profile ── */
.profile-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.settings-icon    { cursor: pointer; padding: 0.5rem; border-radius: 50%; background: #f5f5f5; transition: 0.2s; }
.settings-icon:hover { background: #e0e0e0; }
.profile-avatar   { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; display: block; }
.profile-name     { text-align: center; font-weight: 600; font-size: 1.1rem; margin-bottom: 0.3rem; }
.profile-email    { text-align: center; color: #666; font-size: 0.9rem; margin-bottom: 2rem; }
.profile-menu     { margin-bottom: 2rem; }
.profile-menu-item { background: #fff; border-radius: 10px; padding: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: background 0.2s ease; }
.profile-menu-item:hover { background: #f8f9fa; }
.profile-menu-item-left   { display: flex; align-items: center; gap: 0.8rem; }
.profile-menu-item-icon   { width: 40px; height: 40px; background: #eef1f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #19378C; }
.profile-menu-item-details h4 { font-size: 0.9rem; margin-bottom: 0.2rem; }
.profile-menu-item-details p  { font-size: 0.75rem; color: #666; }
