/**
 * Profile Page Styles
 * Public profile page for user profiles
 * Requires: md3-components.css (via material-design-3)
 */

/* Container */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

/* Header Image */
.profile-header {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-header-default {
  background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-tertiary) 100%);
}

.profile-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
}

/* Profile Card */
.profile-card {
  background: var(--md-sys-color-surface);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  position: relative;
  padding: 24px;
}

/* Avatar */
.profile-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -80px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 4px solid var(--md-sys-color-surface);
  background: var(--md-sys-color-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  box-shadow: var(--md-sys-elevation-3);
}

.profile-avatar-default {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* Status Badge */
.profile-status-badge {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.status-online {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.status-offline {
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-online .status-indicator {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Profile Info */
.profile-info {
  text-align: center;
}

.profile-display-name {
  font-size: 32px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 8px 0;
}

.profile-handle {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 0 24px 0;
  font-family: monospace;
}

.profile-bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 24px 0;
  white-space: pre-wrap;
}

.profile-bio-empty {
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
}

/* Metadata */
.profile-metadata {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 16px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

.metadata-icon {
  font-size: 18px;
}

/* Profile Fields */
.profile-fields {
  margin: 24px 0 32px 0;
}

.profile-fields-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 16px 0;
  text-align: center;
}

.profile-fields-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-field {
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  padding: 16px;
}

.profile-field-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.profile-field-icon {
  font-size: 16px;
}

.profile-field-value {
  font-size: 14px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
  word-break: break-word;
}

/* Follow Section */
.profile-follow-section {
  background: var(--md-sys-color-primary-container);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.follow-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--md-sys-color-on-primary-container);
  margin: 0 0 12px 0;
}

.follow-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--md-sys-color-on-primary-container);
  margin: 0 0 16px 0;
  opacity: 0.9;
}

.follow-address-box {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.follow-address {
  flex: 1;
  min-width: 200px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-1px);
}

.btn-copy:active {
  transform: translateY(0);
  box-shadow: var(--md-sys-elevation-1);
}

/* Copy Toast */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--md-sys-elevation-3);
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ActivityPub Link */
.profile-activitypub-link {
  text-align: center;
}

.activitypub-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.activitypub-link:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  transform: translateY(-1px);
  box-shadow: var(--md-sys-elevation-1);
}

.activitypub-icon {
  font-size: 16px;
}

/* Profile Sections (Posts, Tags) */
.profile-section {
  background: var(--md-sys-color-surface);
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 16px 0;
}

.section-icon {
  font-size: 20px;
  color: var(--md-sys-color-primary);
}

/* Featured Tags */
.featured-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.featured-tag:hover {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  transform: translateY(-1px);
}

.tag-name {
  color: inherit;
}

.tag-count {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 10px;
}

/* Posts List */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.post-card.pinned {
  border-left: 3px solid var(--md-sys-color-primary);
}

.post-pin-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--md-sys-color-primary);
  opacity: 0.7;
}

.post-pin-badge .material-icons {
  font-size: 16px;
}

.post-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  word-break: break-word;
}

.post-content p {
  margin: 0 0 8px 0;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.post-attachment-image {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  max-height: 200px;
}

.post-attachment-video {
  width: 100%;
  border-radius: 8px;
  max-height: 300px;
}

.post-attachment-audio {
  width: 100%;
  border-radius: 8px;
}

/* Post Poll */
.post-poll {
  background: var(--md-sys-color-surface);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.poll-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 6px;
}

.poll-option-name {
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
}

.poll-option-votes {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-radius: 10px;
}

.poll-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.poll-votes-count {
  font-weight: 500;
}

.poll-status {
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--md-sys-color-surface-variant);
}

.poll-status.poll-closed {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.post-meta {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.post-time {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Cache Notice */
.cache-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.cache-notice .material-icons {
  font-size: 18px;
}

/* Responsive */
@media (max-width: 600px) {
  .profile-header {
    height: 160px;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 36px;
  }

  .profile-avatar-wrapper {
    margin-top: -60px;
  }

  .profile-display-name {
    font-size: 24px;
  }

  .profile-card {
    padding: 16px;
    border-radius: 20px 20px 0 0;
  }

  .follow-address-box {
    flex-direction: column;
  }

  .btn-copy {
    width: 100%;
    justify-content: center;
  }

  .profile-section {
    padding: 16px;
  }
}
