/* Family Management */
.family-management { width: 100%; margin: 1.5rem 0; padding: 1.5rem; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; animation: slideUp 0.6s ease-out; }
.family-management h3 { margin-top: 0; color: #1a202c; font-size: 1.2rem; text-align: center; }
.family-info-card { background: #fff; border-radius: 8px; padding: 1.2rem; margin-bottom: 1rem; border: 1px solid #e2e8f0; }
.family-current { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.family-current code { background: #667eea; color: #fff; padding: 0.8rem 1.2rem; border-radius: 8px; font-family: monospace; font-size: 1.1rem; font-weight: bold; min-width: 140px; text-align: center; }
.copy-btn { background: #4299e1; color: #fff; border: none; border-radius: 8px; padding: 0.7rem 1rem; cursor: pointer; transition: all 0.2s ease; font-size: 1rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.copy-btn:hover { background: #3182ce; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(66,153,225,0.3); }
.copy-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.family-help { text-align: center; margin: 1rem 0 0; color: #4a5568; font-size: 0.9rem; }
.input-group { display: flex; gap: 0.8rem; align-items: stretch; }
.input-group input { 
  flex: 1; 
  min-height: 52px; 
  padding: 1rem 1.2rem; 
  font-size: 1.1rem; 
  border: 2px solid #e2e8f0; 
  border-radius: 8px; 
  background: #fff; 
  transition: all 0.2s ease;
  font-family: monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.input-group input:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66,153,225,0.1);
  transform: scale(1.01);
}
.input-group button { 
  white-space: nowrap; 
  min-height: 52px; 
  padding: 1rem 1.5rem; 
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #4299e1;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
.input-group button:hover {
  background: #3182ce;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66,153,225,0.3);
}
.input-group button:active {
  transform: scale(0.98);
}

/* Family Info */
.family-info { margin-bottom: 2rem; }
.family-summary { 
  background: linear-gradient(135deg, #667eea, #764ba2); 
  color: #fff; 
  border-radius: 16px; 
  padding: 1.5rem 2rem; 
  text-align: center;
  box-shadow: 0 8px 32px rgba(102,126,234,0.3);
  position: relative;
  overflow: hidden;
}
.family-summary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}
.family-summary i { margin-right: 0.8rem; font-size: 1.2rem; }
.family-code { margin-top: 0.8rem; opacity: 0.95; }
.family-code code { 
  background: rgba(255,255,255,0.25); 
  padding: 0.4rem 0.8rem; 
  border-radius: 8px; 
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace; 
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Image Upload Section */
.image-upload-section { margin: 1rem 0; }
.image-upload-label { display: inline-flex; align-items: center; gap: 0.5rem; background: #f7fafc; border: 2px dashed #cbd5e0; border-radius: 8px; padding: 1rem; cursor: pointer; transition: all 0.2s ease; color: #4a5568; font-weight: 500; }
.image-upload-label:hover { background: #edf2f7; border-color: #4299e1; color: #4299e1; }
.image-upload-input { display: none; }
.image-preview { margin-top: 1rem; }
.image-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.image-preview .remove-image { display: inline-block; margin-top: 0.5rem; background: #e53e3e; color: #fff; border: none; border-radius: 4px; padding: 0.3rem 0.8rem; font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease; }
.image-preview .remove-image:hover { background: #c53030; }

/* Timeline Image Display */
.message-image { margin-top: 0.8rem; }
.message-image img { 
  max-width: 100%; 
  max-height: 200px; 
  width: auto; 
  height: auto; 
  object-fit: cover; 
  border-radius: 8px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
  cursor: pointer; 
  transition: transform 0.2s ease; 
}
.message-image img:hover { transform: scale(1.02); }

/* Image Modal */
.image-modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.9); }
.image-modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 90vw; max-height: 90vh; }
.image-modal img { max-width: 100%; max-height: 90vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.image-modal-close { position: absolute; top: 15px; right: 25px; color: #fff; font-size: 2rem; cursor: pointer; z-index: 3001; background: rgba(0,0,0,0.5); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.image-modal-close:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }

* { box-sizing: border-box; }
body, html { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif; 
  margin: 0; padding: 0; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  color: #1a202c; 
  line-height: 1.6; 
  min-height: 100vh;
}

/* Header */
.dash-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  background: rgba(255,255,255,0.95); 
  backdrop-filter: blur(20px);
  color: #2d3748; 
  padding: 1rem 1.5rem; 
  box-shadow: 0 8px 32px rgba(0,0,0,0.1); 
  border-bottom: 1px solid rgba(255,255,255,0.2); 
  position: sticky; 
  top: 0; 
  z-index: 100;
  border-radius: 0 0 20px 20px;
}
.dash-header .user-info { display: flex; align-items: center; gap: 0.8rem; }
.user-profile-link { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; color: inherit; padding: 0.5rem; border-radius: 8px; transition: all 0.2s ease; }
.user-profile-link:hover { background: #edf2f7; }
.dash-header .avatar { 
  width: 45px; 
  height: 45px; 
  border-radius: 50%; 
  object-fit: cover; 
  border: 3px solid #667eea; 
  box-shadow: 0 4px 16px rgba(102,126,234,0.3); 
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 2px;
}
.dash-header .avatar:hover { 
  transform: scale(1.1) rotate(5deg); 
  box-shadow: 0 8px 24px rgba(102,126,234,0.4);
}
.dash-header .profile-link, .dash-header .status-link { color: #4a5568; text-decoration: none; font-weight: 500; padding: 0.5rem 1rem; border-radius: 8px; transition: all 0.2s ease; }
.dash-header .profile-link:hover, .dash-header .status-link:hover { background: #edf2f7; color: #2d3748; }
.dash-header button { background: #e53e3e; border: none; color: #fff; font-size: 0.9rem; cursor: pointer; font-weight: 500; padding: 0.5rem 1rem; border-radius: 8px; transition: all 0.2s ease; }
.dash-header button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229,62,62,0.3); background: #c53030; }
.dash-header .header-links { display: flex; gap: 0.5rem; }

/* Auth */
body.auth-bg { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { max-width: 380px; width: 90%; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); padding: 2.5rem 2rem; }
.auth-container h2 { text-align: center; margin-bottom: 2rem; font-size: 1.8rem; color: #1a202c; font-weight: 600; }
.auth-container form label { display: block; margin: 1.2rem 0 0.5rem; font-weight: 500; color: #4a5568; }
.auth-container input[type="text"], .auth-container input[type="email"], .auth-container input[type="password"] { width: 100%; padding: 0.8rem 1rem; border-radius: 8px; border: 2px solid #e2e8f0; font-size: 1rem; background: #fff; margin-bottom: 0.5rem; transition: all 0.2s ease; }
.auth-container input:focus { outline: none; border-color: #4299e1; box-shadow: 0 0 0 3px rgba(66,153,225,0.1); }
.auth-container button { width: 100%; background: #4299e1; color: #fff; border: none; border-radius: 8px; padding: 0.9rem 0; font-size: 1.1rem; margin-top: 1.5rem; cursor: pointer; font-weight: 600; transition: all 0.2s ease; }
.auth-container button:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(66,153,225,0.3); background: #3182ce; }
.auth-container button:active { transform: translateY(0); }
.auth-container p { text-align: center; margin-top: 1.5rem; color: #718096; }
.auth-container a { color: #4299e1; text-decoration: none; font-weight: 500; }
.auth-container .error { color: #e53e3e; text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* Main layout */
main { 
  padding: 2rem 1.5rem; 
  max-width: 800px; 
  margin: auto;
  position: relative;
}
#calendar-section { text-align: center; margin-bottom: 1.5rem; }
#datePicker { font-size: 1.1rem; padding: 0.7rem 1rem; border-radius: 8px; border: 2px solid #e2e8f0; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: all 0.2s ease; }
#datePicker:focus { outline: none; border-color: #4299e1; box-shadow: 0 0 0 3px rgba(66,153,225,0.1); }

/* Timeline */
#timeline-section, .profile-timeline, #add-section { 
  background: rgba(255,255,255,0.95); 
  backdrop-filter: blur(20px);
  border-radius: 20px; 
  padding: 2rem; 
  margin-bottom: 2rem; 
  box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

#timeline-section::before, .profile-timeline::before, #add-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 20px 20px 0 0;
}
#timeline-section h2, .profile-timeline h3 { margin-top: 0; font-size: 1.3rem; color: #1a202c; font-weight: 600; }
#timeline-list, #profile-timeline-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }

/* Timeline Summary */
.timeline-summary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; text-align: center; }
.timeline-summary p { margin: 0; font-weight: 500; }
.timeline-summary i { margin-right: 0.5rem; }

/* Chat Message Style */
.chat-message { 
  display: flex; 
  gap: 1rem; 
  margin-bottom: 1.5rem; 
  padding: 1.5rem; 
  background: rgba(255,255,255,0.9); 
  backdrop-filter: blur(10px);
  border-radius: 16px; 
  box-shadow: 0 8px 32px rgba(0,0,0,0.08); 
  border: 1px solid rgba(255,255,255,0.3); 
  transition: all 0.3s ease;
  position: relative;
}
.chat-message:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.95);
}

.message-avatar { flex-shrink: 0; }
.message-avatar .avatar { 
  width: 50px; 
  height: 50px; 
  border-radius: 50%; 
  object-fit: cover; 
  border: 3px solid #667eea; 
  box-shadow: 0 4px 12px rgba(102,126,234,0.2);
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 2px;
}
.message-avatar .avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102,126,234,0.3);
}

.message-content { flex: 1; min-width: 0; }
.message-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.message-author { font-weight: 600; color: #2d3748; font-size: 0.95rem; }
.message-author.own-message { color: #4299e1; }
.message-time { font-size: 0.8rem; color: #718096; }
.message-text { color: #4a5568; line-height: 1.5; word-wrap: break-word; }

/* Emotion badge in chat */
.chat-message .emotion-badge { font-size: 1rem; }

/* Update timeline section */
#timeline-section h2 { color: #1a202c; margin-bottom: 1rem; }

/* Original timeline entry styles - keep for backward compatibility */
.timeline-entry { display: flex; align-items: center; background: #f7fafc; border-radius: 8px; padding: 1rem 1.2rem; font-size: 1rem; justify-content: space-between; transition: all 0.2s ease; border: 1px solid #edf2f7; margin-bottom: 0.8rem; }
.timeline-entry:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: #edf2f7; }
.timeline-entry .entry-content { flex: 1; color: #2d3748; }
.timeline-entry .entry-actions { display: flex; align-items: center; gap: 0.5rem; }
.timeline-entry button { background: none; border: none; color: #e53e3e; font-size: 1.1rem; margin-left: 0.8rem; cursor: pointer; padding: 0.3rem; border-radius: 4px; transition: all 0.2s ease; }
.timeline-entry button:hover { background: rgba(229,62,62,0.1); transform: scale(1.1); }
.emotion-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 1.2rem; margin-left: 0.8rem; transition: transform 0.2s ease; }
.emotion-badge:hover { transform: scale(1.1); }

/* Entry menu */
.entry-menu { position: relative; }
.menu-btn { background: none; border: none; color: #718096; font-size: 1rem; cursor: pointer; padding: 0.4rem; border-radius: 4px; transition: all 0.2s ease; margin: 0; }
.menu-btn:hover { background: #edf2f7; color: #4a5568; transform: none; }
.menu-dropdown { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; min-width: 120px; }
.menu-dropdown button { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.6rem 1rem; border: none; background: none; color: #4a5568; font-size: 0.9rem; cursor: pointer; border-radius: 0; margin: 0; transition: background 0.2s ease; }
.menu-dropdown button:hover { background: #f7fafc; transform: none; }
.menu-dropdown button:first-child { border-radius: 8px 8px 0 0; }
.menu-dropdown button:last-child { border-radius: 0 0 8px 8px; }
.menu-dropdown button:first-child:last-child { border-radius: 8px; }
.menu-dropdown button i { width: 14px; }

/* Add entry form */
#add-entry-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
#entry-content { 
  width: 100%; 
  border-radius: 12px; 
  border: 2px solid rgba(102,126,234,0.2); 
  padding: 1.2rem; 
  font-size: 1rem; 
  background: rgba(255,255,255,0.9); 
  backdrop-filter: blur(10px);
  transition: all 0.3s ease; 
  min-height: 120px; 
  resize: vertical; 
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
#entry-content:focus { 
  outline: none; 
  border-color: #667eea; 
  box-shadow: 0 0 0 4px rgba(102,126,234,0.15), 0 8px 32px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  transform: translateY(-2px);
}
.form-controls { display: flex; gap: 0.8rem; align-items: center; }
#entry-emotion { 
  flex: 1; 
  border-radius: 12px; 
  border: 2px solid rgba(102,126,234,0.2); 
  padding: 1rem 1.2rem; 
  font-size: 1rem; 
  background: rgba(255,255,255,0.9); 
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
#entry-emotion:focus { 
  outline: none; 
  border-color: #667eea; 
  box-shadow: 0 0 0 4px rgba(102,126,234,0.15), 0 8px 32px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  transform: translateY(-2px);
}
#add-entry-form button { 
  background: linear-gradient(135deg, #667eea, #764ba2); 
  color: #fff; 
  border: none; 
  border-radius: 12px; 
  padding: 1rem 2rem; 
  font-size: 1rem; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all 0.3s ease; 
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  position: relative;
  overflow: hidden;
}
#add-entry-form button:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 32px rgba(102,126,234,0.4);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}
#add-entry-form button:active {
  transform: translateY(-1px);
}

/* Rate section */
#rate-section { display: flex; flex-direction: column; gap: 1rem; background: #f7fafc; border-radius: 8px; padding: 1.2rem; margin-bottom: 1.5rem; border: 1px solid #edf2f7; }
#rate-section label { display: flex; align-items: center; gap: 1rem; font-weight: 500; color: #4a5568; }
#rate-section input[type="range"] { flex: 1; height: 6px; border-radius: 3px; background: #e2e8f0; outline: none; -webkit-appearance: none; }
#rate-section input[type="range"]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #4299e1; cursor: pointer; box-shadow: 0 2px 6px rgba(66,153,225,0.3); }
#rate-section button { align-self: flex-end; background: #4299e1; color: #fff; border: none; border-radius: 8px; padding: 0.7rem 1.5rem; font-size: 1rem; cursor: pointer; font-weight: 600; transition: all 0.2s ease; }
#rate-section button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(66,153,225,0.3); background: #3182ce; }

/* Stats */
#stats-section button { background: #ed8936; color: #fff; border: none; border-radius: 8px; padding: 0.8rem 1.5rem; font-size: 1rem; cursor: pointer; font-weight: 600; transition: all 0.2s ease; }
#stats-section button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(237,137,54,0.3); background: #dd6b20; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100vw; height: 100vh; overflow: auto; background: rgba(0,0,0,0.5); }
.modal-content { 
  background: rgba(255,255,255,0.95); 
  backdrop-filter: blur(20px);
  margin: 5vh auto; 
  padding: 2rem; 
  border-radius: 20px; 
  max-width: 95vw; 
  width: 500px; 
  position: relative; 
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.2);
  animation: modalSlideIn 0.4s ease-out;
}
.close { position: absolute; right: 1.5rem; top: 1.5rem; font-size: 1.5rem; cursor: pointer; color: #718096; transition: color 0.2s ease; }
.close:hover { color: #2d3748; }
#stats-content { max-height: 60vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
th, td { border: none; padding: 0.8rem; text-align: center; }
th { background: #edf2f7; color: #2d3748; font-weight: 600; }
tr:nth-child(even) { background: #f7fafc; }

/* Profile */
.profile-main { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center; }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid #667eea; box-shadow: 0 4px 16px rgba(102,126,234,0.3); transition: all 0.3s ease; }
.profile-avatar:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(102,126,234,0.4); }
.profile-main h2 { margin: 0.5rem 0 0.2rem; font-size: 1.4rem; color: #1a202c; font-weight: 600; }
.profile-main form { width: 100%; margin: 0.8rem 0; }
.profile-main label { font-weight: 600; color: #374151; display: block; margin-bottom: 0.8rem; font-size: 0.95rem; }
.profile-main input[type="text"], .profile-main input[type="password"], .profile-main input[type="file"] { width: 100%; padding: 1rem 1.2rem; border-radius: 12px; border: 2px solid rgba(102,126,234,0.2); font-size: 1rem; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); margin-bottom: 0.8rem; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.05); min-height: 52px; }
.profile-main input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 16px rgba(0,0,0,0.1); background: rgba(255,255,255,0.95); transform: translateY(-1px); }
.profile-main button { width: 100%; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 12px; padding: 1rem 0; font-size: 1rem; margin-top: 0.5rem; cursor: pointer; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 4px 16px rgba(102,126,234,0.3); min-height: 52px; }
.profile-main button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.4); background: linear-gradient(135deg, #5a67d8, #6b46c1); }

.emotion-stats { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.emotion-stat { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; background: #f7fafc; border-radius: 6px; border-left: 3px solid #4299e1; }
.emotion-stat span:first-child { font-weight: 500; color: #2d3748; }
.emotion-stat span:last-child { color: #4299e1; font-weight: 600; font-size: 0.9rem; }

.recent-days { display: flex; flex-direction: column; gap: 0.4rem; margin: 1rem 0; }
.day-stat { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; background: #edf2f7; border-radius: 6px; font-size: 0.9rem; }
.day-stat span:first-child { font-weight: 500; color: #4a5568; }
.day-stat span:last-child { color: #2d3748; }

#stats-content h3 { margin-top: 0; color: #1a202c; font-size: 1.3rem; }
#stats-content h4 { margin: 1.5rem 0 0.8rem; color: #2d3748; font-size: 1.1rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5rem; }
#stats-content p { margin: 0.8rem 0; color: #4a5568; }

/* Desktop specific styles */
@media (min-width: 601px) {
  /* Header desktop */
  .dash-header {
    position: sticky;
    top: 0;
    padding: 1rem 1.5rem;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e2e8f0;
  }
  
  .dash-header .user-info {
    position: static;
    transform: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
  }
  
  .dash-header .user-info .avatar {
    width: 40px;
    height: 40px;
    border-color: #4299e1;
  }
  
  .dash-header .header-links {
    gap: 0.5rem;
  }
  
  .dash-header .profile-link, .dash-header .status-link {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    min-width: auto;
  }
  
  .dash-header .profile-link i, .dash-header .status-link i {
    font-size: 1rem;
    margin-bottom: 0;
  }
  
  .dash-header button {
    position: static;
    transform: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    min-height: auto;
  }
  
  /* Family management desktop */
  .family-management {
    max-width: 600px;
    margin: 1.5rem auto;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
  }
  
  .family-management::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
  }
  
  .family-info-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  
  .input-group {
    max-width: 500px;
    margin: 1rem auto 0;
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    align-items: stretch;
  }
  
  .input-group input {
    font-size: 1.1rem;
    padding: 1rem 1.2rem;
    min-height: 52px;
    text-align: left;
    flex: 1;
    border: 2px solid rgba(102,126,234,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    font-family: monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  
  .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.15), 0 8px 32px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.95);
    transform: scale(1.01);
  }
  
  .input-group button {
    font-size: 1rem;
    padding: 1rem 1.5rem;
    min-height: 52px;
    white-space: nowrap;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  }
  
  .input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102,126,234,0.4);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
  }
  
  .profile-main {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
  }
  
  .profile-main h2 {
    margin: 1rem 0 2rem 0;
    font-size: 1.5rem;
    color: #1a202c;
    font-weight: 600;
  }
  
  .profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    box-shadow: 0 8px 24px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
  }
  
  .profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(102,126,234,0.4);
  }
  
  .profile-main form {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    margin: 1.5rem 0;
  }
  
  .profile-main form:first-of-type {
    margin-top: 2rem;
  }
  
  .copy-btn {
    min-height: 44px;
    padding: 0.7rem 1rem;
  }
  
  .family-current code {
    min-width: 160px;
    padding: 0.8rem 1.2rem;
  }
  
  /* Body desktop */
  body {
    background: #f8fafc;
    padding-bottom: 0;
  }
}

@media (max-width: 600px) {
  /* Mobile App-like styling */
  body { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    padding-top: 85px;
    padding-bottom: 1rem;
  }
  main { 
    padding: 1rem 1rem 2rem 1rem; 
    max-width: 100%; 
    min-height: calc(100vh - 85px);
  }
  
  /* Mobile Top Header */
  .dash-header { 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    padding: 0.75rem 1rem;
    border-radius: 0 0 20px 20px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    height: 85px;
  }
  
  .dash-header .user-info {
    position: static;
    transform: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    flex-shrink: 0;
  }
  
  .dash-header .user-info .avatar {
    border-color: #4299e1;
    width: 40px;
    height: 40px;
  }
  
  .dash-header .user-info span {
    display: none;
  }
  
  .dash-header .header-links { 
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
    justify-content: center;
  }
  
  .dash-header .profile-link, .dash-header .status-link { 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    border-radius: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 60px;
  }
  
  .dash-header .profile-link i, .dash-header .status-link i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }
  
  .dash-header .profile-link:hover, .dash-header .status-link:hover {
    background: #edf2f7;
    color: #4299e1;
    transform: translateY(-2px);
  }
  
  .dash-header .profile-link.active, .dash-header .status-link.active {
    background: #4299e1;
    color: #fff;
    transform: translateY(-2px);
  }
  
  .dash-header button {
    position: static;
    transform: none;
    padding: 0.6rem;
    border-radius: 12px;
    font-size: 1.2rem;
    min-height: 40px;
    min-width: 40px;
    flex-shrink: 0;
  }
  
  .dash-header button span {
    display: none;
  }
  
  .user-profile-link { padding: 0.3rem; }
  
  /* Card-like sections */
  #timeline-section, .profile-timeline, .profile-main, #add-section, #stats-section { 
    padding: 1.5rem; 
    margin-bottom: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
  }
  
  #timeline-section::before, .profile-timeline::before, .profile-main::before, 
  #add-section::before, #stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
  }
  
  /* Family management mobile */
  .family-management { 
    padding: 1.5rem; 
    border-radius: 20px;
    margin: 0 0 1.5rem 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
  }
  
  .family-management::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
  }
  .family-current { 
    flex-direction: column; 
    gap: 1rem; 
    align-items: stretch;
  }
  .family-current code {
    padding: 1rem 1.2rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 16px;
    min-width: auto;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
  }
  .copy-btn {
    min-height: 50px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(66,153,225,0.2);
  }
  
  /* Input group mobile improvements */
  .input-group { 
    flex-direction: column; 
    gap: 1rem; 
  }
  .input-group input { 
    min-height: 56px; 
    font-size: 1.2rem; 
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  .input-group button { 
    min-height: 56px; 
    padding: 1.2rem; 
    font-size: 1.1rem; 
    margin-top: 0;
    border-radius: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(66,153,225,0.3);
  }
  
  /* Profile forms mobile */
  .profile-main form {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
  }
  
  .profile-main form:first-of-type {
    margin-top: 2rem;
  }
  .profile-main input[type="text"], 
  .profile-main input[type="password"], 
  .profile-main input[type="file"] {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(102,126,234,0.2);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  
  .profile-main input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 16px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.95);
    transform: translateY(-1px);
  }
  
  .profile-main button {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  }
  
  .profile-main button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
  }
  
  /* Timeline mobile */
  .timeline-entry { 
    flex-wrap: wrap; 
    border-radius: 12px;
    padding: 1rem;
  }
  .timeline-entry .entry-content { 
    width: 100%; 
    margin-bottom: 0.5rem; 
  }
  .timeline-entry .entry-actions { 
    width: 100%; 
    justify-content: space-between; 
  }
  
  /* Chat messages mobile */
  .chat-message { 
    gap: 0.8rem; 
    padding: 1rem; 
    border-radius: 16px;
    margin-bottom: 1rem;
  }
  .message-avatar .avatar { 
    width: 42px; 
    height: 42px; 
  }
  .message-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.3rem; 
  }
  .message-time { order: -1; }
  
  /* Modal mobile */
  .modal-content { 
    width: 95vw; 
    padding: 1rem; 
    border-radius: 16px;
  }
  .custom-modal-content { 
    width: 95vw; 
    margin: 10vh auto; 
    border-radius: 16px;
  }
  .custom-modal-footer { 
    flex-direction: column; 
    gap: 0.8rem;
  }
  .custom-modal-footer .modal-btn { 
    width: 100%; 
    min-height: 44px;
    border-radius: 12px;
  }
  
  /* Toast mobile */
  .toast-container { 
    right: 0.5rem; 
    left: 0.5rem; 
    top: 15px;
  }
  .toast { 
    min-width: auto; 
    border-radius: 12px;
  }
  
  /* Form controls mobile */
  .form-controls { 
    flex-direction: column; 
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .form-controls select {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(102,126,234,0.2);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  
  .form-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 16px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.95);
    transform: translateY(-1px);
  }
  
  .form-controls button { 
    margin-top: 0; 
    width: 100%; 
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  }
  
  .form-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
  }
  
  /* Menu dropdown mobile */
  .menu-dropdown { 
    right: auto; 
    left: 0; 
    border-radius: 12px;
  }
  
  /* Auth container mobile */
  .auth-container { 
    padding: 2rem 1.5rem; 
    border-radius: 20px;
    margin: 1rem;
  }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.timeline-entry, #timeline-section, .profile-main, #add-section { animation: fadeIn 0.5s ease-out; } 

/* Custom Modal */
.custom-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.custom-modal-content { background: #fff; margin: 15vh auto; padding: 0; border-radius: 12px; max-width: 90vw; width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); animation: modalSlideIn 0.3s ease-out; }
.custom-modal-header { padding: 1.5rem 1.5rem 1rem; border-bottom: 1px solid #e2e8f0; }
.custom-modal-header h3 { margin: 0; font-size: 1.2rem; color: #1a202c; font-weight: 600; }
.custom-modal-body { padding: 1.5rem; }
.custom-modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #e2e8f0; display: flex; gap: 0.8rem; justify-content: flex-end; }
.custom-modal input, .custom-modal textarea, .custom-modal select { width: 100%; padding: 0.8rem 1rem; border-radius: 8px; border: 2px solid #e2e8f0; font-size: 1rem; background: #fff; transition: all 0.2s ease; font-family: inherit; margin-bottom: 0.8rem; }
.custom-modal input:focus, .custom-modal textarea:focus, .custom-modal select:focus { outline: none; border-color: #4299e1; box-shadow: 0 0 0 3px rgba(66,153,225,0.1); }
.custom-modal textarea { min-height: 80px; resize: vertical; }
.modal-btn { padding: 0.6rem 1.2rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; border: none; }
.modal-btn-primary { background: #4299e1; color: #fff; }
.modal-btn-primary:hover { background: #3182ce; transform: translateY(-1px); }
.modal-btn-secondary { background: #e2e8f0; color: #4a5568; }
.modal-btn-secondary:hover { background: #cbd5e0; }
.modal-btn-danger { background: #e53e3e; color: #fff; }
.modal-btn-danger:hover { background: #c53030; transform: translateY(-1px); }

@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-50px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Toast notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; }
.toast { background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 1rem 1.2rem; margin-bottom: 0.5rem; min-width: 280px; border-left: 4px solid #4299e1; animation: toastSlideIn 0.3s ease-out; }
.toast.success { border-left-color: #38a169; }
.toast.error { border-left-color: #e53e3e; }
.toast.warning { border-left-color: #ed8936; }
.toast-content { display: flex; align-items: center; gap: 0.8rem; }
.toast-icon { font-size: 1.1rem; }
.toast.success .toast-icon { color: #38a169; }
.toast.error .toast-icon { color: #e53e3e; }
.toast.warning .toast-icon { color: #ed8936; }
.toast-message { flex: 1; font-size: 0.9rem; color: #2d3748; }

@keyframes toastSlideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastSlideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } } 

/* App-like animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.9); }
  50% { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Apply animations */
.family-management { animation: slideUp 0.6s ease-out; }
.profile-main form { animation: slideUp 0.4s ease-out; }
.chat-message { animation: slideUp 0.3s ease-out; }
.toast { animation: bounceIn 0.4s ease-out; }

/* Interactive feedback */
.input-group input:focus {
  transform: scale(1.01);
}

.input-group button:active,
.profile-main button:active,
.copy-btn:active {
  transform: scale(0.98);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better touch targets for mobile */
@media (max-width: 600px) {
  /* Ensure all interactive elements are at least 44px */
  button, .copy-btn, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Add haptic-like feedback */
  button:active, .copy-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* Improve readability */
  .family-current code {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
  }
  
  /* Better spacing for thumbs */
  .input-group {
    gap: 1rem;
  }
  
  .family-current {
    gap: 1rem;
  }
} 

 

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #667eea;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Improved Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Enhanced Focus States */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Micro Interactions */
.chat-message {
  transform-origin: center;
}

.chat-message:active {
  transform: scale(0.98);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #1a202c;
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #374151;
}

.message-author {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

/* Enhanced Emotion Badges */
.emotion-badge {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.emotion-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Enhanced Image Previews */
.message-image img,
.image-preview img {
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.5);
}

.message-image img:hover {
  transform: scale(1.02);
  border-color: #667eea;
  box-shadow: 0 8px 32px rgba(102,126,234,0.2);
}

/* Professional Form Styling */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Enhanced Button Variants */
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(102,126,234,0.4);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.btn-secondary {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  color: #374151;
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.95);
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Status Indicators */
.status-online {
  position: relative;
}

.status-online::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.4s ease-out;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .chat-message {
    border: 2px solid #000;
  }
  
  .btn-primary {
    background: #000;
    color: #fff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Loading Placeholder */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #6b7280;
  font-size: 1rem;
  gap: 0.8rem;
}

.loading-placeholder i {
  font-size: 1.2rem;
  color: #667eea;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #6b7280;
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Enhanced Trade Cards */
.trade-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.95);
}

.trade-card .trade-info {
  flex: 1;
  line-height: 1.5;
}

.trade-card .trade-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.trade-card button {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.trade-card button:hover {
  background: rgba(102,126,234,0.1);
  color: #667eea;
  transform: scale(1.1);
}

.trade-card .delete-btn:hover {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

/* Enhanced Stats Modal */
#stats-content {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

#stats-content table {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

#stats-content th {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 600;
  padding: 1rem;
}

#stats-content td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

#stats-content tr:last-child td {
  border-bottom: none;
}

/* Professional Typography Scale */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Color Utilities */
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }

.text-primary { color: #667eea; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-error { color: #ef4444; }

/* Spacing Utilities */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Enhanced Responsive Design */
@media (max-width: 480px) {
  .trade-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .trade-card .trade-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .modal-content {
    margin: 2vh auto;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Print Styles */
@media print {
  body {
    background: white !important;
  }
  
  .dash-header,
  .modal,
  .toast-container,
  button {
    display: none !important;
  }
  
  .chat-message,
  .trade-card {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }
}
  /* Mobile Profile Specific */
  .profile-main {
    text-align: center;
    padding: 2rem 1.5rem;
  }
  
  .profile-main h2 {
    margin: 1.5rem 0 2rem 0;
    font-size: 1.4rem;
    color: #1a202c;
    font-weight: 600;
  }
  
  .profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    box-shadow: 0 8px 24px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
  }
  
  .profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(102,126,234,0.4);
  }
  
  /* Mobile Stats Section */
  #stats-section {
    text-align: center;
  }
  
  #stats-section button {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(237,137,54,0.3);
  }
  
  #stats-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237,137,54,0.4);
    background: linear-gradient(135deg, #dd6b20, #c05621);
  }
  
  /* Mobile Image Upload */
  .image-upload-section {
    margin: 1.5rem 0;
  }
  
  .image-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: rgba(247,250,252,0.9);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(102,126,234,0.3);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4a5568;
    font-weight: 500;
    min-height: 60px;
  }
  
  .image-upload-label:hover {
    background: rgba(237,242,247,0.9);
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
  }
  
  .image-upload-label i {
    font-size: 1.2rem;
  }
  
  /* Mobile Family Info Card */
  .family-info-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  
  .family-current {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
  }
  
  .family-current strong {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
  }
  
  .family-current code {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 12px;
    min-width: auto;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    color: #fff;
    font-family: 'SF Mono', 'Monaco', monospace;
  }
  
  .copy-btn {
    min-height: 48px;
    min-width: 48px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(66,153,225,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
  }
  
  .family-help {
    text-align: center;
    margin: 1rem 0 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  /* Mobile Form Labels */
  .profile-main label,
  #add-section label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    text-align: left;
  }
  
  /* Mobile Textarea */
  #entry-content {
    min-height: 120px;
    border-radius: 12px;
    border: 2px solid rgba(102,126,234,0.2);
    padding: 1.2rem;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    resize: vertical;
    font-family: inherit;
  }
  
  #entry-content:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 16px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.95);
    transform: translateY(-1px);
  }
}
/* Join Family Section */
.join-family-section {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.join-family-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #1a202c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.join-family-section h4 i {
  color: #667eea;
}

.join-family-description {
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.form-help {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(102,126,234,0.05);
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.help-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.4;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-item i {
  color: #667eea;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.help-item code {
  background: rgba(102,126,234,0.1);
  color: #667eea;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
}

.btn-join {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 1rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  white-space: nowrap !important;
}

.btn-join:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(16,185,129,0.4) !important;
  background: linear-gradient(135deg, #059669, #047857) !important;
}

/* Current Family Info */
.current-family-header h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #1a202c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-family-header h4 i {
  color: #667eea;
}

.family-code-display {
  margin-bottom: 1.5rem;
}

.family-code-display label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

.code-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.code-actions {
  display: flex;
  gap: 0.5rem;
}

.refresh-btn {
  background: #10b981 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0.7rem 1rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-size: 1rem !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.refresh-btn:hover {
  background: #059669 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3) !important;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .code-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .code-actions {
    justify-content: center;
  }
  
  .btn-join span {
    display: inline;
  }
  
  .help-item {
    flex-direction: row;
    align-items: flex-start;
  }
}
/* Profile Forms Redesign */
.profile-forms {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto 0;
}

.form-section {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 16px 16px 0 0;
}

.form-section h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.2rem;
  color: #1a202c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.form-section h3 i {
  color: #667eea;
  font-size: 1.1rem;
}

.profile-form {
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-of-type {
  margin-bottom: 2rem;
}

.profile-form label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-form label i {
  color: #667eea;
  width: 16px;
}

.profile-form input[type="text"],
.profile-form input[type="password"] {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 2px solid rgba(102,126,234,0.2);
  font-size: 1rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  min-height: 52px;
}

.profile-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 16px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
}

.profile-form input::placeholder {
  color: #9ca3af;
  font-size: 0.95rem;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.btn-primary.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

.btn-primary.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
}

/* File Input Styling */
.file-input-wrapper {
  position: relative;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.5rem;
  border: 2px dashed rgba(102,126,234,0.3);
  border-radius: 12px;
  background: rgba(247,250,252,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 80px;
}

.file-input-display:hover {
  border-color: #667eea;
  background: rgba(237,242,247,0.9);
  transform: translateY(-1px);
}

.file-input-display i {
  font-size: 1.5rem;
  color: #667eea;
}

.file-input-display span {
  color: #4a5568;
  font-weight: 500;
}

/* Form Hints */
.form-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.form-hint i {
  color: #667eea;
  flex-shrink: 0;
}

.password-requirements {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(102,126,234,0.05);
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .profile-forms {
    margin-top: 1rem;
  }
  
  .form-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .form-section h3 {
    font-size: 1.1rem;
  }
  
  .btn-primary {
    padding: 1rem 1.5rem;
  }
  
  .file-input-display {
    padding: 1.2rem;
    min-height: 70px;
  }
  
  .file-input-display i {
    font-size: 1.3rem;
  }
}
/* Join Family Form Styling */
.join-family-section .profile-form {
  margin-top: 1rem;
}

.btn-primary.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.btn-primary.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

.security-notice {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(251,191,36,0.1);
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.notice-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 500;
}

.notice-content i {
  color: #f59e0b;
  flex-shrink: 0;
}

/* Override input-group for join family */
.join-family-section .input-group {
  display: block;
}

.join-family-section .input-group input {
  width: 100%;
  margin-bottom: 0;
}

/* Remove old join family styles */
.btn-join {
  display: none !important;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .security-notice {
    margin: 1rem 0;
    padding: 0.8rem;
  }
  
  .notice-content {
    font-size: 0.85rem;
  }
}
/* Status Management Section */
#manage-section {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

#manage-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 20px 20px 0 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #1a202c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-header h3 i {
  color: #667eea;
}

.section-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.date-filter {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 2px solid rgba(102,126,234,0.2);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.date-filter:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.btn-secondary {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  color: #374151;
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.95);
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Status List */
.status-list {
  max-height: 500px;
  overflow-y: auto;
}

.status-item {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  animation: fadeInUp 0.4s ease-out;
}

.status-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.9);
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.status-time {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.status-emotion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-content {
  color: #374151;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.status-image {
  margin: 0.8rem 0;
}

.status-image img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.status-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.status-actions button {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.status-actions .edit-btn:hover {
  background: rgba(102,126,234,0.1);
  color: #667eea;
}

.status-actions .delete-btn:hover {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

/* Edit Modal */
#edit-modal .modal-content {
  max-width: 500px;
}

#edit-modal h3 {
  margin: 0 0 1.5rem 0;
  color: #1a202c;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

#edit-modal h3 i {
  color: #667eea;
}

#edit-modal .form-group {
  margin-bottom: 1.5rem;
}

#edit-modal label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

#edit-modal textarea,
#edit-modal select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 2px solid rgba(102,126,234,0.2);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-family: inherit;
}

#edit-modal textarea {
  min-height: 100px;
  resize: vertical;
}

#edit-modal textarea:focus,
#edit-modal select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-actions button {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

/* Empty State */
.empty-status {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
}

.empty-status i {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-status p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .section-actions {
    justify-content: space-between;
  }
  
  .status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .status-actions {
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions button {
    width: 100%;
  }
}
/* Confirm Modal */
#confirm-modal .modal-content {
  max-width: 400px;
  text-align: center;
}

#confirm-modal h3 {
  margin: 0 0 1rem 0;
  color: #ef4444;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

#confirm-modal h3 i {
  color: #f59e0b;
}

#confirm-modal p {
  margin: 0 0 1.5rem 0;
  color: #374151;
  font-size: 1rem;
  line-height: 1.5;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 4px 16px rgba(239,68,68,0.3) !important;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  box-shadow: 0 6px 20px rgba(239,68,68,0.4) !important;
}
/* Master Admin Styles */
.admin-section {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.admin-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 16px 16px 0 0;
}

.admin-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1a202c;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.admin-section h3 i {
  color: #667eea;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.admin-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 0.5rem 0.5rem 0.5rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.admin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* User List */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.user-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #667eea;
}

.user-details {
  line-height: 1.4;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

/* Backup List */
.backup-actions {
  margin: 1rem 0;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.3);
}

.backup-info {
  line-height: 1.4;
}

.backup-actions a {
  text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .user-item,
  .backup-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .user-actions,
  .backup-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
/* Backup Actions Styling */
.backup-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.backup-actions .btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.backup-actions .btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.backup-actions .btn-secondary {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  color: #374151;
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.backup-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.95);
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Loading state for confirm button */
#confirm-action:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Mobile backup actions */
@media (max-width: 600px) {
  .backup-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  
  .backup-actions button,
  .backup-actions a {
    width: 100%;
    justify-content: center;
  }
}
/* App Lock Styles */
#lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lock-container {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  max-width: 350px;
  width: 90%;
}

.lock-avatar {
  margin-bottom: 1rem;
}

.lock-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #667eea;
  box-shadow: 0 8px 24px rgba(102,126,234,0.3);
}

.lock-container h2 {
  margin: 0.5rem 0;
  color: #1a202c;
  font-size: 1.3rem;
  font-weight: 600;
}

.lock-container p {
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.passcode-input {
  margin: 1.5rem 0;
}

.passcode-input input {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid rgba(102,126,234,0.2);
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.5rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.passcode-input input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
  transform: translateY(-1px);
}

#unlock-form button {
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

#unlock-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.lock-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.logout-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.logout-btn:hover {
  color: #ef4444;
}

/* Switch Toggle */
.switch-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-weight: 500;
  color: #374151;
}

.switch-label input[type="checkbox"] {
  display: none;
}

.switch-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: #cbd5e0;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-label input:checked + .switch-slider {
  background: #667eea;
}

.switch-label input:checked + .switch-slider::before {
  transform: translateX(26px);
}

/* Lock Settings Modal */
#lock-settings-modal .modal-content {
  max-width: 450px;
}

#lock-settings-modal .form-group {
  margin-bottom: 1.5rem;
}

#lock-settings-modal label:not(.switch-label) {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

#lock-settings-modal input[type="password"],
#lock-settings-modal select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 2px solid rgba(102,126,234,0.2);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

#lock-settings-modal input:focus,
#lock-settings-modal select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* Mobile Lock Screen */
@media (max-width: 600px) {
  .lock-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .lock-avatar img {
    width: 70px;
    height: 70px;
  }
  
  .lock-container h2 {
    font-size: 1.2rem;
  }
  
  .passcode-input input {
    font-size: 1.1rem;
    letter-spacing: 0.3rem;
  }
}
/* Mobile Timeline Optimization */
@media (max-width: 600px) {
  .chat-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }
  
  .message-content {
    width: 100%;
    min-width: 0;
  }
  
  .message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Image optimization for mobile */
  .message-image {
    margin: 0.8rem 0;
    width: 100%;
    max-width: 100%;
  }
  
  .message-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  
  .message-image img:hover {
    transform: scale(1.02);
  }
  
  /* Avatar mobile */
  .message-avatar {
    flex-shrink: 0;
    margin-right: 0.8rem;
  }
  
  .message-avatar img {
    width: 40px;
    height: 40px;
  }
  
  /* Header mobile */
  .message-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
  }
  
  .message-author {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .message-time {
    font-size: 0.8rem;
    color: #6b7280;
  }
  
  .emotion-badge {
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
  }
  
  /* Timeline container mobile */
  #timeline-list {
    padding: 0 0.5rem;
  }
  
  /* Family info mobile */
  .family-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
  }
  
  .family-summary {
    font-size: 0.9rem;
    text-align: center;
    color: #4a5568;
  }
}

/* Image Modal Mobile */
@media (max-width: 600px) {
  .image-modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
  
  .image-modal-content img {
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
  }
  
  .image-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Status Image Mobile Optimization */
@media (max-width: 600px) {
  .status-image {
    margin: 0.8rem 0;
    width: 100%;
  }
  
  .status-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
  }
  
  .status-item {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .status-content {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    word-wrap: break-word;
  }
}

/* Loading and Empty States Mobile */
@media (max-width: 600px) {
  .loading-placeholder {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
  }
  
  .empty-state {
    padding: 3rem 1rem;
    text-align: center;
  }
  
  .empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  
  .empty-state p {
    font-size: 0.9rem;
  }
}
/* Emotion Selector */
.emotion-selector {
  margin: 1.5rem 0;
}

.emotion-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.emotion-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: #f0f2f5;
  border-radius: 20px;
  overflow-x: auto;
}

.emotion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
  flex-shrink: 0;
  position: relative;
}

.emotion-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.emotion-btn:hover::before {
  opacity: 1;
}

.emotion-btn:hover {
  background: rgba(255,255,255,0.8);
  transform: scale(1.1);
}

.emotion-btn.selected {
  background: #1877f2;
  transform: scale(1.1);
}

.emotion-btn.selected::before {
  opacity: 0;
}

.emotion-btn .emoji {
  font-size: 24px;
  margin-bottom: 4px;
  display: block;
  line-height: 1;
  filter: grayscale(0.3);
  transition: filter 0.2s ease;
}

.emotion-btn:hover .emoji,
.emotion-btn.selected .emoji {
  filter: grayscale(0);
}

.emotion-btn .label {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1;
  color: #65676b;
  transition: color 0.2s ease;
}

.emotion-btn.selected .label {
  color: white;
  font-weight: 600;
}

/* Mobile emotion selector */
@media (max-width: 600px) {
  .emotion-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
  }
  
  .emotion-btn {
    padding: 0.8rem 0.3rem;
    min-height: 70px;
  }
  
  .emotion-btn .emoji {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
  }
  
  .emotion-btn .label {
    font-size: 0.7rem;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .emotion-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .emotion-btn {
    padding: 0.6rem 0.2rem;
    min-height: 65px;
  }
  
  .emotion-btn .emoji {
    font-size: 1.3rem;
  }
  
  .emotion-btn .label {
    font-size: 0.65rem;
  }
}
/* Professional Mobile Timeline (Instagram/Facebook-like) */
@media (max-width: 600px) {
  /* Remove container padding on mobile */
  main {
    padding: 0;
    margin: 0;
  }
  
  #timeline-section {
    padding: 0;
    margin: 0;
  }
  
  #timeline-list {
    padding: 0;
    margin: 0;
  }
  
  /* Full-width timeline items */
  .chat-message {
    margin: 0 0 1px 0;
    padding: 1rem;
    border-radius: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
  }
  
  .chat-message:last-child {
    border-bottom: none;
  }
  
  /* Family info full-width */
  .family-info {
    margin: 0 0 1px 0;
    padding: 1rem;
    border-radius: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .family-summary {
    font-size: 0.9rem;
    text-align: center;
    color: #6b7280;
    font-weight: 500;
  }
  
  /* Message content optimization */
  .message-content {
    width: 100%;
    min-width: 0;
  }
  
  .message-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
    margin-bottom: 0.8rem;
  }
  
  /* Avatar styling */
  .message-avatar {
    flex-shrink: 0;
    margin-right: 1rem;
  }
  
  .message-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
  }
  
  /* Header styling */
  .message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .message-author {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
  }
  
  .message-time {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 400;
  }
  
  .emotion-badge {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    background: rgba(102,126,234,0.1);
    color: #667eea;
    font-weight: 500;
  }
  
  /* Image full-width */
  .message-image {
    margin: 0.8rem -1rem;
    width: calc(100% + 2rem);
  }
  
  .message-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
  }
  
  /* Header mobile adjustment */
  .dash-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #e5e7eb;
    padding: 0.8rem 1rem;
  }
  
  /* Loading and empty states */
  .loading-placeholder {
    padding: 3rem 1rem;
    text-align: center;
    background: #fff;
    color: #6b7280;
  }
  
  .empty-state {
    padding: 4rem 1rem;
    text-align: center;
    background: #fff;
  }
  
  .empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
  }
  
  .empty-state p {
    color: #6b7280;
    font-size: 1rem;
  }
  
  /* Remove body padding on mobile */
  body {
    margin: 0;
    padding: 0;
  }
  
  /* Ensure full viewport usage */
  .chat-message {
    min-height: auto;
    display: flex;
    align-items: flex-start;
  }
  
  /* Status items full-width */
  .status-item {
    margin: 0 0 1px 0;
    padding: 1rem;
    border-radius: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .status-image {
    margin: 0.8rem -1rem;
    width: calc(100% + 2rem);
  }
  
  .status-image img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 0;
  }
}
/* Professional Timeline Layout */
@media (max-width: 600px) {
  /* Professional timeline post */
  .chat-message {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: #fff;
    border-bottom: 8px solid #f3f4f6;
    box-shadow: none;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    display: block;
  }
  
  /* Post header with avatar and name */
  .post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
  }
  
  .post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 1px solid #e5e7eb;
  }
  
  .post-user-info {
    flex: 1;
  }
  
  .post-username {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.2;
  }
  
  .post-time {
    font-size: 12px;
    color: #9ca3af;
    margin: 2px 0 0 0;
    line-height: 1;
  }
  
  .post-emotion {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(102,126,234,0.1);
    color: #667eea;
    font-weight: 500;
    margin-left: 8px;
  }
  
  /* Post content */
  .post-content {
    padding: 0 16px 12px 16px;
    background: #fff;
  }
  
  .post-text {
    font-size: 15px;
    line-height: 1.4;
    color: #1f2937;
    margin: 0;
    word-wrap: break-word;
  }
  
  /* Post image - full width */
  .post-image {
    width: 100%;
    margin: 12px 0 0 0;
    background: #000;
  }
  
  .post-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    cursor: pointer;
  }
  
  /* Hide old structure on mobile */
  .message-avatar,
  .message-content,
  .message-header {
    display: none;
  }
}
/* Universal Timeline Layout (Desktop + Mobile) */
.chat-message {
  margin: 0 auto 16px auto;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 600px;
  display: block;
  overflow: hidden;
}

/* Post header with avatar and name */
.post-header {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-right: 12px;
  border: 2px solid #e5e7eb;
  object-fit: cover;
}

.post-user-info {
  flex: 1;
}

.post-username {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.2;
}

.post-time {
  font-size: 13px;
  color: #9ca3af;
  margin: 2px 0 0 0;
  line-height: 1;
}

.post-emotion {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(102,126,234,0.1);
  color: #667eea;
  font-weight: 500;
  margin-left: 12px;
}

/* Post content */
.post-content {
  padding: 0 16px 16px 16px;
  background: #fff;
}

.post-text {
  font-size: 15px;
  line-height: 1.5;
  color: #1f2937;
  margin: 0;
  word-wrap: break-word;
}

/* Post image */
.post-image {
  width: 100%;
  margin: 16px 0 0 0;
  background: #000;
}

.post-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

/* Family info */
.family-info {
  margin: 0 auto 16px auto;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  max-width: 600px;
}

.family-summary {
  font-size: 14px;
  text-align: center;
  color: #6b7280;
  font-weight: 500;
  margin: 0;
}

/* Hide old message structure */
.message-avatar,
.message-content,
.message-header {
  display: none !important;
}

/* Mobile specific adjustments */
@media (max-width: 600px) {
  /* Remove container padding on mobile */
  main {
    padding: 0;
    margin: 0;
  }
  
  #timeline-section {
    padding: 0;
    margin: 0;
  }
  
  #timeline-list {
    padding: 0 8px;
    margin: 0;
  }
  
  /* Full-width on mobile */
  .chat-message {
    margin: 0 0 8px 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 8px solid #f3f4f6;
    max-width: none;
  }
  
  .family-info {
    margin: 0 0 8px 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 8px solid #f3f4f6;
    max-width: none;
  }
  
  /* Adjust header on mobile */
  .post-header {
    padding: 12px 16px;
    border-bottom: none;
  }
  
  .post-avatar {
    width: 40px;
    height: 40px;
  }
  
  .post-username {
    font-size: 14px;
  }
  
  .post-time {
    font-size: 12px;
  }
  
  .post-emotion {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  /* Content on mobile */
  .post-content {
    padding: 0 16px 12px 16px;
  }
  
  /* Image full-width on mobile */
  .post-image {
    margin: 12px 0 0 0;
  }
  
  .post-image img {
    max-height: 400px;
  }
}

/* Desktop specific adjustments */
@media (min-width: 601px) {
  main {
    padding: 20px;
  }
  
  #timeline-section {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  
  #timeline-list {
    padding: 0;
  }
  
  .chat-message {
    max-width: none;
    width: 100%;
  }
  
  .family-info {
    max-width: none;
    width: 100%;
  }
  
  /* Desktop hover effects */
  .chat-message:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-1px);
    transition: all 0.3s ease;
  }
  
  .post-image img:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
  }
}
/* Facebook-like Emotion Popup */
.emotion-selector {
  margin: 1.5rem 0;
  position: relative;
}

.emotion-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f0f2f5;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-size: 15px;
  color: #65676b;
}

.emotion-trigger:hover {
  background: #e4e6ea;
}

.emotion-icon {
  font-size: 20px;
}

.emotion-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
}

.emotion-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 4px;
  display: none;
  animation: popupSlideIn 0.2s ease-out;
}

.emotion-popup.show {
  display: block;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emotion-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
}

.emotion-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 60px;
}

.emotion-option:hover {
  background: #f0f2f5;
  transform: scale(1.05);
}

.emotion-option .emoji {
  font-size: 18px;
  margin-bottom: 2px;
  line-height: 1;
}

.emotion-option .label {
  font-size: 9px;
  color: #65676b;
  font-weight: 500;
  text-align: center;
  line-height: 1.1;
}

/* Mobile optimization */
@media (max-width: 600px) {
  .emotion-options {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .emotion-option {
    padding: 6px 2px;
    min-height: 50px;
  }
  
  .emotion-option .emoji {
    font-size: 16px;
  }
  
  .emotion-option .label {
    font-size: 8px;
  }
}
/* Access Logs Styles */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
  max-height: 400px;
  overflow-y: auto;
}

.log-item {
  padding: 0.8rem;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 0.9rem;
}

.log-main {
  font-weight: 500;
  color: #1a202c;
  margin-bottom: 0.3rem;
}

.log-details {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.log-time {
  color: #4a5568;
}

.log-ip {
  color: #667eea;
  font-family: monospace;
}

.log-country {
  color: #38a169;
  font-weight: 500;
}

.log-actions {
  margin: 1rem 0;
}

/* Mobile logs */
@media (max-width: 600px) {
  .log-details {
    flex-direction: column;
    gap: 0.2rem;
  }
  
  .logs-list {
    max-height: 300px;
  }
}