/* CrisisHub — Global Styles v4.0 — Enhanced UI/UX */
*, *::before, *::after { box-sizing: border-box; }

/* Allow scroll on auth page */
html { overflow-y: auto; }
body { overflow-y: auto; margin: 0; }

/* Tailwind custom config via CDN */
:root {
  --wavestone: #451DC7;
  --wavestone-dark: #25106B;
  --wavestone-light: #6B45E8;
  --wavestone-pale: #EDE9FF;
  --shadow-soft: 0 4px 20px rgba(69,29,199,0.08);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-elevated: 0 10px 40px rgba(69,29,199,0.12), 0 2px 8px rgba(0,0,0,0.04);
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Custom scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(69,29,199,0.2); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(69,29,199,0.4); }

/* Toasts */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.25rem; border-radius: 14px;
  font-size: 0.875rem; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  pointer-events: auto; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.fade-in { animation: fadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Gradient */
.wave-gradient { background: linear-gradient(135deg, #5B2FE8 0%, #25106B 100%); }

/* Progress bar */
.progress-bar { transition: width 0.5s ease; }

/* Status live pulse */
.status-live { animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Post card hover */
.post-card {
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  border-radius: var(--radius-lg);
}
.post-card:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-2px);
}

/* Injection row */
.injection-row {
  transition: box-shadow 0.15s ease, background 0.15s ease;
  border-left-width: 4px;
  border-radius: var(--radius-lg);
}
.injection-row:hover {
  box-shadow: var(--shadow-card);
  background: #faf8ff;
}

/* Injection pill */
.injection-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600;
}

/* Modal overlay */
.modal-overlay { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-box {
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-height: 90vh; overflow-y: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}
@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Reply input hidden state */
.reply-box { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.reply-box.hidden { display: none; }

/* Platform tab active */
.platform-tab-active { border-bottom: 2px solid var(--wavestone); color: var(--wavestone); font-weight: 700; }
.platform-tab { border-bottom: 2px solid transparent; color: #6b7280; font-weight: 500; }

/* Filter bar */
.filter-chip {
  padding: 4px 12px; border-radius: 9999px; font-size: 11px; font-weight: 600;
  border: 1.5px solid #e5e7eb; cursor: pointer; transition: all 0.2s ease;
  background: white;
}
.filter-chip.active {
  background: var(--wavestone); color: white; border-color: var(--wavestone);
  box-shadow: 0 2px 8px rgba(69,29,199,0.3);
}
.filter-chip:hover:not(.active) { border-color: var(--wavestone); color: var(--wavestone); }

/* Noise toggle */
.noise-toggle {
  position: relative; display: inline-flex; align-items: center;
  width: 44px; height: 24px; border-radius: 9999px; cursor: pointer;
  transition: background 0.25s ease;
}
.noise-toggle .thumb {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.noise-toggle.on { background: var(--wavestone); }
.noise-toggle.off { background: #d1d5db; }
.noise-toggle.on .thumb  { transform: translateX(22px); }
.noise-toggle.off .thumb { transform: translateX(3px); }

/* Admin h-screen layout */
.admin-layout {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Player layout */
.player-layout {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Enhanced card styles */
.card-enhanced {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.card-enhanced:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

/* Glass morphism */
.glass {
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
}

/* Input focus enhancement */
input:focus, textarea:focus, select:focus {
  border-color: var(--wavestone-light) !important;
  box-shadow: 0 0 0 3px rgba(69,29,199,0.1) !important;
}

/* Button ripple effect */
button {
  position: relative;
  overflow: hidden;
}

/* Nav tabs smooth transition */
nav button {
  transition: all 0.2s ease !important;
}

/* Chat bubble styles */
.chat-bubble-me {
  background: linear-gradient(135deg, #451DC7, #6B45E8);
  color: white;
  border-radius: 18px 18px 4px 18px;
}
.chat-bubble-other {
  background: #f3f4f6;
  color: #1f2937;
  border-radius: 18px 18px 18px 4px;
}

/* Press card newspaper styling */
.press-card-news {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.press-card-news:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

/* Spinner */
.ch-spinner {
  width: 32px; height: 32px;
  border: 3px solid #e0d9ff;
  border-top-color: #451DC7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Smooth page transitions */
#app > div {
  animation: pageIn 0.3s ease-out;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* KPI card counter animation */
@keyframes countIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.kpi-count {
  animation: countIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Sidebar hover effects */
.sidebar-item { transition: all 0.15s ease; }
.sidebar-item:hover { background: rgba(255,255,255,0.12); }
.sidebar-item.active { background: rgba(255,255,255,0.18); }

/* Better select styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, #451DC7, #6B45E8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
