/* css/avatar-modal.css — shared by index.html and Test20251218Z/student-dashboard.html */

.avatar-picker-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}
.avatar-picker-overlay.is-open { display: flex; }

.avatar-picker-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border: 3px solid #228B22;
  overflow: hidden;
}

.avatar-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #DAA520, #F4D03F);
  color: #2C1810;
  font-family: 'Fredoka', sans-serif;
  flex-shrink: 0;
}
.avatar-picker-header h2 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.avatar-picker-close {
  background: rgba(255, 255, 255, 0.5);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #2C1810;
}
.avatar-picker-close:hover { background: rgba(255, 255, 255, 0.85); }
.avatar-picker-close:focus-visible { outline: 3px solid #228B22; outline-offset: 2px; }

.avatar-picker-body { padding: 16px 20px; overflow-y: auto; }

.avatar-search {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #c8f7c8;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.avatar-search:focus { outline: none; border-color: #228B22; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.avatar-opt {
  position: relative;
  width: 64px; height: 64px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f8f8f8;
  font-size: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  padding: 0;
  font-family: inherit;
}
.avatar-opt:hover:not([disabled]) { transform: scale(1.05); background: #FDF5EC; }
.avatar-opt[aria-pressed="true"] {
  border: 3px solid #228B22;
  background: #E8F5E9;
}
.avatar-opt[data-locked="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.avatar-opt[data-locked="true"]::after {
  content: '🔒';
  position: absolute;
  bottom: 2px; right: 2px;
  font-size: 14px;
}
.avatar-opt:focus-visible { outline: 3px solid #DAA520; outline-offset: 2px; }

/* Tooltip on hover showing animal name */
.avatar-opt[data-name]:hover::before,
.avatar-opt[data-name]:focus-visible::before {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2C1810;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
}

.avatar-empty {
  text-align: center;
  padding: 24px;
  color: #5D4037;
  font-family: 'Quicksand', sans-serif;
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .avatar-picker-modal { max-height: 95vh; }
  .avatar-opt { width: 56px; height: 56px; font-size: 28px; }
}
