/* Общий стиль */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7f8fb;
  color: #111827;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.app h1 {
  font-size: 22px;
  font-weight: 600;
  padding: 16px 0;
  margin: 0;
  color: #1f2937;
}

.mood-tracker {
  text-align: center;
  padding: 0 0 12px;
  border-bottom: 1px solid #e5e7eb;
}
.mood-tracker h3 {
  font-size: 14px;
  color: #6b7280;
}
.mood-tracker button {
  font-size: 28px;
  margin: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}
.mood-tracker button:hover {
  transform: scale(1.2);
}

#insightBox {
  font-size: 13px;
  color: #6b7280;
  margin: 8px 0;
  text-align: center;
}

#chat {
  flex: 1;
  overflow-y: auto;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px;
}

.message-user {
  align-self: flex-end;
  background: #4f46e5;
  color: white;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  max-width: 75%;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.15);
  animation: messagePop 0.3s ease-out;
}

.message-ai {
  align-self: flex-start;
  background: white;
  color: #1f2937;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  max-width: 75%;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  animation: messagePop 0.3s ease-out;
}

@keyframes messagePop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: #c4b5fd;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.input-area {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
  background: #f7f8fb;
}
.input-area input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  font-size: 15px;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
.input-area input:focus {
  border-color: #a78bfa;
}
.input-area button {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.input-area button:hover {
  background: #4338ca;
}

.feedback-buttons {
  display: flex;
  gap: 8px;
  padding: 8px 0;
}
.feedback-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.feedback-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  padding: 4px 0;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}
.step-dot.active {
  background: #4f46e5;
}
.step-dot.done {
  background: #a78bfa;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
#chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-area {
  flex-shrink: 0;
}

.family-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: modalFadeIn 0.25s ease-out;
}
.family-modal-content {
  background: white;
  border-radius: 20px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: modalSlideUp 0.25s ease-out;
}
.family-modal-content h3 {
  margin-top: 0;
}
.family-modal-content input {
  width: 100%;
  padding: 8px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid #ddd;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#familyChatMessages {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
#familyChatMessages b {
    color: #1f2937;
}

#vesselsContainer {
    overflow-x: auto;
    gap: 10px;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
/* Обучающие подсказки (онбординг-тур) */
.tooltip-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.tooltip-box {
    position: absolute;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    max-width: 280px;
    font-size: 14px;
    line-height: 1.5;
}
.tooltip-box::after {
    content: '';
    position: absolute;
    width: 0; height: 0;
    border: 8px solid transparent;
}
.tooltip-box.bottom::after {
    top: -16px; left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}
.tooltip-box button {
    margin-top: 8px;
    background: #4f46e5;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
}
