/**
 * Status Page Styles - Material Design 3
 * Uses MD3 design tokens from md3-components.css
 */

.status-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px;
}

.status-card {
  background: var(--md-sys-color-surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--md-sys-elevation-1);
}

/* Author Header */
.status-author {
  margin-bottom: 16px;
}

.author-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.author-link:hover .author-name {
  text-decoration: underline;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--md-sys-color-surface-variant);
}

.author-avatar-default {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.author-handle {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  font-family: monospace;
}

/* Reply Context */
.reply-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

.reply-context a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  word-break: break-all;
}

.reply-context a:hover {
  text-decoration: underline;
}

.reply-icon {
  font-size: 18px;
  transform: scaleX(-1);
}

/* Quoted Post */
.quote-container {
  margin-bottom: 16px;
}

.quote-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  border-left: 3px solid var(--md-sys-color-primary);
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s;
}

.quote-link:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.quote-icon {
  font-size: 24px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}

.quote-url {
  flex: 1;
  font-size: 14px;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-external {
  font-size: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Post Content */
.status-content {
  font-size: 18px;
  line-height: 1.7;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.status-content p {
  margin: 0 0 12px 0;
}

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

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

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

.status-content .hashtag {
  color: var(--md-sys-color-primary);
  font-weight: 500;
  pointer-events: none;
  text-decoration: none;
}

.status-content .mention {
  color: var(--md-sys-color-primary);
  font-weight: 500;
}

/* Media Attachments */
.status-media {
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}

/* Single image: full width */
.status-media.single {
  grid-template-columns: 1fr;
}

/* Multiple images: 2 columns */
.status-media.multiple {
  grid-template-columns: repeat(2, 1fr);
}

.media-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

/* ALT text badge */
.alt-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}

.alt-badge:hover {
  background: rgba(0, 0, 0, 0.9);
}

.alt-badge:focus {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ALT text overlay */
.alt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  z-index: 3;
  border-radius: 12px;
}

.alt-overlay.show {
  display: flex;
}

.alt-content {
  flex: 1;
  padding: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.alt-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.alt-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.alt-close:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.alt-close .material-icons {
  font-size: 20px;
}

.media-image,
.media-video {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: var(--md-sys-color-surface-variant);
}

.media-audio {
  width: 100%;
  border-radius: 12px;
}

/* Poll */
.status-poll {
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.poll-option {
  position: relative;
  padding: 12px 16px;
  background: var(--md-sys-color-surface);
  border-radius: 8px;
  overflow: hidden;
}

.poll-option-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--md-sys-color-primary-container);
  opacity: 0.5;
  border-radius: 8px;
  transition: width 0.3s ease;
}

.poll-option-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

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

.poll-option-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.poll-option-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  min-width: 40px;
  text-align: right;
}

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

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

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

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

/* Timestamp */
.status-timestamp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

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

/* Actions */
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.action-btn .material-icons {
  font-size: 18px;
}

/* Toast Notification */
.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);
  z-index: 1000;
}

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

/* Not Found State */
.status-not-found {
  text-align: center;
  padding: 48px 24px;
}

.not-found-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--md-sys-color-error-container);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.not-found-icon .material-icons {
  font-size: 40px;
  color: var(--md-sys-color-on-error-container);
}

.not-found-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 12px;
}

.not-found-desc {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 24px;
  line-height: 1.5;
}

.not-found-info {
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.not-found-info .material-icons {
  font-size: 20px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.not-found-info p {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
  margin: 0;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.not-found-actions .action-btn.primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.not-found-actions .action-btn.primary:hover {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* Responsive */
@media (max-width: 600px) {
  .status-container {
    padding: 16px 8px;
  }

  .status-card {
    padding: 16px;
    border-radius: 12px;
  }

  .author-avatar {
    width: 48px;
    height: 48px;
  }

  .author-name {
    font-size: 16px;
  }

  .status-content {
    font-size: 16px;
  }

  .status-actions {
    flex-direction: column;
  }

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