/* Haven - iMessage Theme */

[data-theme="imessage"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f6f6;
  --bg-tertiary: #e9e9eb;
  --bg-hover: #e5e5ea;
  --bg-active: #d1d1d6;
  
  --text-primary: #000000;
  --text-secondary: #3c3c43;
  --text-muted: #8e8e93;
  --text-link: #007aff;
  
  --accent-primary: #007aff;
  --accent-hover: #0056b3;
  --accent-success: #34c759;
  --accent-warning: #ff9500;
  --accent-danger: #ff3b30;
  
  --border-color: #c6c6c8;
  --input-bg: #ffffff;
  --input-border: #c6c6c8;
  
  --bubble-incoming: #e9e9eb;
  --bubble-outgoing: #007aff;
  
  --message-hover: transparent;
  
  --radius-small: 4px;
  --radius-medium: 10px;
  --radius-large: 18px;
  --radius-full: 9999px;
  
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

/* iMessage-specific layout */
[data-theme="imessage"] .chat-layout {
  background: var(--bg-primary);
}

[data-theme="imessage"] .sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

[data-theme="imessage"] .sidebar-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="imessage"] .room-item {
  border-radius: 10px;
  padding: 10px 12px;
}

[data-theme="imessage"] .room-item.active {
  background: var(--accent-primary);
}

[data-theme="imessage"] .room-item.active .room-name {
  color: white;
}

[data-theme="imessage"] .chat-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="imessage"] .chat-main {
  background: var(--bg-primary);
}

/* iMessage bubble style messages */
[data-theme="imessage"] .messages-list {
  padding: 16px;
  gap: 8px;
}

[data-theme="imessage"] .message {
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  background: none !important;
}

[data-theme="imessage"] .message.own {
  align-items: flex-end;
}

[data-theme="imessage"] .message-avatar {
  display: none;
}

[data-theme="imessage"] .message-header {
  padding: 0 12px;
  margin-bottom: 2px;
}

[data-theme="imessage"] .message.own .message-header {
  display: none;
}

[data-theme="imessage"] .message-author {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

[data-theme="imessage"] .message-timestamp {
  font-size: 11px;
}

[data-theme="imessage"] .message-content {
  max-width: 70%;
}

[data-theme="imessage"] .message-text {
  background: var(--bubble-incoming);
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
}

[data-theme="imessage"] .message.own .message-text {
  background: var(--bubble-outgoing);
  color: white;
}

/* Bubble tails */
[data-theme="imessage"] .message-text {
  position: relative;
}

[data-theme="imessage"] .message:not(.own) .message-text {
  border-bottom-left-radius: 4px;
}

[data-theme="imessage"] .message.own .message-text {
  border-bottom-right-radius: 4px;
}

/* Input area */
[data-theme="imessage"] .message-input-container {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
}

[data-theme="imessage"] .message-input-wrapper {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
}

[data-theme="imessage"] .send-btn {
  background: var(--accent-primary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

/* Members panel */
[data-theme="imessage"] .members-panel {
  background: var(--bg-secondary);
}

/* Reactions */
[data-theme="imessage"] .message-reactions {
  margin-top: 4px;
}

[data-theme="imessage"] .reaction {
  background: var(--bg-tertiary);
  border: none;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 13px;
}

/* Modals */
[data-theme="imessage"] .modal-content {
  border-radius: 14px;
}

[data-theme="imessage"] .btn-primary {
  border-radius: 8px;
}

[data-theme="imessage"] .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

[data-theme="imessage"] input,
[data-theme="imessage"] select {
  border-radius: 8px;
}

/* Scrollbar light theme */
[data-theme="imessage"] ::-webkit-scrollbar-thumb {
  background: #c7c7cc;
}

[data-theme="imessage"] ::-webkit-scrollbar-thumb:hover {
  background: #a9a9ae;
}

/* Typing indicator */
[data-theme="imessage"] .typing-indicator {
  padding-left: 12px;
}

[data-theme="imessage"] .typing-dots span {
  background: var(--text-muted);
}

/* Read receipts */
[data-theme="imessage"] .read-receipts {
  font-size: 11px;
  color: var(--text-muted);
}

/* Date separator */
[data-theme="imessage"] .date-separator::before,
[data-theme="imessage"] .date-separator::after {
  display: none;
}

[data-theme="imessage"] .date-separator {
  justify-content: center;
}

[data-theme="imessage"] .date-separator span {
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
