/* Messages Window Styles */

#animation-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 600px;
  background: transparent;
  border: none !important;
}

#messagesWindow {
  width: 100%;
  max-width: 900px;
  height: 560px;
  background: #f5f5f7;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#titleBar {
  height: 36px;
  display: flex;
  align-items: center;
  padding-left: 14px;
  border-bottom: 1px solid #e0e0e0;
}

.windowButton {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.windowButton.red {
  background: #ff5f57;
}

.windowButton.yellow {
  background: #febc2e;
}

.windowButton.green {
  background: #28c840;
}

#header {
  text-align: center;
  padding: 10px 0;
  font-weight: 600;
  font-size: 15px;
  color: #000;
  border-bottom: 1px solid #e0e0e0;
}

#conversation {
  padding: 20px;
  height: 420px;
  overflow: hidden;
  position: relative;
}

.messageRow {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-end;
}

.messageRow.incoming {
  justify-content: flex-start;
}

.messageRow.outgoing {
  justify-content: flex-end;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  background: linear-gradient(135deg, #ff6b9d, #4a90e2);
  flex-shrink: 0;
}

.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 300px;
  position: relative;
  font-size: 14px;
  line-height: 1.4;
}

.incoming .bubble {
  background: #e5e5ea;
  color: #000;
}

.outgoing .bubble {
  background: #007aff;
  color: white;
}

.attachment {
  width: 220px;
  height: 150px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e0e0e0, #d0d0d0);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
}

.messageStack {
  display: flex;
  flex-direction: column;
}

.tapback {
  position: absolute;
  bottom: -10px;
  right: -8px;
  background: white;
  border-radius: 14px;
  font-size: 12px;
  padding: 2px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dateSeparator {
  text-align: center;
  font-size: 12px;
  color: #8e8e93;
  margin: 20px 0;
}

#inputBar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  border-top: 1px solid #e0e0e0;
}

#messageInput {
  flex: 1;
  height: 36px;
  border-radius: 18px;
  border: 1px solid #ddd;
  padding: 0 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

#messageInput:focus {
  outline: none;
  border-color: #007aff;
}

.iconButton {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.iconButton:hover {
  background: #ddd;
}

/* Animation wrapper positioning */
#animationWrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
}

/* Diary elements initial states for animation */
#diaryTitle,
#diarySubtitle {
  opacity: 0;
  transform: translateY(8px);
}

#photoGrid > div {
  opacity: 0;
  transform: translateY(8px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #messagesWindow {
    height: 400px;
  }

  #conversation {
    height: 300px;
  }

  .attachment {
    width: 180px;
    height: 120px;
  }

  .bubble {
    max-width: 250px;
    font-size: 13px;
  }

  #photoGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #timelineSidebar {
    width: 60px !important;
  }
}
