.inbox-avatar, .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #a259c4, #b47ac7); /* fallback, can be overridden by gradient classes */
}
/* ========================================
   ReadAgora - Global Theme Styles
   ======================================== */

/* Import comprehensive color theme system */
@import url('theme-colors.css');

/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding-bottom: 70px;
}

/* Ensure all text is visible by default */
p, span, div, label, li {
  color: inherit;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.action-icon {
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
}

.action-icon:hover {
  color: var(--accent-primary);
}

.back-btn {
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--accent-primary);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 24px;
  font-weight: bold;
}

.back-btn {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* === BUTTONS === */
.btn {
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color-light);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-icon {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  border: none;
  cursor: pointer;
}

/* === FORMS === */
.input-group {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.input-field {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
}

textarea.input-field {
  min-height: 100px;
  resize: vertical;
}

select.input-field {
  cursor: pointer;
}

/* === CARDS === */
.card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.card:hover {
  background: var(--bg-tertiary);
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.tab.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.badge-primary {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-error {
  background: var(--error-color);
  color: white;
}

/* === TOGGLE SWITCH === */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 30px;
  background: var(--border-color-light);
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: var(--accent-primary);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
  transform: translateX(22px);
}

/* === AVATARS === */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* === STORY CARDS === */
.story-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.story-card:hover {
  transform: translateY(-4px);
}

.story-cover {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.story-title {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* === TAGS === */
.tag {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-tertiary);
}

.empty-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: var(--bg-quaternary);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.bottom-nav span {
  color: var(--text-tertiary);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.3s;
}

.bottom-nav span:hover {
  color: var(--text-secondary);
}

.bottom-nav .active {
  color: var(--accent-primary);
}

/* === MODALS === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 16px;
}

.modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* === LOADING SPINNER === */
.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 0.3s;
}

/* === SEARCH BAR === */
.search-bar {
  padding: 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.search-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: white;
  padding: 12px 16px 12px 44px;
  border-radius: 8px;
  font-size: 15px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
}

/* === ALERTS === */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-success {
  background: var(--bg-transparent-success);
  border-left: 4px solid var(--success-color);
  color: var(--success-color);
}

.alert-error {
  background: var(--bg-transparent-error);
  border-left: 4px solid var(--error-color);
  color: var(--error-color);
}

.alert-warning {
  background: var(--bg-transparent-warning);
  border-left: 4px solid var(--warning-color);
  color: var(--warning-color);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-title {
    font-size: 20px;
  }
  
  .modal {
    padding: 24px;
  }
  
  .btn {
    padding: 10px 24px;
  }
}

/* === UTILITIES === */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* === THEME UTILITY CLASSES === */
.bg-accent-primary {
  background: var(--accent-primary) !important;
}

.bg-accent-secondary {
  background: var(--accent-secondary) !important;
}

.bg-accent-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
}

.bg-accent-gradient-90 {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)) !important;
}

.bg-accent-gradient-top {
  background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary)) !important;
}

.bg-accent-gradient-right {
  background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary)) !important;
}

.color-accent {
  color: var(--accent-primary) !important;
}

.border-accent {
  border-color: var(--accent-primary) !important;
}

/* === GRADIENT BACKGROUNDS === */
.gradient-purple {
  background: linear-gradient(135deg, #9c27b0, #ab47bc);
}

.gradient-pink {
  background: linear-gradient(135deg, #e91e63, #f06292);
}

.gradient-blue {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
}

.gradient-green {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.gradient-orange {
  background: linear-gradient(135deg, #ff6a00, #ff8c42);
}

.gradient-amber {
  background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.gradient-cyan {
  background: linear-gradient(135deg, #00bcd4, #4dd0e1);
}

.gradient-deep-purple {
  background: linear-gradient(135deg, #673ab7, #9575cd);
}
