/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

:root {
  --pwr-navy: #0b1f3a;
  --pwr-navy-dark: #071327;
  --pwr-red: #991b1b;
  --pwr-red-bright: #dc2626;
  --pwr-gold: #f59e0b;
  --pwr-gold-bright: #fbbf24;

  --bg-gradient: radial-gradient(circle at 20% 20%, rgba(11, 31, 58, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(153, 27, 27, 0.25) 0%, transparent 50%),
    #071327;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  --bot-bubble-bg: #ffffff;
  --user-bubble-bg: linear-gradient(135deg, #0b1f3a 0%, #881337 50%, #991b1b 100%);

  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 35px rgba(245, 158, 11, 0.15);
  --radius-xl: 24px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-gradient);
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-primary);
  height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Main Layout Wrapper */
.main-container {
  max-width: 1040px;
  width: 100%;
  height: 92vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.chat-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.chat-header {
  background: linear-gradient(135deg, #071327 0%, #0b1f3a 50%, #7f1d1d 100%);
  color: #fff;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3.5px solid var(--pwr-gold);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  border: 2px solid var(--pwr-gold);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.brand-title p {
  font-size: 0.8rem;
  color: var(--pwr-gold-bright);
  margin: 3px 0 0;
  font-weight: 600;
}

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

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #0b1f3a;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.admin-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
  color: #0b1f3a;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #fca5a5;
  color: #ffffff;
  transform: translateY(-1.5px);
}

.status-badge {


  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.status-badge.offline {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}


.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseDot 2s infinite;
}

.status-dot.inactive {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: none;
}


@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.85);
    opacity: 0.6;
  }
}

/* Chat Scroll Body */
.chat-box {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: #f8fafc;
}

.chat-box::-webkit-scrollbar {
  width: 6px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Chat Messages */
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 84%;
  animation: fadeIn 0.25s ease-out forwards;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.bot {
  align-self: flex-start;
}

.avatar-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-wrapper.bot-avatar {
  background: linear-gradient(135deg, #0b1f3a 0%, #1e3a8a 100%);
  color: var(--pwr-gold-bright);
  border: 1.5px solid var(--pwr-gold);
  box-shadow: 0 4px 12px rgba(11, 31, 58, 0.25);
  font-size: 1.15rem;
}

.avatar-wrapper.user-avatar {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
  color: #ffffff;
  border: 1.5px solid #fca5a5;
  box-shadow: 0 4px 12px rgba(153, 27, 27, 0.25);
  font-size: 1.1rem;
}

.chat-bubble {
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chat-message.user .chat-bubble {
  background: var(--user-bubble-bg);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.chat-message.bot .chat-bubble {
  background: var(--bot-bubble-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--pwr-gold);
  border-top-left-radius: 4px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

/* Headings & Bold Text in Chat Bubbles */
.chat-bubble h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0.7em 0 0.4em;
  color: var(--pwr-navy);
  letter-spacing: -0.01em;
}

.chat-bubble h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.7em 0 0.4em;
  color: var(--pwr-navy);
  letter-spacing: -0.01em;
}

.chat-bubble h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.6em 0 0.35em;
  color: var(--pwr-navy);
}

.chat-bubble h4 {
  font-size: 1.18rem;
  font-weight: 800;
  margin: 0.6em 0 0.35em;
  color: var(--pwr-navy);
}

.chat-bubble h5,
.chat-bubble h6 {
  font-size: 1.14rem;
  font-weight: 800;
  margin: 0.5em 0 0.3em;
  color: var(--pwr-navy);
}

.chat-bubble strong,
.chat-bubble b {
  font-weight: 700;
  color: #0b1f3a;
}



/* Suggestion Buttons Grid */
.suggestion-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(11, 31, 58, 0.15);
}

.chip-btn {
  background: #ffffff;
  border: 1.5px solid var(--pwr-navy);
  color: var(--pwr-navy);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.06);
}

.chip-btn:hover {
  background: linear-gradient(135deg, #0b1f3a 0%, #991b1b 100%);
  color: #ffffff;
  border-color: #0b1f3a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(11, 31, 58, 0.25);
}

.chip-btn i {
  color: var(--pwr-red-bright);
}

.chip-btn:hover i {
  color: var(--pwr-gold-bright);
}

.chat-bubble code {
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--pwr-navy);
}

.chat-bubble pre {
  background: var(--pwr-navy-dark);
  color: #f8fafc;
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 10px 0;
}

audio {
  height: 38px;
  border-radius: 20px;
  outline: none;
}

/* Loading Dots */
.loading-message .chat-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
}

.loading-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--pwr-red-bright);
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounceDot {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Voice Recording Bar */
.recording-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  margin: 0 30px 12px;
}

.recording-bar.active {
  display: flex;
}

.rec-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dc2626;
  font-size: 0.88rem;
  font-weight: 600;
}

.rec-dot {
  width: 10px;
  height: 10px;
  background: #dc2626;
  border-radius: 50%;
  animation: pulseRed 1s infinite;
}

@keyframes pulseRed {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.35);
    opacity: 0.5;
  }
}

/* Footer Input Bar */
.chat-footer {
  padding: 20px 30px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}

.input-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 6px 8px 6px 18px;
  transition: all 0.2s ease;
}

.input-container:focus-within {
  border-color: var(--pwr-gold);
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.2);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-family: inherit;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #fee2e2;
  color: var(--pwr-red-bright);
}

.mic-btn.recording {
  background: #fee2e2;
  color: #dc2626;
}

.send-btn {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35);
  font-size: 1.05rem;
}

.send-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.5);
  color: #ffffff;
}