/* Master Junction — app.css
   This is lightweight baseline styling that complements Tailwind (CDN).
   Safe to use even without Tailwind. */

/* CSS variables (blue theme) */
:root {
  --mj-primary: #2563eb; /* blue-600 */
  --mj-primary-700: #1d4ed8; /* blue-700 */
  --mj-bg: #f9fafb; /* gray-50 */
  --mj-card: #ffffff;
  --mj-text: #111827; /* gray-900 */
  --mj-muted: #6b7280; /* gray-500 */
  --mj-ring: rgba(37, 99, 235, 0.35);
}

/* Base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--mj-bg);
  color: var(--mj-text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Containers (in case Tailwind isn't loaded) */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Cards */
.card {
  background: var(--mj-card);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 16px;
}

/* Buttons */
.btn {
  --_bg: var(--mj-primary);
  --_bg-hover: var(--mj-primary-700);
  --_color: #fff;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  background: var(--_bg);
  color: var(--_color);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.02s ease;
}
.btn:hover {
  background: var(--_bg-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn-ghost {
  --_bg: transparent;
  --_bg-hover: rgba(37, 99, 235, 0.1);
  --_color: var(--mj-primary);
  color: var(--_color);
  background: var(--_bg);
  border-color: rgba(37, 99, 235, 0.2);
}

/* Inputs */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--mj-text);
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--mj-primary);
  box-shadow: 0 0 0 0.25rem var(--mj-ring);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 600;
  color: #1f2937;
  background: #e5e7eb;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
}

/* Navbar */
.navbar {
  background: var(--mj-primary);
  color: #fff;
}
.navbar a {
  color: #fff;
  text-decoration: none;
}
.navbar a:hover {
  text-decoration: underline;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}
.table th,
.table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
}
.table thead th {
  background: #f8fafc;
  font-weight: 700;
  color: #374151;
}
.table tbody tr:hover {
  background: #f9fafb;
}

/* Prose (blog content) */
.prose {
  color: #111827;
}
.prose h1,
.prose h2,
.prose h3 {
  font-weight: 800;
  line-height: 1.2;
  margin: 1.2em 0 0.6em;
}
.prose h1 {
  font-size: 2rem;
}
.prose h2 {
  font-size: 1.5rem;
}
.prose h3 {
  font-size: 1.25rem;
}
.prose p {
  margin: 0.8em 0;
}
.prose a {
  color: var(--mj-primary);
  text-decoration: underline;
}
.prose img {
  max-width: 100%;
  border-radius: 12px;
}
.prose pre {
  background: #0b1020;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 10px;
  overflow: auto;
}

/* Chat bubbles */
.chat {
  display: flex;
  gap: 0.5rem;
  margin: 0.35rem 0;
}
.chat .avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  flex: 0 0 28px;
}
.chat .bubble {
  max-width: 70%;
  background: #ffffff;
  border: 1px solid #eef2ff;
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat.me {
  justify-content: flex-end;
}
.chat.me .bubble {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.chat .time {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

/* Toasts */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast .item {
  background: #111827;
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 9998;
  background: rgba(17, 24, 39, 0.55);
}
.modal.open {
  display: grid;
}
.modal .panel {
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

/* Utilities */
.hidden {
  display: none !important;
}
[x-cloak] {
  display: none !important;
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 999px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
