/* Users Domain Styles */

/* Expired Join Page - Simple Layout */
.expired-join-page {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 42rem !important;
  margin-inline: auto;
}

.expired-join-page .page-title {
  margin-block-end: 0;
}

.expired-main-message {
  font-size: var(--text-lg);
  color: var(--text);
  font-weight: 500;
  line-height: 1.6;
  margin-top: var(--space-md);
}


/* Profile Photo Placeholder - matches player style */
.profile-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--valid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Error Messages - matches app styles */
.error-messages {
  background: color-mix(in oklch, var(--required) 10%, transparent);
  border: 1px solid var(--required);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  color: var(--required);
}

.error-messages h5 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-md);
  font-weight: 600;
}

.error-messages ul {
  margin: 0;
  padding-left: var(--space-lg);
  list-style: disc;
}

.error-messages li {
  margin: var(--space-xs) 0;
}

/* Help text */
.help-text {
  font-size: var(--font-sm);
  color: var(--text-light);
  margin-top: var(--space-xs);
}

/* Photo upload controller wrapper - transparent container */
[data-controller~="photo-upload"] {
  display: contents;
}

/* Profile Photo Section - Centered */
.profile-photo-section {
  position: relative;
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: fit-content;
}

/* Reduce top margin when inside modal */
.modal-content .profile-photo-section {
  margin-top: 0;
}

/* Make turbo-frame transparent to layout inside photo section */
.profile-photo-section turbo-frame {
  display: contents;
}

/* Photo Upload Form */
.photo-upload-form {
  display: contents;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.profile-photo-section .form-field-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: block;
  margin: 0;
  padding: 0;
}

.camera-icon-clickable {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: opacity var(--transition-standard), transform var(--transition-standard);
  flex-shrink: 0;
}

@media (any-hover: hover) {

  .camera-icon-clickable:hover,
  .camera-icon-clickable:focus-visible {
    outline: var(--btn-outline-width) solid var(--border);
  }
}

.camera-icon-clickable:active {
  outline: none;
}

.camera-icon-clickable .form-field-icon {
  margin: 0;
  padding: 0;
  color: var(--text-lighter);
  fill: var(--text-lighter);
  width: var(--icon-md);
  height: var(--icon-md);
  display: block;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: baseline;
}

/* Photo Remove Button - matches camera icon size */
.btn-photo-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--invalid);
  transition: opacity var(--transition-standard), transform var(--transition-standard);
  flex-shrink: 0;
}

.btn-photo-remove .icon {
  color: inherit;
  width: 48px;
  height: 48px;
}

@media (any-hover: hover) {

  .btn-photo-remove:hover,
  .btn-photo-remove:focus-visible {
    color: color-mix(in oklch, var(--invalid), white 10%);
  }

  .btn-photo-remove:hover .icon,
  .btn-photo-remove:focus-visible .icon {
    color: inherit;
  }
}

.btn-photo-remove:active {
  color: var(--invalid);
  transition-duration: 0.05s;
}

.profile-photo-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.profile-photo-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}

@media (any-hover: hover) {

  .profile-photo-container:hover,
  .profile-photo-container:focus-visible {
    outline: var(--btn-outline-width) solid var(--border);
  }
}

.profile-photo-container:active {
  outline: none;
}



.profile-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: block;
}

.profile-photo-placeholder-centered {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--valid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: opacity var(--transition-standard), transform var(--transition-standard);
}

.profile-photo-upload-button {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition-standard), transform var(--transition-standard);
  padding: 0;
}

@media (any-hover: hover) {

  .profile-photo-upload-button:hover,
  .profile-photo-upload-button:focus-visible {
    outline: var(--btn-outline-width) solid var(--border);
  }
}

.profile-photo-upload-button:active {
  outline: none;
}

.profile-photo-upload-button .upload-icon {
  width: 58px;
  height: 58px;
  color: var(--text-lighter);
  fill: var(--text-lighter);
  display: block;
  margin: 0;
}

/* Photo loading state */
.profile-photo-loader {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1;
}

.profile-photo-loader .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.photo-upload-overlay-centered {
  display: none;
}

.camera-icon {
  width: 24px;
  height: 24px;
  color: white;
  fill: currentColor;
}


/* Form field wrappers with icons */
.form-field-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.form-field-icon {
  flex-shrink: 0;
  width: var(--icon-md);
  height: var(--icon-md);
  color: var(--text-lighter);
  margin-left: var(--space-xs);
}

.form-field-wrapper .form-input {
  flex: 1;
  font-size: var(--text-base);
  padding: var(--space-sm) var(--space-md);
}

/* Profile page: inputs should be xl */
.users-show .form-field .form-input[type="text"],
.users-show .form-field .form-input[type="email"],
.users-show .form-field .form-input[type="password"] {
  font-size: var(--text-xl);
}

/* Password section styling */
.form-field .password-section-wrapper {
  width: 100%;
}

/* Password section with static icon */
.password-section-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.password-fields-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.users-show .password-fields-container .form-input,
.users-new .password-fields-container .form-input,
.passwords-edit .password-fields-container .form-input {
  font-size: var(--text-xl);
  padding: var(--space-sm) var(--space-md);
}

.password-field {
  font-size: var(--text-xl);
  padding: var(--space-sm) var(--space-md);
}

/* Form actions styles moved to components/_forms.css */


/* Removed duplicate .profile-photo rule - consolidated above */

.contact-details {
  text-align: center;
  width: 100%;
}

.contact-item {
  margin-bottom: var(--space-md);
}

.contact-item dl {
  margin: 0;
}

.contact-label,
dt.contact-label {
  font-size: var(--text-sm);
  color: var(--text-lighter);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
}

.contact-value,
dd.contact-value {
  font-size: var(--text-base);
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

/* Sign Out Section */
.sign-out-btn {
  width: 100%;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* User Profile Actions - Update and Logout buttons on same line */
.user-profile-actions-wrapper {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
  margin-top: var(--space-xl);
}

.user-profile-update-btn {
  flex: 1;
  margin: 0;
}

.user-profile-update-btn .btn {
  width: 100%;
  min-height: 48px;
  font-size: var(--text-base);
}

/* button_to creates a form wrapper - make it flex to match height */
.user-profile-actions-wrapper>form {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.user-profile-actions-wrapper>form .btn {
  min-height: 48px;
  font-size: var(--text-base);
}

/* Tier badge styles moved to badges.css */

/* Additional users styles from main.css */


/* Profile Edit Page Styles */
.profile-form {
  width: 100%;
}


.current-photo-section {
  margin: 25px 0;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 15px;
  border: 1px solid var(--border);
}

.current-photo-container {
  margin-top: 15px;
}

.current-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
}

.current-photo-caption {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0;
  font-style: italic;
}

.file-input {
  border: 2px dashed var(--border) !important;
  background: transparent !important;
  cursor: pointer;
  transition: opacity var(--transition-standard), transform var(--transition-standard);
}

.file-input:hover {
  border-color: var(--accent) !important;
  background: transparent !important;
}

.file-input:focus {
  border-color: var(--accent) !important;
  background: transparent !important;
}

.security-info {
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}

.security-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition-standard), transform var(--transition-standard);
}

.security-link:hover {
  text-decoration: underline;
}

/* Organization Form Styles */
.organization-form .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.current-file {
  margin-top: 8px;
  padding: 8px 12px;
  background: oklch(var(--lch-accent) / 0.1);
  border-radius: 8px;
  border: 1px solid oklch(var(--lch-accent) / 0.3);
}

.current-file small {
  color: var(--accent);
  font-size: 12px;
}

.add-icon {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
  line-height: 1;
}

/* Data Table Styles */
.table-container {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.work-rate-badge.large {
  padding: 8px 16px;
  font-size: 1.1em;
  font-weight: 700;
}

.alert-content {
  gap: 8px;
}

/* High DPI / Retina Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  .profile-photo,
  .user-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Focus styles for better accessibility */
@media (prefers-reduced-motion: no-preference) {
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
}

.auth-link {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.link-accent {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition-standard), transform var(--transition-standard);
}

.link-accent:hover {
  text-decoration: underline;
}

/* Landscape Mobile Optimizations */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .nav-header {
    padding: 10px 0 5px;
  }
}

/* User Action Buttons - Sign Out */
.user-action-buttons {
  text-align: center;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}
