/**
 * style.css
 * Front Profile Builder — Clean, modern, mobile-first CSS
 *
 * Purpose:
 *  - Defines styling for profile display, edit page, and crop modal
 *  - Aligns with modern WordPress & web design UX standards
 *  - Readable, maintainable, and handoff-ready for future developers
 *
 * Notes:
 *  - Uses neutral palette with accessible contrast
 *  - Mobile-first layout scaling
 *  - Crop modal fully viewport-contained and responsive
 */

/* ----------------------------------------------------------
   1. BASE PROFILE DISPLAY
---------------------------------------------------------- */
.fpb-profile {
  max-width: 980px;
  margin: 20px auto;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
}

/* cover section */
.fpb-cover {
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.fpb-cover-empty {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fpb-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fpb-cover-text {
  color: #777;
  font-size: 18px;
  font-weight: 600;
  opacity: 0.9;
}

/* edit cover icon */
.fpb-edit-cover {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #fff;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.2s;
}
.fpb-edit-cover:hover {
  background: #f7f7f7;
}

/* avatar and header area */
.fpb-header {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
}
.fpb-avatar-wrap {
  position: relative;
}
.fpb-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.fpb-edit-avatar {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: #fff;
  border: 0;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.2s;
}
.fpb-edit-avatar:hover {
  background: #f7f7f7;
}

/* meta section */
.fpb-meta {
  flex: 1;
}
.fpb-display-name {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}
.fpb-stats a {
  display: inline-block;
  margin-right: 12px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
}
.fpb-stats a span {
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.fpb-stats a:hover span {
  background: #f5f5f5;
}

/* actions (edit / logout) */
.fpb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fpb-actions .fpb-edit-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  background: #0073aa;
  color: #fff;
  text-decoration: none;
  transition: background 0.25s;
}
.fpb-actions .fpb-edit-btn:hover {
  background: #005f86;
}
.fpb-actions .fpb-logout {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  background: #eee;
  color: #333;
  text-decoration: none;
}

/* content body */
.fpb-body {
  padding: 12px 16px;
  background: #fff;
}
.fpb-section {
  margin-bottom: 12px;
}
.fpb-form-msg {
  margin-top: 8px;
  color: green;
  font-size: 14px;
}
.fpb-file-input {
  display: none;
}

/* ----------------------------------------------------------
   2. EDIT PAGE
---------------------------------------------------------- */
.fpb-edit-page {
  max-width: 760px;
  margin: 20px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  overflow: hidden;
}
.fpb-edit-page h2 {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid #eee;
  font-size: 18px;
}
.fpb-edit-page form {
  padding: 16px;
}
.fpb-edit-page form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}
.fpb-edit-page form input[type="text"],
.fpb-edit-page form input[type="file"],
.fpb-edit-page form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.fpb-edit-page form textarea {
  min-height: 120px;
  resize: vertical;
}
.fpb-save {
  background: #0073aa;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.25s;
}
.fpb-save:hover {
  background: #005f86;
}

/* cover + avatar layout in edit mode */
.fpb-cover-edit-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.fpb-cover-edit {
  flex: 1;
  min-height: 120px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  position: relative;
  border: 1px solid #e6e6e6;
  padding: 8px;
}
.fpb-avatar-edit .fpb-avatar {
  width: 96px;
  height: 96px;
  border-width: 3px;
}

/* responsive edit page */
@media (max-width: 700px) {
  .fpb-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .fpb-avatar {
    width: 96px;
    height: 96px;
  }
  .fpb-edit-page form {
    padding: 14px;
  }
  .fpb-cover-edit-wrap {
    flex-direction: column;
  }
}

/* ----------------------------------------------------------
   3. CROP MODAL
   Modern, accessible, and responsive cropping UI
---------------------------------------------------------- */

/* modal backdrop */
#fpb-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  padding: 12px;
}

/* modal container */
#fpb-crop-modal .fpb-crop-inner {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0,0,0,0.25);
}

/* modal body: image left, info right */
#fpb-crop-modal .fpb-crop-body {
  display: flex;
  gap: 12px;
  padding: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* image section */
#fpb-crop-modal .fpb-crop-left {
  flex: 1 1 65%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fafafa;
  padding: 8px;
}
#fpb-crop-modal .fpb-crop-left img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 100%;
  margin: 0 auto;
}

/* info / instructions */
#fpb-crop-modal .fpb-crop-right {
  flex: 0 0 240px;
  max-width: 240px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: #333;
  font-size: 14px;
}
#fpb-crop-modal .fpb-crop-info strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

/* footer (actions only, single set) */
#fpb-crop-modal .fpb-crop-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 12px;
  background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* action buttons */
#fpb-crop-modal .fpb-crop-actions button {
  min-width: 120px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}
#fpb-crop-accept {
  background: #0073aa;
  color: #fff;
}
#fpb-crop-accept:hover {
  background: #005f86;
}
#fpb-crop-cancel {
  background: #e2e2e2;
  color: #333;
}
#fpb-crop-cancel:hover {
  background: #ccc;
}

/* ----------------------------------------------------------
   4. RESPONSIVE CROPPING UX (mobile-first)
---------------------------------------------------------- */

/* mobile & short viewports */
@media (max-width: 880px), (max-height: 700px) {
  #fpb-crop-modal .fpb-crop-body {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }

  #fpb-crop-modal .fpb-crop-left {
    flex: 1 1 auto;
    width: 100%;
    padding: 6px;
  }

  #fpb-crop-modal .fpb-crop-right {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 8px;
  }

  /* increase visible image area for mobile */
  #fpb-crop-modal .fpb-crop-left img {
    max-height: calc(70vh - 120px);
  }

  /* footer stays visible & full-width */
  #fpb-crop-modal .fpb-crop-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  #fpb-crop-modal .fpb-crop-actions button {
    flex: 1 1 48%;
    min-width: 0;
    font-size: 14px;
  }
}

/* extra small devices polish */
@media (max-width: 480px) {
  #fpb-crop-modal .fpb-crop-footer {
    padding-left: 10px;
    padding-right: 10px;
  }
  #fpb-crop-modal .fpb-crop-actions button {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* ----------------------------------------------------------
   5. UTILITY CLASSES (developer-friendly)
---------------------------------------------------------- */
.hidden {
  display: none !important;
}
.text-center {
  text-align: center !important;
}
