/*
 * File: public\css\church\team.css
 * Purpose: Defines presentation styles for the team interface.
 */
/* =============================
   HERO SECTION
============================= */
.team-overlay {
  background: var(--hero-overlay); /* consistent ML blue overlay */
}

.team-overlay h1 {
  font-size: 50px;
  font-weight: 700;
}

/* =============================
   TEAM SECTION
============================= */
.team-section {
  width: 100%;
  margin: 0;
  padding: 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  justify-content: center;
  min-height: 100vh;
  border-top: none;
  position: relative;
}

/* vertical divider between team members */
.team-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3.0px;
  background: #282f7f;
  transform: translateX(-50%);
}

/* team member card */
.team-member {
  text-align: center;
  padding: 60px 40px;
  margin: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
}


/* image */
.team-member img {
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 25px;
}

/* titles */
.team-member h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #000;
}

.team-member h4 {
  font-size: 16px;
  font-weight: 600;
  color: #777;
  margin-bottom: 16px;
}

/* bio text section */
.bio-text {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
  flex-grow: 1;

  /* [OK] THIS is what prevents “cut off” and keeps pasted line breaks */
  white-space: pre-wrap;     /* keeps \n line breaks */
  overflow-wrap: anywhere;   /* breaks long words/urls */
  word-break: break-word;
  line-height: 1.6;
  font-size: 16px;
  color: #444;
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 950px) {
  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-grid::after {
    display: none;
  }

  .team-member {
    padding: 40px 20px;
  }

  .team-member img {
    max-width: 350px;
  }

  .team-overlay h1 {
    font-size: 38px;
  }
}
/* =============================
   ADMIN CONTROLS (ONLY WHEN LOGGED IN)
============================= */
.team-admin-bar {
  max-width: 1200px;
  margin: 20px auto 0 auto;
  padding: 0 40px 10px 40px;
  display: flex;
  justify-content: flex-end;
}

.team-admin-add-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  background: #282f7f;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.team-admin-add-btn:hover {
  opacity: 0.9;
}

/* small admin controls overlay inside each card */
.team-admin-controls {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.team-edit-btn,
.team-delete-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.team-edit-btn {
  background: #3498db;
  color: #fff;
}

.team-edit-btn:hover {
  background: #2980b9;
}

.team-delete-btn {
  background: #e74c3c;
  color: #fff;
}

.team-delete-btn:hover {
  background: #c0392b;
}

@media (max-width: 950px) {
  .team-admin-bar {
    padding: 0 20px 10px 20px;
  }
}
/* =============================
   ADMIN BUTTONS & MODAL (MATCH FACULTY)
============================= */

/* wrapper around + button */
.add-btn-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 10px auto;
  display: flex;
  justify-content: center;
}

/* orange round + button, same as faculty */
.add-teacher-btn {
  display: none; /* hidden by default */
}

body.admin-mode .add-teacher-btn {
  display: inline-block;
  background: #ff9f45;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* admin-only toggles */
.admin-only {
  display: none;
}
body.admin-mode .admin-only {
  display: block;
}

/* [OK] Edit button styled like News & Events */
.edit-btn {
  display: inline-block;
  margin-top: 25px;

  background: #1e2a57; /* navy */
  color: white;
  font-size: 15px;
  font-weight: 700;

  padding: 12px 28px;
  border: none;
  border-radius: 10px;

  cursor: pointer;
  text-align: center;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);

  transition: background 0.25s ease, transform 0.2s ease;
}
.edit-btn:hover {
  background: white;         /* white fill */
  color: #1e2a57;            /* navy text */
  border: 2px solid #1e2a57; /* navy outline */

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}


/* =============================
   MODAL STYLES (COPIED FROM FACULTY, RENAMED)
============================= */

.team-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.team-modal.open {
  display: flex;
}

.team-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 28px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.25);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-title {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 800;
  color: #000000;
  text-align: left;
}

.modal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Image side */
.modal-image-section {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.modal-image-section img {
  width: 220px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 14px;
}

/* Reuse upload-label but full width here */
.upload-label input[type="file"] {
  display: none;
}

.modal-upload-label {
  width: 220px !important;
  background: #1e2a57;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  color: white;
  font-weight: 700;
}

/* Form side */
.modal-form-section {
  flex: 1 1 50%;
  text-align: left;
}

.modal-label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  color: #000000;
}

.modal-label input {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccd3e4;
  font-family: 'Open Sans', sans-serif;
}

/* Actions */
.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Reuse save/delete-btn but width auto in modal */
.modal-actions .save-btn,
.modal-actions .delete-btn {
  width: auto;
  min-width: 110px;
}

/* Buttons themselves (copied) */
.save-btn,
.delete-btn {
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

.save-btn { background: #4279bc; }
.delete-btn { background: #b30000; }
.delete-btn:hover { background: #d00000; }

/* Mobile modal tweaks */
@media (max-width: 600px) {
  .team-modal-content {
    padding: 20px;
  }

  .modal-body {
    flex-direction: column;
    align-items: center;
  }

  .modal-image-section,
  .modal-form-section {
    flex: 1 1 100%;
  }

  .modal-title {
    text-align: center;
  }
}
