/* =========================================================
   GROUPS PAGE
========================================================= */

.groups-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 32px 60px;
}


/* =========================================================
   PAGE HEADER
========================================================= */

.groups-page .workspace-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.groups-page .workspace-page-header h2 {
  margin: 8px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.groups-page .workspace-page-header p {
  margin: 0;
  color: #98a2b3;
  line-height: 1.6;
}

.groups-page .eyebrow {
  display: inline-block;
  color: #34e7d5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}


/* =========================================================
   BUTTONS
========================================================= */

.groups-page .primary-button,
.groups-page .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 42px;

  border-radius: 12px;

  padding: 10px 16px;

  font: inherit;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.groups-page .primary-button {
  border: 0;
  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #7c4dff,
      #437df5
    );
}

.groups-page .primary-button:hover {
  transform: translateY(-1px);
}

.groups-page .secondary-button {
  color: #d8ddea;

  border:
    1px solid
    rgba(255, 255, 255, 0.12);

  background:
    rgba(255, 255, 255, 0.04);
}

.groups-page .secondary-button:hover {
  border-color:
    rgba(255, 255, 255, 0.22);

  background:
    rgba(255, 255, 255, 0.07);
}

.groups-page button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}


/* =========================================================
   CARDS
========================================================= */

.groups-page .workspace-card {
  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 18px;

  background:
    rgba(16, 21, 36, 0.9);

  padding: 24px;

  margin-bottom: 22px;
}

.groups-page .workspace-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 20px;
}

.groups-page .workspace-card-header h3 {
  margin: 6px 0 0;
  font-size: 19px;
  line-height: 1.3;
}

.groups-page .workspace-card-header strong {
  font-size: 24px;
}

.groups-page .workspace-card-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(280px, 1fr)
    );

  gap: 18px;
}

.groups-page .workspace-card p {
  color: #98a2b3;
  line-height: 1.6;
}


/* =========================================================
   CREATE / EDIT FORMS
========================================================= */

.groups-page form {
  width: 100%;
}

.groups-page .form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-bottom: 18px;
}

.groups-page .form-field label {
  color: #d7dceb;
  font-size: 13px;
  font-weight: 700;
}

.groups-page .form-field input,
.groups-page .form-field textarea {
  width: 100%;
  box-sizing: border-box;

  color: #f5f7ff;

  border:
    1px solid
    rgba(255, 255, 255, 0.12);

  border-radius: 12px;

  background:
    rgba(5, 9, 18, 0.75);

  padding: 12px 14px;

  font: inherit;
  font-size: 14px;

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.groups-page .form-field textarea {
  min-height: 110px;
  resize: vertical;
}

.groups-page .form-field input:focus,
.groups-page .form-field textarea:focus {
  border-color:
    rgba(124, 77, 255, 0.8);

  box-shadow:
    0 0 0 3px
    rgba(124, 77, 255, 0.12);
}

.groups-page .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  margin-top: 20px;
}


/* =========================================================
   CREATE PANEL
========================================================= */

#createGroupPanel {
  max-width: 680px;
  margin-bottom: 28px;
}

#createGroupPanel.hidden {
  display: none;
}


/* =========================================================
   GROUP MEMBER LIST
========================================================= */

.groups-page .workspace-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  min-height: 64px;

  padding: 12px 0;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.07);
}

.groups-page .workspace-list-row:last-child {
  border-bottom: 0;
}

.groups-page .workspace-list-row strong {
  color: #f5f7ff;
  font-size: 14px;
}


/* =========================================================
   FEEDBACK
========================================================= */

.groups-page .workspace-feedback {
  min-height: 0;

  margin-bottom: 16px;

  font-size: 13px;
  font-weight: 600;
}

.groups-page .workspace-feedback:empty {
  display: none;
}

.groups-page .workspace-feedback.success {
  color: #39dfad;
}

.groups-page .workspace-feedback.error {
  color: #ff6b81;
}


/* =========================================================
   EMPTY / LOADING STATE
========================================================= */

.groups-page .workspace-state {
  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 18px;

  background:
    rgba(16, 21, 36, 0.9);

  padding: 48px 30px;

  text-align: center;
}

.groups-page .workspace-state h3 {
  margin: 12px 0 8px;
}

.groups-page .workspace-state p {
  margin: 0;
  color: #98a2b3;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 760px) {

  .groups-page {
    padding:
      24px 18px
      110px;
  }

  .groups-page
  .workspace-page-header {
    flex-direction: column;
  }

  .groups-page
  .workspace-page-header
  > button {
    width: 100%;
  }

  .groups-page
  .workspace-card-grid {
    grid-template-columns: 1fr;
  }

  .groups-page
  .workspace-list-row {
    align-items: flex-start;
  }

}
/* =========================================================
   GROUP ATHLETE IDENTITY
========================================================= */

.group-athlete-identity {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 0;
}

.group-athlete-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 50%;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-blue)
    );

  color: #ffffff;

  font-size: 0.9rem;
  font-weight: 800;

  border:
    1px solid
    rgba(255, 255, 255, 0.12);

  box-shadow:
    0 5px 16px
    rgba(0, 0, 0, 0.18);
}

.group-athlete-avatar img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
  object-position: center;

  border-radius: inherit;
}

.group-athlete-identity > div {
  min-width: 0;
}