/**
 * @file Estilos específicos para a página do Painel do Usuário (Dashboard).
 */

/* --- Cabeçalho de Perfil (Hero) --- */
.profile-hero-section {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border: 1px solid var(--border-color);
  background: var(--spotlight-bg), var(--bg-surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: background 0.3s ease;
}

.dark-theme .profile-hero-section {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.profile-hero-content,
.logout-button {
  position: relative;
  z-index: 1;
}

.profile-hero-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--primary);
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4);
}

.level-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 3px solid var(--bg-surface);
  z-index: 1;
}

.profile-info {
  flex-grow: 1;
}
.profile-name {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-heading);
}
.profile-tag {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.logout-button {
  background-color: var(--bg-canvas);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.logout-button i {
  margin: auto;
}

.logout-button:hover {
  color: var(--color-error);
  border-color: var(--color-error);
  background-color: rgba(var(--color-error-rgb), 0.1);
}

/* --- Barra de Progresso de Nível --- */
.level-progress-container {
  background-color: var(--bg-surface);
  border-radius: 15px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-color);
}
.level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.level-info span:first-child {
  color: var(--primary);
}
.progress-bar-bg {
  height: 8px;
  background-color: var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.dark-theme .progress-bar-bg {
  background-color: rgba(var(--primary-rgb), 0.1);
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  transition: width 0.5s ease-out;
}

/* --- Mosaico de Ações --- */
.portfolio-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 250px;
  gap: 1.5rem;
  perspective: 1500px;
}
.mosaic-item-wrapper {
  grid-column: span 1;
  grid-row: span 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
.mosaic-item-wrapper.wide {
  grid-column: span 2;
}
.mosaic-item-wrapper.tall {
  grid-row: span 2;
}
.mosaic-item {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  transform-style: preserve-3d;
  transition: box-shadow 0.4s ease, transform 0.2s ease;
  display: block;
}
.mosaic-item:hover {
  box-shadow: 0 15px 30px -8px rgba(0, 0, 0, 0.4);
  z-index: 10;
}
.dark-theme .mosaic-item:hover {
  box-shadow: 0 15px 30px -8px rgba(0, 0, 0, 0.6);
}
.mosaic-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0.8;
  border-radius: 16px;
}
.mosaic-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
  background: linear-gradient(
    to top,
    rgba(24, 24, 27, 0.98) 0%,
    rgba(24, 24, 27, 0.75) 20%,
    transparent 95%
  );
}
.mosaic-content {
  position: relative;
  z-index: 3;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.content-top {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.partner-badge {
  align-self: flex-start;
  margin-bottom: 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
}
.partner-name {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.partner-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #fff;
  max-width: 80%;
}
.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background-color: rgba(var(--text-heading-rgb, 255, 255, 255), 0.2);
}
.stat-pill i {
  font-size: 1rem;
}
.visit-prompt {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  text-align: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 4;
  border-radius: 0 0 16px 16px;
}
.mosaic-item:hover .visit-prompt {
  opacity: 1;
  transform: translateY(0);
}
.mosaic-item:hover .mosaic-content {
  transform: translateY(-40px);
}

/* --- Cards da Sidebar --- */
.dashboard-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Card: Carteira (NOVOS ESTILOS INTERATIVOS) */
.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.wallet-switcher {
  display: flex;
  background-color: var(--bg-canvas);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border-color);
}
.switcher-btn {
  border: none;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  background-color: transparent;
  color: var(--text-muted);
  transition: all 0.3s ease;
  cursor: pointer;
}
.switcher-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-heading);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.dark-theme .switcher-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.wallet-display {
  text-align: center;
  margin: 1rem 0 2rem 0;
}
.wallet-icon-display {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.wallet-value-display {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-heading);
}
.wallet-label-display {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.wallet-actions {
  margin-top: auto;
}
.btn-wallet-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-light-theme);
  color: var(--primary);
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-wallet-action:hover {
  background-color: var(--primary);
  color: #fff;
}
.dark-theme .btn-wallet-action {
  background-color: rgba(var(--primary-rgb), 0.15);
}
.dark-theme .btn-wallet-action:hover {
  background-color: var(--primary);
}

/* Outros Cards */
.user-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.user-info-list li {
  display: flex;
  align-items: center;
  color: var(--text-body);
}
.user-info-list li i {
  color: var(--primary);
  margin-right: 12px;
  width: 20px;
  text-align: center;
}
.badges-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge-placeholder {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}
.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4em 0.8em;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.user-badge i {
  font-size: 0.9em;
}

.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}
.activity-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}
.activity-item:first-child {
  padding-top: 0;
}
.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.activity-icon {
  background-color: var(--primary-light-theme);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.activity-content {
  flex: 1;
}
.activity-text {
  margin: 0;
  color: var(--text-body);
  font-size: 0.95rem;
}
.activity-timestamp {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: block;
}
.activity-item.placeholder-empty {
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  border-bottom: none;
}
.activity-item.placeholder-empty .activity-icon {
  background-color: transparent;
  color: var(--text-muted);
}
.activity-item.placeholder {
  opacity: 0.6;
}
.activity-item.placeholder .activity-icon i {
  animation: fa-spin 1.5s linear infinite;
}

/* --- Responsividade --- */
@media (max-width: 991.98px) {
  .profile-hero-section,
  .profile-hero-content {
    flex-direction: column;
    text-align: center;
  }
  .logout-button {
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
  }
  .portfolio-mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }
  .mosaic-item-wrapper.wide,
  .mosaic-item-wrapper.tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}
