/* Blue Waves premium enhancements - does not override layout structure */

.bw-glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#root a,
#root button,
.bw-tools button,
.bw-chat-toggle {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#root section article:hover,
#root .group:hover {
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  #root section a[href^="#"]:not(.bw-no-lift):hover,
  .bw-tools .bw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.25);
  }
}

/* Chatbot */
.bw-chat-root {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 99990;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.bw-chat-toggle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #4a90e2, #6b46c1);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 32px rgba(74, 144, 226, 0.45);
}

.bw-chat-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 6rem));
  margin-bottom: 0.75rem;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.bw-chat-panel.is-open {
  display: flex;
}

.bw-chat-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.35), rgba(107, 70, 193, 0.35));
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bw-chat-header button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
}

.bw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bw-chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.bw-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4a90e2, #6b46c1);
  color: #fff;
}

.bw-chat-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bw-chat-typing {
  align-self: flex-start;
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.bw-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #111118;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bw-chat-input-row input {
  flex: 1;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}

.bw-chat-input-row input:disabled {
  opacity: 0.7;
}

.bw-chat-input-row button {
  border: none;
  border-radius: 0.75rem;
  padding: 0 1rem;
  background: #4a90e2;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* AI Tools hub */
#bw-ai-tools {
  position: relative;
  z-index: 5;
  padding: 4rem 1.5rem;
  background: #000;
}

@media (min-width: 768px) {
  #bw-ai-tools {
    padding: 5rem 3rem;
  }
}

.bw-tools {
  max-width: 72rem;
  margin: 0 auto;
  color: #e5e7eb;
}

.bw-tools h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}

.bw-tools .bw-sub {
  text-align: center;
  color: #9ca3af;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.bw-tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.bw-tools-tabs button {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
  cursor: pointer;
  font-size: 0.85rem;
}

.bw-tools-tabs button.active {
  background: linear-gradient(135deg, #4a90e2, #6b46c1);
  border-color: transparent;
  color: #fff;
}

.bw-tools-panel {
  display: none;
  padding: 1.5rem;
  border-radius: 1.5rem;
}

.bw-tools-panel.active {
  display: block;
}

.bw-tools label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #d1d5db;
}

.bw-tools input,
.bw-tools select,
.bw-tools textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
}

.bw-tools .bw-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .bw-tools .bw-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.bw-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #4a90e2, #6b46c1);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.bw-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  cursor: pointer;
  margin-left: 0.5rem;
}

.bw-btn-primary:disabled,
.bw-btn-secondary:disabled,
.bw-chat-input-row button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.bw-output {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.bw-loading {
  color: #4a90e2;
  animation: bw-pulse 1.2s ease infinite;
}

@keyframes bw-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.bw-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  max-width: 90vw;
}

.bw-toast.success { background: #065f46; color: #ecfdf5; }
.bw-toast.error { background: #7f1d1d; color: #fef2f2; }

@media (prefers-reduced-motion: reduce) {
  *, .bw-chat-toggle, .bw-btn-primary { animation: none !important; transition: none !important; }
}

@media (max-width: 520px) {
  .bw-chat-root {
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .bw-chat-panel {
    width: calc(100vw - 1.5rem);
    height: min(520px, calc(100vh - 5.5rem));
  }

  .bw-btn-secondary {
    margin-left: 0;
    margin-top: 0.6rem;
  }
}
