/**
 * Profile Photo Styles
 *
 * FRONTEND STYLES ONLY - For the [photo_upload_form] shortcode on public pages
 * Admin styles should be handled separately in the PHP file to ensure proper admin-only loading
 */

/* Root variables for frontend only */
:root {
  --rcp-form-radius: 8px;
}

/* Profile photo card - main container */
.profile-photo-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background-color: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--wp--preset--color--borderline, #dee2e6);
  border-radius: var(--rcp-form-radius, 8px);
  margin-bottom: 2rem;
}

/* Profile photo info section (left side) */
.profile-photo-info {
  flex: 1;
}

/* Profile photo heading */
.profile-photo-info h4 {
  font-family: var(--wp--preset--font-family--headings, inherit);
  font-size: var(--wp--preset--font-size--medium, 16px);
  font-weight: 600;
  color: var(--wp--preset--color--contrast, #333);
  margin: 0 0 0.5rem 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Photo size recommendation text */
.profile-photo-size {
  font-size: var(--wp--preset--font-size--small, 14px);
  color: var(--wp--preset--color--contrast-2, #666);
  margin: 0 0 1.5rem 0;
  font-weight: normal;
}

/* Profile photo container (right side) */
.profile-photo-container {
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--wp--preset--color--base-2, #f0f0f1);
  flex-shrink: 0;
  margin-left: 1.5rem;
}

/* Profile photo image */
.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Button base styles */
.photo-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: var(--wp--preset--font-size--small, 14px);
  font-weight: 500;
  text-align: center;
  border-radius: var(--button-border-radius, 8px);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border: 1px solid;
  min-width: 100px;
  background: none;
  text-decoration: none;
}

/* Change button */
.change-btn {
  color: var(--wp--preset--color--contrast, #333);
  border-color: var(--wp--preset--color--borderline, #dee2e6);
  background-color: var(--wp--preset--color--base, #fff);
}

.change-btn:hover {
  background-color: var(--wp--preset--color--base-2, #f0f0f1);
  text-decoration: none;
}

/* Remove button */
.remove-btn {
  color: var(--wp--preset--color--contrast, #333);
  border-color: var(--wp--preset--color--borderline, #dee2e6);
  background-color: var(--wp--preset--color--base, #fff);
  margin-left: 0.5rem;
}

.remove-btn:hover {
  background-color: var(--wp--preset--color--base-2, #f0f0f1);
}

/* Upload a photo button */
.upload-btn {
  color: var(--wp--preset--color--contrast, #333);
  border-color: var(--wp--preset--color--borderline, #dee2e6);
  background-color: var(--wp--preset--color--base, #fff);
  border-radius: var(--button-border-radius, 8px);
  padding: 0.5rem 1.25rem;
}

.upload-btn:hover {
  background-color: var(--wp--preset--color--base-2, #f0f0f1);
  text-decoration: none;
}

/* File input actions container */
.file-input-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hide the actual file input */
.hidden-file-input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

/* Custom file button */
.custom-file-button {
  display: inline-block;
  color: var(--wp--preset--color--contrast, #333);
  background-color: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--wp--preset--color--borderline, #dee2e6);
  border-radius: var(--button-border-radius, 8px);
  padding: 0.5rem 1rem;
  font-size: var(--wp--preset--font-size--small, 14px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  text-align: center;
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.custom-file-button:hover {
  background-color: var(--wp--preset--color--base-2, #f0f0f1);
}

/* Save Photo button */
.save-photo-btn {
  display: inline-block;
  background-color: var(--wp--preset--color--accent, #007bff);
  color: var(--wp--preset--color--base, #fff);
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: var(--wp--preset--font-size--small, 14px);
  font-weight: 500;
  border-radius: var(--button-border-radius, 8px);
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
  text-align: center;
  min-width: 100px;
}

.save-photo-btn:hover {
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--accent) 90%,
    white
  );
}

/* Photo action buttons container */
.photo-action-buttons {
  display: flex;
}

/* Alert styling based on Tecology alert block */
.alert {
  position: relative;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: var(--wp--preset--font-size--small, 14px);
  text-align: center;
}

/* Success alert styling */
.alert-success {
  background-color: #d1e7dd;
  border-color: #badbcc;
  color: #0f5132;
}

/* Error alert styling */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}

/* Warning alert styling */
.alert-warning {
  background-color: #fff3cd;
  border-color: #ffecb5;
  color: #664d03;
}

/* Alert fade effect */
.alert.fade {
  transition: opacity 0.15s linear;
}

.alert.fade.show {
  opacity: 1;
}

.alert.fade:not(.show) {
  opacity: 0;
}

/* Dark mode support for alerts */
.theme-dark .alert-success {
  background-color: #051b11;
  border-color: #0f5132;
  color: #75b798;
}

.theme-dark .alert-danger {
  background-color: #2c0b0e;
  border-color: #842029;
  color: #ea868f;
}

.theme-dark .alert-warning {
  background-color: #332701;
  border-color: #664d03;
  color: #ffda6a;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .profile-photo-card {
    flex-direction: column-reverse;
    padding: 1rem;
  }

  .profile-photo-container {
    margin-left: 0;
    margin-bottom: 1rem;
  }

  .profile-photo-info {
    width: 100%;
    text-align: center;
  }

  .photo-action-buttons {
    justify-content: center;
  }

  .file-input-actions {
    flex-direction: column;
    width: 100%;
  }

  .custom-file-button,
  .save-photo-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    max-width: none;
  }
}
