/* Chatrumpt – bold, patriotic, a little extra */

:root {
  --red: #bf0a30;
  --red-dark: #9a0826;
  --blue: #002868;
  --blue-dark: #001a3d;
  --white: #fff;
  --gold: #c9a227;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-600: #525252;
  --gray-800: #262626;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-800);
  background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 50%, var(--blue-dark) 100%);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.header-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.header-photo-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}

.header-photo-btn:hover .header-photo {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.header-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  background: var(--blue-dark);
  display: block;
}

.header-titles {
  text-align: left;
}

@media (max-width: 480px) {
  .header-hero {
    flex-direction: column;
  }
  .header-titles {
    text-align: center;
  }
}

.logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.02em;
}

.logo-chat {
  color: var(--white);
  opacity: 0.95;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo-lower {
  text-transform: lowercase;
}

.logo-highlight {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
  letter-spacing: 0.01em;
}

.logo-trump {
  font-weight: 800;
}

.logo-gold {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
}

.logo-green {
  color: #22c55e;
}

.tagline {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

.tagline-sub {
  display: block;
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.15rem;
}

.api-status {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
}

.api-status.api-status--ok {
  background: rgba(255, 255, 255, 0.25);
}

.api-status.api-status--error {
  background: rgba(255, 255, 255, 0.9);
  color: var(--red-dark);
}

.options-panel {
  margin-top: 0.75rem;
  text-align: center;
}

.options-summary {
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.95;
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  user-select: none;
}

.options-summary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.options-summary::-webkit-details-marker,
.options-summary::marker {
  display: none;
}

.options-summary::after {
  content: " \25BC";
  font-size: 0.75em;
  opacity: 0.8;
}

.options-panel[open] .options-summary::after {
  content: " \25B2";
}

.options-panel[open] .options-summary {
  margin-bottom: 0.5rem;
}

.personality-sliders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding: 0.5rem 0;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slider-label {
  font-size: 0.85rem;
  color: var(--white);
  opacity: 0.95;
  white-space: nowrap;
}

.personality-slider {
  width: 100px;
  min-width: 100px;
  height: 6px;
  accent-color: var(--gold);
  cursor: pointer;
}

.slider-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 2.25rem;
}

/* Main chat */
.main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  min-height: calc(100vh - 180px);
}

/* Publisher content – substantive page content for quality guidelines */
.publisher-content {
  background: var(--white);
  padding: 0;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  overflow: hidden;
}

.publisher-content--lead {
  margin-top: 2.5rem;
}

.publisher-content-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
  padding: 1rem 1.5rem 0.5rem 1.5rem;
}

.publisher-content--lead .publisher-content-body {
  border-top: none;
  padding-top: 0;
  padding-bottom: 1.5rem;
}

.publisher-content-body a {
  color: var(--blue);
  text-decoration: none;
}

.publisher-content-body a:hover {
  text-decoration: underline;
}

.publisher-content-details {
  display: block;
}

.publisher-content-summary {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
  padding: 1rem 1.5rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
}

.publisher-content-summary::-webkit-details-marker,
.publisher-content-summary::marker {
  display: none;
}

.publisher-content-summary::after {
  content: "▼";
  font-size: 0.75rem;
  color: var(--gray-600);
  transition: transform 0.2s;
}

.publisher-content-details[open] .publisher-content-summary::after {
  transform: rotate(-180deg);
}

.publisher-content-body {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.publisher-content-body h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem 0;
  color: var(--gray-800);
}

.publisher-content-body h2:not(:first-child) {
  margin-top: 1.25rem;
}

.publisher-content-body h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
  color: var(--white);
}

.publisher-content-body p,
.publisher-content-body ul {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--gray-800);
}

.publisher-content-body ul {
  padding-left: 1.5rem;
}

.publisher-content-body li {
  margin-bottom: 0.35rem;
}

.chat-section-title {
  font-family: var(--font-heading, "Playfair Display", Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin: 1.25rem 0 0.25rem;
  text-align: center;
}

.chat-section-intro {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  margin: 0 0 0.75rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.chat-container {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.messages {
  list-style: none;
  margin: 0;
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  min-height: 280px;
}

.message {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  animation: messageIn 0.25s ease-out;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message:last-child {
  margin-bottom: 0;
}

.message--user {
  flex-direction: row-reverse;
}

.message--user .message-content {
  background: var(--blue);
  color: var(--white);
  border-radius: var(--radius-sm) var(--radius-sm) 4px var(--radius-sm);
}

.message--assistant .message-content {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 4px;
}

.message--welcome .message-content {
  border-left: 4px solid var(--red);
}

.message-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
}

.message-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message--user .message-avatar {
  background: var(--blue-dark);
  font-size: 1rem;
}

.message-content {
  max-width: 85%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.message-content p {
  margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content .message-image {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  display: block;
}

.message-content .message-code {
  margin: 0.75rem 0;
  padding: 1rem;
  background: var(--gray-800);
  color: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.45;
  border: 1px solid var(--gray-600);
}

.message-content .message-code code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.message--loading .message-content {
  color: var(--gray-600);
  font-style: italic;
}

/* Thinking state: dancing Trump photo */
.message--thinking .message-avatar {
  padding: 0;
  background: transparent;
  overflow: visible;
}

.message-avatar--dancing {
  width: 80px;
  height: 80px;
}

.thinking-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow);
}

/* Input area */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.upload-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--gray-200);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-btn:hover {
  border-color: var(--blue);
  background: var(--white);
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
}

.image-preview img {
  max-height: 80px;
  max-width: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
}

.image-preview-remove {
  font-size: 0.85rem;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.image-preview-remove:hover {
  color: var(--red);
}

.input-field {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  resize: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--blue);
}

.input-field::placeholder {
  color: var(--gray-600);
}

.send-btn {
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  box-shadow: 0 2px 12px rgba(191, 10, 48, 0.4);
}

.send-btn:active {
  transform: scale(0.98);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}

.footer p {
  margin: 0;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.footer-nav {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
}

.footer-nav a {
  color: var(--blue);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* Static page content (About, Contact, Privacy, Terms) */
.page-content {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}

.page-content h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
  color: var(--gray-800);
}

.page-content h2 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem 0;
  color: var(--gray-800);
}

.page-content p,
.page-content ul {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--gray-800);
}

.page-content ul {
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.35rem;
}

.header a.home-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
