/* iMessage-like styles — copiar y pegar en tu pet.css */

/* --- Variables --- */
:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --accent: #007aff; /* iMessage blue */
  --bubble-left: #e5e7eb; /* light gray bubble */
  --text-dark: #111827;
  --muted: #6b7280;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  --glass: rgba(255, 255, 255, 0.6);
  --radius-lg: 20px;
  --radius-sm: 12px;
  --max-width: 420px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}

/* --- Page layout --- */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: linear-gradient(180deg, #eef2f7 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-dark);
}

.containerBig {
  width: 100%;
  max-width: var(--max-width);
  margin: 28px auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 640px;
  height: calc(100vh - 70px);
  border: 1px solid rgba(16, 24, 40, 0.04);
}

/* --- Header / profile --- */
.userProfile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.4)
  );
  border-bottom: 1px solid rgba(16, 24, 40, 0.03);
}
.userProfile_img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 54px;
  box-shadow: 0 4px 10px rgba(2, 6, 23, 0.06);
}
.userProfile_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.userProfile_info {
  flex: 1;
  min-width: 0;
}
.userProfile_chat {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.userProfile_name {
  margin: 2px 0 0 0;
  font-weight: 600;
  font-size: 15px;
}

/* header buttons */
.userProfile_buttons {
  display: flex;
  gap: 8px;
}
.userProfile_button-menu,
.userProfile_button-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8),
    rgba(245, 246, 250, 0.9)
  );
  box-shadow: 0 2px 6px rgba(2, 6, 23, 0.06);
  color: var(--accent);
}
.userProfile_button-close i {
  transform: rotate(45deg);
}

/* --- Online strip --- */
.online {
  padding: 8px 16px;
  border-bottom: 1px dashed rgba(16, 24, 40, 0.03);
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.03), transparent);
}
.online_text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* --- Messages area --- */
.container1 {
  flex: 1 1 auto;
  padding: 18px 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(250, 250, 252, 0.6), transparent);
}

/* Generic message card */
.card {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.35;
  word-wrap: break-word;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.03);
  position: relative;
  font-size: 15px;
}

/* Left bubble (user1) */
.card.user1 {
  align-self: flex-start;
  background: var(--bubble-left);
  color: var(--text-dark);
  border-top-left-radius: 6px;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 18px;
}

/* Right bubble (user2) - iMessage blue */
.card.user2 {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--accent), #0061d5);
  color: white;
  border-top-right-radius: 6px;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

/* Bubble "tail" */
.card.user1::after,
.card.user2::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 3px 6px rgba(2, 6, 23, 0.02);
}
.card.user1::after {
  left: -6px;
  background: var(--bubble-left);
}
.card.user2::after {
  right: -6px;
  background: linear-gradient(180deg, var(--accent), #0061d5);
}

/* text inside card */
.cardText {
  margin: 0;
  white-space: pre-wrap;
}

/* small subtext (e.g., .cardUser if used for name or time) */
.cardUser {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
}

/* --- Composer area (template .input will be cloned into DOM) --- */
.input {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid rgba(16, 24, 40, 0.04);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.75),
    rgba(250, 250, 252, 0.9)
  );
}
.inputText {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.06);
  outline: none;
  font-size: 15px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(247, 249, 252, 0.9)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.inputText:focus {
  box-shadow: 0 6px 18px rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.28);
}

/* Send button */
.send {
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--accent);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.12);
}

/* Icons area (under composer) */
.icons {
  display: flex;
  gap: 8px;
  padding: 10px 14px 18px 14px;
  justify-content: flex-start;
}
.icons_buttons {
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  transition: background 0.12s ease, transform 0.08s ease;
}
.icons_buttons:hover {
  background: rgba(2, 6, 23, 0.04);
  transform: translateY(-2px);
}

/* --- Misc / utility --- */
.template {
  display: none;
}
.hidden {
  display: none !important;
}

/* Scrollbar styling (subtle) */
.container1::-webkit-scrollbar {
  width: 10px;
}
.container1::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.08));
  border-radius: 10px;
}
.container1::-webkit-scrollbar-track {
  background: transparent;
}

/* Responsive adjustments */
@media (max-width: 420px) {
  .containerBig {
    margin: 12px 12px;
    height: calc(100vh - 40px);
    min-height: 560px;
    border-radius: 14px;
  }
  .userProfile_img {
    width: 44px;
    height: 44px;
  }
  .userProfile_button-menu,
  .userProfile_button-close {
    width: 34px;
    height: 34px;
  }
  .card {
    font-size: 14px;
  }
  .inputText {
    padding: 10px;
  }
}

/* Accessibility: focus outlines */
.userProfile_button-menu:focus,
.userProfile_button-close:focus,
.send:focus,
.icons_buttons:focus,
.inputText:focus {
  outline: 3px solid rgba(0, 122, 255, 0.12);
  outline-offset: 2px;
}

/* --- Small polish: make templates invisible to layout if left in DOM --- */
template {
  display: none;
}
