/* Bond Priori - Memories Styles */

/* Header */
.memories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.memories-header h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

/* Flash Message */
.flash-message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

/* Memory Card */
.memory-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: var(--space-4);
  transition: border-color 0.2s ease;
}

.memory-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.memory-card-photo {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.memory-card-body {
  padding: var(--space-5);
}

.memory-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.memory-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-copper), var(--color-bronze));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: white;
  flex-shrink: 0;
}

.memory-card-meta {
  flex: 1;
  min-width: 0;
}

.memory-card-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.memory-card-date {
  font-size: var(--font-size-xs);
  color: var(--color-copper);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.memory-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

.memory-action-btn {
  background: none;
  border: none;
  color: var(--color-soft-grey);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
}

.memory-action-btn:hover {
  color: var(--color-copper);
  background: rgba(255, 255, 255, 0.05);
}

.memory-card-description {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-alabaster);
  margin-bottom: var(--space-4);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Reactions Bar */
.memory-reactions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.reaction-chip.mine {
  border-color: var(--color-copper);
  background: rgba(var(--rgb-dusty-taupe), 0.15);
}

.reaction-chip .reaction-count {
  color: var(--color-warm-grey);
}

.add-reaction-btn {
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--color-soft-grey);
  cursor: pointer;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  transition: all 0.2s ease;
}

.add-reaction-btn:hover {
  border-color: var(--color-copper);
  color: var(--color-copper);
}

/* Emoji Picker */
.emoji-picker-popup {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-1);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.emoji-picker-popup button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.emoji-picker-popup button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Comments Section */
.memory-comments {
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.memory-comment {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.memory-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--rgb-dusty-taupe), 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-alabaster);
  flex-shrink: 0;
}

.memory-comment-body {
  flex: 1;
  min-width: 0;
}

.memory-comment-author {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 2px;
}

.memory-comment-text {
  font-size: var(--font-size-sm);
  color: var(--color-warm-grey);
  line-height: var(--line-height-relaxed);
  word-break: break-word;
}

.memory-comment-time {
  font-size: 10px;
  color: var(--color-soft-grey);
  margin-top: 2px;
}

.memory-comment-delete {
  background: none;
  border: none;
  color: var(--color-soft-grey);
  cursor: pointer;
  font-size: var(--font-size-xs);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.memory-comment:hover .memory-comment-delete {
  opacity: 1;
}

.memory-comment-delete:hover {
  color: var(--color-error);
}

/* Comment Input */
.comment-input-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.comment-input-row input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-alabaster);
  font-size: var(--font-size-sm);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.comment-input-row input:focus {
  border-color: var(--color-copper);
}

.comment-input-row input::placeholder {
  color: var(--color-soft-grey);
}

.comment-send-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-dusty-taupe), 0.3);
  border: none;
  color: var(--color-alabaster);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: background 0.2s ease;
}

.comment-send-btn:hover {
  background: rgba(var(--rgb-dusty-taupe), 0.5);
}

.toggle-comments {
  font-size: var(--font-size-xs);
  color: var(--color-soft-grey);
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-1) 0;
  margin-top: var(--space-2);
  transition: color 0.2s ease;
}

.toggle-comments:hover {
  color: var(--color-copper);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-content {
  background: rgba(31, 18, 16, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-5) 0;
}

.modal-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-soft-grey);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--color-alabaster);
}

.modal-body {
  padding: var(--space-5);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-5);
}

.btn-modal-delete {
  margin-right: auto;
}

/* Photo Upload Area */
.photo-upload-area {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.photo-upload-hint {
  font-size: var(--font-size-xs);
  color: var(--color-soft-grey);
}

.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  display: block;
}

#photo-preview-container {
  margin-top: var(--space-2);
}

/* Empty State */
.memories-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-soft-grey);
}

.memories-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.memories-empty-text {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

/* Responsive */
@media (max-width: 600px) {
  .memories-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

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

  .memory-card-photo {
    max-height: 250px;
  }

  .modal-content {
    max-width: 100%;
    margin: var(--space-2);
  }
}
