/* Personal Account and Search Styles */

.egrp-header-actions {
  display: flex;
  align-items: center;
  gap: var(--egrp-space-xs);
}

.egrp-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--egrp-line-strong);
  background: var(--egrp-paper-raised);
  color: var(--egrp-graphite);
  cursor: pointer;
  transition: all var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-search-btn:hover {
  background: var(--egrp-plum);
  color: var(--egrp-paper-raised);
  border-color: var(--egrp-plum);
}

.egrp-header-auth {
  display: flex;
  align-items: center;
  gap: var(--egrp-space-2xs);
}

.egrp-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: transform var(--egrp-motion-fast) var(--egrp-ease), filter var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-auth-btn:hover {
  transform: scale(1.08);
}

.egrp-auth-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.egrp-user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--egrp-plum);
  cursor: pointer;
  overflow: hidden;
  background: var(--egrp-paper-sunken);
  transition: all var(--egrp-motion-fast) var(--egrp-ease);
  padding: 0;
}

.egrp-user-avatar-btn:hover {
  transform: scale(1.08);
  border-color: var(--egrp-plum-bright);
}

.egrp-user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modals */
.egrp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 32, 31, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--egrp-space-s);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--egrp-motion-mid) var(--egrp-ease), visibility var(--egrp-motion-mid) var(--egrp-ease);
}

.egrp-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.egrp-modal-box {
  background: var(--egrp-paper-raised);
  border: 1px solid var(--egrp-line-strong);
  border-radius: var(--egrp-radius-l);
  box-shadow: var(--egrp-shadow-mid);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--egrp-motion-mid) var(--egrp-ease);
  padding: var(--egrp-space-m);
}

.egrp-modal-overlay.active .egrp-modal-box {
  transform: scale(1);
}

.egrp-modal-close {
  position: absolute;
  top: var(--egrp-space-s);
  right: var(--egrp-space-s);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--egrp-line);
  background: var(--egrp-paper);
  display: grid;
  place-items: center;
  font-size: var(--egrp-step-1);
  color: var(--egrp-graphite-faint);
  cursor: pointer;
  transition: all var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-modal-close:hover {
  background: var(--egrp-plum);
  color: var(--egrp-paper-raised);
  border-color: var(--egrp-plum);
}

.egrp-modal-title {
  font-size: var(--egrp-step-2);
  color: var(--egrp-plum);
  margin-block-end: var(--egrp-space-m);
  letter-spacing: -0.02em;
}

/* Forms */
.egrp-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--egrp-space-s);
}

.egrp-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--egrp-space-3xs);
}

.egrp-form-label {
  font-size: var(--egrp-step--1);
  font-weight: 600;
  color: var(--egrp-graphite);
}

.egrp-form-input,
.egrp-form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--egrp-radius-s);
  border: 1px solid var(--egrp-line-strong);
  background: var(--egrp-paper);
  color: var(--egrp-graphite);
  font-size: var(--egrp-step-0);
  transition: border-color var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.egrp-form-input:focus,
.egrp-form-textarea:focus {
  outline: none;
  border-color: var(--egrp-plum);
}

.egrp-file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: var(--egrp-space-s);
}

.egrp-file-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px dashed var(--egrp-line-strong);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--egrp-paper);
  flex-shrink: 0;
}

.egrp-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.egrp-file-input-btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.egrp-file-input-btn input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Profile Display */
.egrp-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--egrp-space-m);
  text-align: center;
}

.egrp-profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--egrp-plum);
  overflow: hidden;
  background: var(--egrp-paper-sunken);
  box-shadow: var(--egrp-shadow-low);
}

.egrp-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.egrp-profile-name {
  font-size: var(--egrp-step-2);
  font-weight: 700;
  color: var(--egrp-graphite);
}

.egrp-profile-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--egrp-space-xs);
  text-align: left;
  border-block-start: 1px solid var(--egrp-line);
  padding-block-start: var(--egrp-space-m);
}

.egrp-profile-item {
  display: flex;
  flex-direction: column;
}

.egrp-profile-label {
  font-size: var(--egrp-step--1);
  color: var(--egrp-graphite-faint);
  font-weight: 600;
}

.egrp-profile-val {
  font-size: var(--egrp-step-0);
  color: var(--egrp-graphite);
}

.egrp-profile-actions {
  display: flex;
  gap: var(--egrp-space-s);
  width: 100%;
  margin-block-start: var(--egrp-space-s);
}

.egrp-profile-actions button {
  flex: 1;
}

/* Modal Footer link */
.egrp-auth-footer {
  margin-block-start: var(--egrp-space-s);
  font-size: var(--egrp-step--1);
  text-align: center;
  color: var(--egrp-graphite-faint);
}

.egrp-auth-footer button {
  color: var(--egrp-plum);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
}

.egrp-auth-footer button:hover {
  color: var(--egrp-plum-bright);
}

/* Search Modal */
.egrp-search-modal-box {
  max-width: 600px;
}

.egrp-search-header {
  position: relative;
  margin-block-end: var(--egrp-space-s);
}

.egrp-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.egrp-search-input-wrapper svg {
  position: absolute;
  left: 14px;
  color: var(--egrp-graphite-faint);
  pointer-events: none;
}

.egrp-search-field {
  width: 100%;
  height: 52px;
  padding-left: 44px;
  padding-right: 14px;
  border: 2px solid var(--egrp-line-strong);
  border-radius: var(--egrp-radius-m);
  background: var(--egrp-paper);
  color: var(--egrp-graphite);
  font-size: var(--egrp-step-0);
  font-weight: 500;
  transition: all var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-search-field:focus {
  outline: none;
  border-color: var(--egrp-plum);
  background: var(--egrp-paper-raised);
  box-shadow: 0 0 0 4px var(--egrp-plum-tint);
}

.egrp-search-results {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--egrp-space-2xs);
  margin-block-start: var(--egrp-space-s);
}

.egrp-search-item {
  display: block;
  padding: var(--egrp-space-s);
  background: var(--egrp-paper-raised);
  border: 1px solid var(--egrp-line);
  border-radius: var(--egrp-radius-s);
  text-decoration: none;
  transition: all var(--egrp-motion-fast) var(--egrp-ease);
}

.egrp-search-item:hover {
  border-color: var(--egrp-plum);
  background: var(--egrp-plum-tint);
  transform: translateY(-1px);
}

.egrp-search-item-title {
  font-weight: 700;
  font-size: var(--egrp-step-0);
  color: var(--egrp-plum);
  margin-block-end: 4px;
}

.egrp-search-item-desc {
  font-size: var(--egrp-step--1);
  color: var(--egrp-graphite-soft);
  line-height: 1.4;
}

.egrp-search-empty {
  text-align: center;
  padding: var(--egrp-space-l);
  color: var(--egrp-graphite-faint);
  font-size: var(--egrp-step-0);
}

.egrp-search-empty strong {
  color: var(--egrp-plum);
}

/* Mobile responsive fixes */
@media (max-width: 48rem) {
  .egrp-masthead__bar {
    gap: var(--egrp-space-2xs);
  }
  .egrp-header-actions {
    margin-left: auto;
  }
}
