/* WOW App — mobile-first styles */

body {
  background: #f0f2f5;
  font-size: 16px;
}

#app-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 0 80px;
}

/* Title bar */
.wow-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a2e;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wow-topbar .brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Cards */
.wow-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 20px 16px;
  margin: 16px 12px;
}


/* Topbar icon-only buttons */
.btn-topbar {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.btn-topbar:disabled { opacity: .55; cursor: not-allowed; }

/* Big full-width buttons */
.btn-wow {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  margin-bottom: 10px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-wow:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn-primary-wow  { background: #1a1a2e; color: #fff; }
.btn-success-wow  { background: #198754; color: #fff; }
.btn-danger-wow   { background: #dc3545; color: #fff; }
.btn-secondary-wow{ background: #6c757d; color: #fff; }
.btn-outline-wow  { background: transparent; border: 2px solid #1a1a2e; color: #1a1a2e; }
.btn-info-wow     { background: #0dcaf0; color: #000; }

/* Inputs */
.form-control-wow {
  display: block;
  width: 100%;
  padding: 13px 12px;
  font-size: 1rem;
  border: 1.5px solid #ced4da;
  border-radius: 8px;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color .15s;
}
.form-control-wow:focus {
  outline: none;
  border-color: #1a1a2e;
}
.form-label-wow {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

/* Alert/toast */
#alert-area {
  margin: 0 12px;
}
.wow-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.wow-alert-success { background: #d1e7dd; color: #0a3622; }
.wow-alert-danger  { background: #f8d7da; color: #58151c; }

/* Loading overlay */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.65);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
#loading-overlay.active {
  display: flex;
}


/* Messaging */
.message-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ffc107;
  color: #000;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.message-thread {
  margin: 0 8px 8px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding-bottom: 200px;
}

.message-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  flex-direction: column;
}

.message-item:last-child {
  border-bottom: none;
}

.message-from-admin {
  background: #f0f7ff;
  align-items: flex-end;
  margin-left: auto;
  max-width: 80%;
  text-align: right;
}

.message-from-user {
  background: #f9f9f9;
  align-items: flex-start;
}

.message-header {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.message-text {
  font-size: 0.95rem;
  color: #333;
  word-wrap: break-word;
  line-height: 1.3;
}

.message-timestamp {
  font-size: 0.75rem;
  color: #999;
  margin-top: 3px;
}

.message-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f0f2f5;
  padding: 8px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  z-index: 10;
}

/* Message loading spinner */
.message-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #0dcaf0;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
