/* ======================================================
   1. BASE LAYOUT
   ====================================================== */
.bombo-profiles {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  color: rgba(255, 255, 255, 0.9);
}

.bombo-profiles h3 {
  margin-bottom: 1.5rem;
}

.bombo-profiles .profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ======================================================
   2. PROFILE CARD – NEUTRAALI
   ====================================================== */
.bombo-profiles .profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bombo-profiles .profile-card > * + * {
  margin-top: 4px;
}

.bombo-profiles .profile-card:not(.profile-card--create) {
  align-self: start;
}

/* ======================================================
   3. PROFILE CARD CONTENT
   ====================================================== */
.bombo-profiles .profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Profiililistan avatar-borderit */

.bombo-profiles .profile-avatar-wrap {
  position: relative;
  display: inline-block;
}

.bombo-profiles .profile-card strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.bombo-profiles .profile-age-badges .ikaraja-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  background: #3e3e3e;
}

.bombo-profiles .profile-age-badges .ikaraja-s {
  color: #97d64e;
}

.bombo-profiles .profile-age-badges .ikaraja-k7 {
  color: #ffff00;
}

.bombo-profiles .trophy-summary-inline {
  font-size: 0.8rem;
  opacity: 0.85;
}

.bombo-profiles .profile-card-action {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
  z-index: 9;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bombo-profiles .profile-card-action a {
  text-decoration: none;
  color: var(--kerho-color-link);
}

.bombo-profiles .profile-card-action img {
  font-size: 1.1rem;
  width: 16px;
  height: 16px;
  display: block;
}

/* ======================================================
   4. FORMS (CREATE + EDIT)
   ====================================================== */
.bombo-profiles .profile-create-form,
.bombo-profiles .profile-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bombo-profiles .profile-editor {
  margin-top: 12px;
}

.bombo-profiles .profile-create-form input[type="text"],
.bombo-profiles .profile-create-form select,
.bombo-profiles .profile-editor input[type="text"],
.bombo-profiles .profile-editor select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  color: var(--input-text-color);
  font-size: 0.9rem;
}

.bombo-profiles .profile-create-form input::placeholder {
  color: var(--input-focus-color);
  opacity: 0.9;
}

.bombo-profiles .profile-create-form input[type="text"]:focus,
.bombo-profiles .profile-create-form select:focus,
.bombo-profiles .profile-editor input[type="text"]:focus,
.bombo-profiles .profile-editor select:focus {
  outline: none;
  border-color: var(--kerho-color-border);
  background: rgba(138, 198, 209, 0.1);
  box-shadow: var(--input-focus-shadow);
}

.bombo-profiles .profile-editor label {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ======================================================
   5. BUTTONS & ACTION TYPES
   ====================================================== */
.bombo-profiles .profile-create-form button,
.bombo-profiles .profile-editor button {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  background: var(--primary-blue);
}

.bombo-profiles .profile-create-form button:hover,
.bombo-profiles .profile-editor button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bombo-profiles .profile-editor button[name="bombo_update_profile"] {
  background: var(--primary-blue);
  color: #fff;
  margin-bottom: 3px;
}

.bombo-profiles .profile-editor button[name="bombo_update_profile"]:hover {
  background: var(--kerho-color-link-hover, #3fdc7a);
}

.bombo-profiles .profile-editor a,
.bombo-profiles .profile-card a {
  text-decoration: none;
  font-size: 0.8rem;
  opacity: 0.75;
  color: var(--kerho-color-link);
}

.bombo-profiles .profile-editor a:hover,
.bombo-profiles .profile-card a:hover {
  opacity: 1;
}

.bombo-profiles .profile-delete {
  margin-top: 8px;
}

.bombo-profiles .profile-delete button {
  background: transparent;
  border: 1px solid rgba(255, 100, 100, 0.5);
  color: rgba(255, 100, 100, 0.8);
  font-size: 0.8rem;
}

.bombo-profiles .profile-delete button:hover {
  background: rgba(255, 60, 60, 0.15);
  color: rgba(255, 120, 120, 1);
}

/* ======================================================
   6. CARD VARIANTS
   ====================================================== */
.bombo-profiles .profile-card--create {
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.35);
  opacity: 1;
}

.bombo-profiles .profile-card--create strong {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.3px;
}

.bombo-profiles .profile-card--create .profile-create-form {
  margin-top: 8px;
}

.bombo-profiles .profile-avatar-placeholder {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.bombo-profiles .profile-avatar-placeholder i {
  margin-right: 4px;
}

/* ======================================================
   7. INTERACTION — VIEW MODE
   ====================================================== */
.bombo-profiles .profile-list:not(.editing) .profile-card {
  cursor: pointer;
}

.bombo-profiles .profile-list:not(.editing) .profile-card:not(.profile-card--create):hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.bombo-profiles .profile-list:not(.editing) .profile-card:hover .profile-card-action {
  opacity: 0.7;
}

/* ======================================================
   8. INTERACTION — EDIT MODE
   ====================================================== */
.bombo-profiles .profile-list.editing .profile-card {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.bombo-profiles .profile-list.editing .profile-card.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.bombo-profiles .profile-list.editing .profile-card:hover {
  background: inherit;
  transform: none;
  box-shadow: none;
}

.bombo-profiles .profile-list.editing .profile-card.active .profile-card-action {
  opacity: 0.9;
}

/* ======================================================
   9. AVATAR INTERACTIONS (CARD-LEVEL)
   ====================================================== */
.bombo-profiles .profile-card.active .profile-avatar,
.bombo-profiles .profile-card--create .profile-avatar {
  cursor: pointer;
}

.bombo-profiles .profile-card.active .profile-avatar:hover,
.bombo-profiles .profile-card--create .profile-avatar:hover {
  opacity: 0.9;
}

.bombo-profiles .change-avatar-btn {
  position: absolute;
  bottom: -3px;
  right: 75px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.bombo-profiles .change-avatar-btn img {
  width: 16px;
  height: 16px;
  display: block;
}

/* ======================================================
   10. AVATAR OVERLAY
   ====================================================== */
#avatar-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

#avatar-overlay .overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

#avatar-overlay .overlay-content {
  position: relative;
  max-width: 420px;
  margin: 10vh auto;
  padding: 20px;
  background: #111;
  color: #fff;
  border-radius: 12px;
}

#avatar-overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

#avatar-overlay .avatar-choice {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
}

#avatar-overlay .avatar-choice img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
}


#avatar-overlay .avatar-choice.is-active {
  border-color: #5fb36d;
}

/* ======================================================
   11. NOTICES & COUNTERS
   ====================================================== */
.bombo-profiles .profile-count {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.bombo-profiles .notice {
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
}

.bombo-profiles .notice-success {
  border-color: rgba(100, 255, 150, 0.6);
}

.bombo-profiles .notice-warning {
  border-color: rgba(255, 200, 100, 0.6);
}

/* ======================================================
   12. MISC / EXTERNAL UI
   ====================================================== */
.bombo-profiles .profile-settings {
  border-top: 1px solid var(--kerho-color-border);
}

.bombo-profiles .profile-settings h3 {
  margin: 1.5rem;
}

.bombo-profiles .kerho-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.bombo-profiles .kerho-toggle input {
  display: none;
}

.bombo-profiles .kerho-switch {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  position: relative;
  transition: background 0.25s ease;
}

.bombo-profiles .kerho-switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.bombo-profiles .kerho-toggle input:checked + .kerho-switch {
  background: #5fb36d;
}

.bombo-profiles .kerho-toggle input:checked + .kerho-switch::after {
  transform: translateX(20px);
}

.bombo-profiles .kerho-toggle-text {
  font-size: 0.9rem;
  opacity: 0.9;
}

.bombo-profiles .kerho-toggle input:disabled + .kerho-switch {
  opacity: 0.4;
  cursor: not-allowed;
}

.bombo-profiles .kerho-toggle input:disabled ~ .kerho-toggle-text {
  opacity: 0.5;
}

/* ======================================================
   13. SAFETY OVERRIDES
   ====================================================== */

.bombo-profiles .profile-list.editing .profile-card:not(.active) {
  pointer-events: none;
}

.bombo-profiles .profile-list.editing .profile-card.active {
  pointer-events: auto;
}

.bombo-profiles .profile-card--create:hover {
  transform: none;
  box-shadow: none;
}

.bombo-profiles .profile-card.active .profile-avatar,
.bombo-profiles .profile-card--create .profile-avatar,
.bombo-profiles .change-avatar-btn {
  pointer-events: auto;
}

.bombo-profiles .profile-card a {
  pointer-events: auto;
}
