/**
 * Profile Page Modern Styles - Portal do Cliente RP Info
 * Design System Compliant
 */

/* Profile Page Container */
.profile-page-container {
  padding: var(--space-lg, 24px);
  max-width: 900px;
  margin: 0 auto;
}

.profile-page-header {
  margin-bottom: var(--space-xl, 32px);
}

.profile-page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
}

.profile-page-title i {
  color: var(--azul-primario, #1e40af);
  font-size: 32px;
}

.profile-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  margin-top: var(--space-sm, 8px);
  font-size: 14px;
}

.profile-breadcrumb a {
  color: var(--text-muted, #64748b);
  text-decoration: none;
  transition: color 0.2s ease;
}

.profile-breadcrumb a:hover {
  color: var(--azul-primario, #1e40af);
}

.profile-breadcrumb span {
  color: var(--text-muted, #64748b);
}

.profile-breadcrumb .breadcrumb-current {
  color: var(--text-primary, #1e293b);
  font-weight: 500;
}

/* Profile Card */
.profile-card-modern {
  background: var(--bg-card, #ffffff);
  border-radius: var(--radius-xl, 20px);
  box-shadow: var(--shadow-md, 0 4px 24px rgba(0, 0, 0, 0.06));
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  transition: var(--transition-smooth, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.profile-card-modern:hover {
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.12));
  transform: translateY(-2px);
}

/* Profile Header with Gradient */
.profile-header-gradient {
  background: var(--gradient-primary, linear-gradient(135deg, #1e40af, #3b82f6));
  padding: var(--space-2xl, 48px) var(--space-lg, 24px) var(--space-3xl, 60px);
  position: relative;
  text-align: center;
}

.profile-header-gradient::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg-card, #ffffff);
  border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
}

/* Avatar Section */
.profile-avatar-wrapper {
  position: relative;
  z-index: 10;
  margin-top: -70px;
  display: flex;
  justify-content: center;
}

.profile-avatar-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.profile-avatar-container:hover {
  transform: scale(1.05);
}

.profile-avatar-container:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--bg-card, #ffffff);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.12));
  background: var(--bg-card, #ffffff);
}

/* Avatar com iniciais */
.profile-avatar.ds-avatar-initials,
.profile-avatar.ds-avatar-with-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-avatar .ds-avatar-initials-text {
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
  z-index: 1;
}

.profile-avatar.ds-avatar-with-fallback .ds-avatar-initials-text {
  position: absolute;
  z-index: 0;
}

.profile-avatar.ds-avatar-with-fallback .ds-avatar-image {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(30, 64, 175, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.profile-avatar-overlay i {
  color: #ffffff;
  font-size: 28px;
  margin-bottom: 4px;
}

.profile-avatar-overlay span {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

/* Profile Body */
.profile-body {
  padding: var(--space-md, 16px) var(--space-xl, 32px) var(--space-xl, 32px);
  text-align: center;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: var(--space-md, 16px) 0 var(--space-xs, 4px);
  cursor: pointer;
  transition: color 0.2s ease;
}

.profile-name:hover {
  color: var(--azul-primario, #1e40af);
}

.profile-companies {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, 4px);
  margin-bottom: var(--space-lg, 24px);
}

.profile-company-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm, 8px);
  padding: 6px 16px;
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.08),
    rgba(59, 130, 246, 0.08)
  );
  color: var(--azul-primario, #1e40af);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 auto;
}

.profile-company-badge.inactive {
  background: linear-gradient(
    135deg,
    rgba(100, 116, 139, 0.08),
    rgba(148, 163, 184, 0.08)
  );
  color: var(--text-muted, #64748b);
}

.profile-company-badge i {
  font-size: 14px;
}

/* Info Section */
.profile-info-section {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: var(--space-lg, 24px);
  margin-top: var(--space-lg, 24px);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg, 24px);
}

@media (max-width: 576px) {
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
}

.profile-info-item {
  text-align: left;
  padding: var(--space-md, 16px);
  background: var(--bg-secondary, #f1f5f9);
  border-radius: var(--radius-md, 12px);
  transition: var(--transition-smooth, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.profile-info-item:hover {
  background: var(--bg-hover, #f1f5f9);
  transform: translateY(-2px);
}

.profile-info-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
  margin-bottom: var(--space-xs, 4px);
}

.profile-info-label i {
  font-size: 16px;
  color: var(--azul-claro, #3b82f6);
}

.profile-info-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
  word-break: break-word;
}

.profile-info-value a {
  color: var(--azul-primario, #1e40af);
  text-decoration: none;
  transition: color 0.2s ease;
}

.profile-info-value a:hover {
  color: var(--azul-claro, #3b82f6);
  text-decoration: underline;
}

.profile-email-toggle {
  cursor: pointer;
  border-bottom: 1px dashed var(--azul-primario, #1e40af);
}

/* Modal Styles */
.modal_image .modal-content {
  border-radius: var(--radius-xl, 20px);
  border: none;
  overflow: hidden;
}

.modal_image .modal-header {
  background: var(--gradient-primary, linear-gradient(135deg, #1e40af, #3b82f6));
  border: none;
  padding: var(--space-lg, 24px);
}

.modal_image .modal-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 18px;
}

.modal_image .modal-header .close {
  color: #ffffff;
  opacity: 0.8;
  text-shadow: none;
  font-size: 28px;
  font-weight: 300;
}

.modal_image .modal-header .close:hover {
  opacity: 1;
}

.modal_image .modal-body {
  padding: var(--space-xl, 32px);
}

.modal_image .modal-footer {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: var(--space-md, 16px) var(--space-xl, 32px);
  gap: var(--space-sm, 8px);
}

.modal_image .btn-profile-save {
  background: var(--gradient-primary, linear-gradient(135deg, #1e40af, #3b82f6));
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md, 12px);
  transition: var(--transition-smooth, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.modal_image .btn-profile-save:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary, 0 4px 20px rgba(30, 64, 175, 0.3));
}

.modal_image .btn-profile-cancel {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #334155);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-md, 12px);
  transition: var(--transition-smooth, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.modal_image .btn-profile-cancel:hover {
  background: var(--bg-hover, #e2e8f0);
}

.modal_image .form-control {
  border-radius: var(--radius-md, 12px);
  border: 2px solid var(--border-color, #e2e8f0);
  padding: 12px 16px;
  transition: var(--transition-normal, all 0.3s ease);
}

.modal_image .form-control:focus {
  border-color: var(--azul-primario, #1e40af);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.modal_image label {
  font-weight: 600;
  color: var(--text-secondary, #334155);
  margin-bottom: var(--space-sm, 8px);
}

/* Rotate Buttons */
.rotate-perfil {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #334155);
  border-radius: var(--radius-md, 12px);
  padding: 10px 16px;
  margin: var(--space-sm, 8px);
  transition: var(--transition-smooth, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.rotate-perfil:hover {
  background: var(--azul-primario, #1e40af);
  color: #ffffff;
  border-color: var(--azul-primario, #1e40af);
}

/* Dark Mode Support */
[data-theme='dark'] .profile-header-gradient::after,
.dark-mode .profile-header-gradient::after,
body.dark .profile-header-gradient::after {
  background: var(--bg-card, #1e293b);
}

[data-theme='dark'] .profile-avatar,
.dark-mode .profile-avatar,
body.dark .profile-avatar {
  border-color: var(--bg-card, #1e293b);
}

[data-theme='dark'] .profile-info-item,
.dark-mode .profile-info-item,
body.dark .profile-info-item {
  background: var(--bg-secondary, #334155);
}

[data-theme='dark'] .profile-company-badge,
.dark-mode .profile-company-badge,
body.dark .profile-company-badge {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15),
    rgba(96, 165, 250, 0.15)
  );
}

[data-theme='dark'] .modal_image .modal-body,
.dark-mode .modal_image .modal-body,
body.dark .modal_image .modal-body {
  background: var(--bg-card, #1e293b);
}

[data-theme='dark'] .modal_image .modal-footer,
.dark-mode .modal_image .modal-footer,
body.dark .modal_image .modal-footer {
  background: var(--bg-card, #1e293b);
}
