/* ============================================================
   SHIPRA — Clean Working CSS
   Mobile-First, Fully Responsive
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Quicksand:wght@400;500;600&display=swap");

:root {
  --app-height: 100dvh;
  --input-bottom: 0px;
  --browser-bottom-offset: 0px;
  --chat-input-height: 66px;
}

/* ============ RESET ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: -webkit-fill-available;
}

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  color: #fff;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, textarea { font-family: inherit; border: none; outline: none; background: none; }
input { font-size: 16px; }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes floatUp { 0% { opacity: 0.8; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-100vh); } }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.1); } 50% { transform: scale(1); } 75% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============ LOGIN PAGE ============ */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease;
}

.login-logo {
  text-align: center;
  font-size: 4rem;
  margin-bottom: 10px;
  animation: heartBeat 1.5s infinite;
}

.login-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.login-error {
  background: rgba(255, 100, 100, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 16px 20px;
  padding-left: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input::placeholder { color: rgba(255, 255, 255, 0.6); }

.input-group input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #f093fb;
  box-shadow: 0 0 20px rgba(240, 147, 251, 0.3);
}

.input-group .input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  border-radius: 14px;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(245, 87, 108, 0.5);
}

.login-btn:active { transform: translateY(0); }

.login-quote {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Floating Hearts on Login */
.floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -50px;
  font-size: 1.5rem;
  animation: floatUp 8s linear infinite;
  opacity: 0.6;
}

.floating-heart:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 10s; font-size: 1.2rem; }
.floating-heart:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 12s; font-size: 1.8rem; }
.floating-heart:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 8s; font-size: 1rem; }
.floating-heart:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 11s; font-size: 1.5rem; }
.floating-heart:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 9s; font-size: 1.3rem; }
.floating-heart:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 10s; font-size: 1rem; }

/* ============ CHAT PAGE ============ */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  height: 100svh;
  height: 100dvh;
  height: var(--app-height);
  min-height: var(--app-height);
  max-height: var(--app-height);
  min-height: -webkit-fill-available;
  overflow: hidden;
  position: relative;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  z-index: 300;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.header-btn.active {
  background: rgba(245, 87, 108, 0.4);
}

/* Messages Area */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.messages-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Welcome Section */
.welcome-section {
  text-align: center;
  padding: 18px 14px;
  animation: fadeIn 0.5s ease;
}

.welcome-hearts {
  font-size: 2rem;
  margin-bottom: 6px;
  animation: bounce 2s infinite;
}

.welcome-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.welcome-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* Daily Quote */
.daily-quote {
  text-align: center;
  padding: 12px 14px;
  margin: 0 auto 10px;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

.message-sent {
  align-self: flex-end;
  align-items: flex-end;
}

.message-received {
  align-self: flex-start;
  align-items: flex-start;
}

.message-sender {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  padding: 0 8px;
}

.message-bubble {
  padding: 8px 12px;
  border-radius: 20px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 0.95rem;
}

.message-sent .message-bubble {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.message-received .message-bubble {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  padding: 0 8px;
}

/* Image Messages */
.message-image .message-bubble {
  padding: 8px;
  background: transparent !important;
  box-shadow: none !important;
}

.message-image img {
  max-width: 250px;
  width: 100%;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.message-image img:hover {
  transform: scale(1.02);
}

/* Reactions */
.message-reactions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding: 0 8px;
}

.reaction-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-badge:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  align-self: flex-start;
  animation: fadeIn 0.3s ease;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: bounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.typing-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
}

/* Chat Input */
.chat-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  position: fixed;
  bottom: calc(var(--input-bottom) + var(--browser-bottom-offset));
  left: 0;
  right: 0;
  width: 100%;
  min-height: var(--chat-input-height);
  z-index: 1000;
  transform: translateZ(0);
}

@media (max-width: 768px) {
  :root {
    --chat-input-height: 58px;
  }

  .chat-input {
    bottom: calc(var(--input-bottom) + var(--browser-bottom-offset));
  }

  .chat-messages {
    padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 18px);
  }
}

.message-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid transparent;
  border-radius: 25px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.message-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.message-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: #f093fb;
}

.image-upload-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.image-upload-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.image-upload-btn input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
}

.send-btn:active {
  transform: scale(0.95);
}

/* ============ OVERLAYS ============ */

/* Image Preview */
.image-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-preview.show {
  opacity: 1;
  visibility: visible;
}

.preview-panel {
  max-width: 90%;
  max-height: 80%;
  text-align: center;
}

.preview-panel img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.preview-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.preview-btn {
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preview-btn.send {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.preview-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.preview-btn:hover {
  transform: translateY(-2px);
}

.preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-lightbox.show {
  opacity: 1;
  visibility: visible;
}

.image-lightbox img {
  max-width: 95%;
  max-height: 90%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Reaction Picker */
.reaction-picker {
  position: fixed;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.reaction-picker.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.reaction-option {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-option:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.2);
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition: all 0.2s ease;
}

.context-menu.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.context-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.context-item.danger:hover {
  background: rgba(255, 100, 100, 0.2);
  color: #ff6b6b;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.toast {
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(20px);
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease;
  white-space: nowrap;
}

.toast.success { border-left: 4px solid #4ade80; }
.toast.error { border-left: 4px solid #ff6b6b; }
.toast.info { border-left: 4px solid #60a5fa; }

/* ============ RESPONSIVE ============ */

/* Tablet */
@media (max-width: 768px) {
  :root {
    --chat-input-height: 58px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .header-brand {
    font-size: 1.1rem;
  }

  .header-status {
    font-size: 0.75rem;
  }

  .header-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .chat-messages {
    padding: 12px;
    padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 18px);
  }

  .message {
    max-width: 85%;
  }

  .message-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .welcome-section {
    padding: 14px 12px;
  }

  .welcome-hearts {
    font-size: 1.8rem;
  }

  .welcome-title {
    font-size: 1.1rem;
  }

  .chat-input {
    padding: 7px 10px;
    gap: 8px;
  }

  .message-input {
    padding: 9px 12px;
    font-size: 16px;
  }

  .send-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .image-upload-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --chat-input-height: 54px;
  }

  .chat-header {
    padding: 8px 10px;
  }

  .header-left {
    gap: 8px;
  }

  .header-brand {
    font-size: 1rem;
  }

  .header-brand span {
    display: none;
  }

  .header-status {
    display: none;
  }

  .header-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .chat-messages {
    padding: 10px 8px;
    padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 14px);
  }

  .message {
    max-width: 88%;
  }

  .message-bubble {
    padding: 9px 12px;
    font-size: 0.875rem;
    border-radius: 16px;
  }

  .message-sent .message-bubble {
    border-bottom-right-radius: 4px;
  }

  .message-received .message-bubble {
    border-bottom-left-radius: 4px;
  }

  .message-sender {
    font-size: 0.65rem;
  }

  .message-meta {
    font-size: 0.6rem;
  }

  .message-image img {
    max-width: 200px;
  }

  .welcome-section {
    padding: 10px 8px;
  }

  .welcome-hearts {
    font-size: 1.5rem;
  }

  .welcome-title {
    font-size: 1rem;
  }

  .welcome-text {
    font-size: 0.85rem;
  }

  .daily-quote {
    padding: 8px 10px;
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .chat-input {
    padding: 6px 8px;
    gap: 7px;
  }

  .message-input {
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 20px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .image-upload-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .toast {
    font-size: 0.8rem;
    padding: 10px 18px;
  }

  .reaction-picker {
    padding: 8px 10px;
    gap: 6px;
  }

  .reaction-option {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }

  .context-menu {
    min-width: 160px;
  }

  .context-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* iOS Chrome/Safari reserve space for the browser bottom toolbar. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 768px) {
    :root {
      --browser-bottom-offset: 100px;
    }
  }
}

/* Very Small */
@media (max-width: 360px) {
  .header-brand {
    font-size: 0.9rem;
  }

  .header-btn {
    width: 30px;
    height: 30px;
  }

  .message {
    max-width: 92%;
  }

  .welcome-hearts {
    font-size: 1.8rem;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  .image-upload-btn {
    width: 34px;
    height: 34px;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-header {
    padding: 6px 12px;
  }

  .header-brand {
    font-size: 1rem;
  }

  .header-btn {
    width: 32px;
    height: 32px;
  }

  .welcome-section {
    padding: 10px;
  }

  .welcome-hearts {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }

  .welcome-title {
    font-size: 1rem;
  }

  .welcome-text {
    display: none;
  }

  .daily-quote {
    padding: 8px;
    margin-bottom: 8px;
    font-size: 0.75rem;
  }

  .chat-messages {
    padding: 8px;
    padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 10px);
  }

  .message-bubble {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .chat-input {
    padding: 6px 10px;
  }

  .message-input {
    padding: 8px 12px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  .image-upload-btn {
    width: 34px;
    height: 34px;
  }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .chat-messages {
    padding-bottom: calc(var(--chat-input-height) + var(--browser-bottom-offset) + 18px + env(safe-area-inset-bottom));
  }

  .toast-container {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ============ UTILITIES ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
