:root {
  --color-primary: #2c1810;
  --color-accent: #5558bcc3;
  --color-attention: #a3a124;
  --color-background: #f7f2e8;
  --color-surface: #ffffff;
  --color-border: #e0d9c8;
  --color-bg-secondary: #f9f7f3;
  --color-bg-error: #fef2f2;
  --color-text-error: #dc2626;
  --color-border-error: #f87171;
  --color-text-primary: #2c1810;
  --color-text-secondary: #666666;
  --color-text-tertiary: #94a3b8;
  --color-shadow-primary: rgba(0, 0, 0, 0.2);
  --color-shadow-secondary: rgba(0, 0, 0, 0.15);
  --color-shadow-subtle: rgba(0, 0, 0, 0.08);
  --color-overlay: rgba(44, 24, 16, 0.481);
  --color-hover: #8a6d3b;
  --color-focus: rgba(213, 122, 79, 0.2);

  &[data-theme="dark"] {
    --color-primary: #e0d9c8;
    --color-surface: #2c1810;
    --color-accent: #8a6d3b;
    --color-focus: rgba(230, 138, 95, 0.25);
    --color-hover: #8a6d3b;
    --color-background: #1a0f0a;
    --color-bg-secondary: #3d241a;
    --color-bg-error: #451a1a;
    --color-border: #3d241a;
    --color-border-error: #dc2626;
    --color-text-primary: #e0d9c8;
    --color-text-secondary: #a89e8c;
    --color-text-tertiary: #7a8899;
    --color-text-error: #f87171;
    --color-shadow-primary: rgba(0, 0, 0, 0.4);
    --color-shadow-secondary: rgba(0, 0, 0, 0.3);
    --color-shadow-subtle: rgba(0, 0, 0, 0.15);
    --color-overlay: rgba(26, 15, 10, 0.75);
  }

  --color-text-system: #00000036;
  --color-text-code: #ffffff;
  --color-bg-code: #000000;

  --font-family: 'Playfair Display', serif;
  --font-inclusive: 'Open Inclusive', sans-serif;
  --font-sans: 'Open Sans', sans-serif;
  --font-code: 'Fira Code', monospace;

  --font-size: 16px;
  --font-size-small: 14px;
  --font-size-medium: 16px;
  --font-size-large: 18px;
  --font-size-xlarge: 20px;
  --font-size-xxlarge: 24px;
  --font-size-xxxlarge: 32px;
  --font-size-huge: 42px;

  --font-scale: 1;


}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: var(--color-background);
  overflow-x: hidden;
}

/* containers */
.chat-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* height: 600px; */

}

.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: 1rem 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.huge-header {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin: 0;
  text-align: center;
  color: #1a1a1a;
}

.newspaper-description {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin: 0.5rem 0 0;
  text-align: center;
  color: #4a4a4a;
  font-style: italic;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  margin-top: 60px; /* Account for fixed header */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.message-item {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-area {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--color-accent);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: 500px;
}

.upload-area:hover {
  border-color: #666;
  background: #f5f5f5;
}

.upload-area h2 {
  font-family: 'Playfair Display', serif;
  margin: 0;
  color: #666;
}

.streaming-indicator {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0;
}

.streaming-avatar {
  width: 160px;
  height: 164px;
}

.result-container {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s ease forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 6px 8px var(--color-shadow-primary);
  border: 1px solid var(--color-border);
  margin-bottom: 20px;
}


#altTextDisplay {
  font-family: 'Playfair Display', serif;
  line-height: 1.6;
  color: #1a1a1a;
}

.copy-button {
  font-family: 'Playfair Display', serif;
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.copy-button:hover {
  background: #333;
}

.token-counter {
  position: fixed;
  bottom: 5px;
  right: 5px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 4px var(--color-shadow-subtle);
  z-index: 1000;
}

.progress-bar {
  height: 2px;
  background: #f0f0f0;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: #1a1a1a;
  width: 0;
  transition: width 0.3s ease;
}


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

.newspaper-divider{height:1px;background-color:var(--color-border);margin:20px 0}
.bot-header{font-size:var(--font-size-xxxlarge);color:var(--color-text-primary);font-weight:700}

/* upload */
.upload-area:hover {
  transform: scale(1.02);
  border-color: var(--color-hover);
}

.upload-area:hover::before {
  animation: shine 2s infinite linear;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

/* messages */  
.messages{display:flex;flex-direction:column;gap:20px;padding:20px 0;width:100%;align-items:center}
.message-item{width:100%;max-width:800px;margin:0 auto;display:flex;flex-direction:column;align-items:center;opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}
.message-item.fade-in{opacity:0;transform:translateY(20px)}
.message-content{align-items:center;text-align:center;justify-content:center;display:flex;flex-direction:column}

/* misc functional */
.token-counter{position:fixed;bottom:5px;right:5px;padding:8px 12px;border-radius:6px;box-shadow:0 2px 4px var(--color-shadow-subtle);z-index:1000}.token-count{font-family:monospace;font-size:.9rem;color:var(--color-text-system);margin:.5rem 0;text-align:right}
.progress-bar{width:100%;height:4px;background-color:var(--color-border);border-radius:2px;overflow:hidden;margin:10px 0}.progress-fill{width:0;height:100%;background-color:var(--color-accent);transition:width .3s ease}
.streaming-indicator{display:flex;align-items:center;justify-content:center;gap:10px;margin:10px 0;color:var(--color-text-secondary)}
.streaming-gif{width:124px;height:124px}

#altTextDisplay {
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

.copy-button {
  width: 100%;
  padding: 10px;
  background-color: var(--color-primary);
  color: var(--color-surface);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

.copy-button:hover {
  background-color: var(--color-hover);
}

#fileInput {
  display: none;
}

#uploadedImage {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

