@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');

:root {
  --color-bg: #ffffff; /* Cyberpunk light */
  --color-panel: #f8fafc;
  --color-accent: #000000;
  --color-text: #4b5563; /* slate-600 */
  --color-text-light: #111827;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-border-hover: rgba(0, 0, 0, 0.4);
  --plyr-color-main: var(--color-accent);
  --plyr-video-control-background-hover: rgba(0, 0, 0, 0.1);
  --plyr-control-radius: 0px;
}

body {
  font-family: 'Geist Mono', monospace;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
}

/* Custom Cyber Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.no-scrollbar::-webkit-scrollbar { display: none !important; }
.no-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }

/* Click Effect */
.btn-click-effect {
  transition: transform 0.1s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-click-effect:active { transform: scale(0.97) !important; }

/* CYBERPUNK BUTTON STYLES */
.btn-cyber {
  position: relative;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--color-text-light);
  transition: all 0.2s ease;
  overflow: hidden;
}

/* Fast Hover Effect */
.btn-cyber-slice:hover,
.btn-solid-hover:hover {
  background-color: var(--color-accent) !important;
}

.btn-cyber > span, .btn-cyber > svg, .btn-cyber > div {
  position: relative;
  z-index: 1;
}

.btn-cyber-slice:hover > span, .btn-cyber-slice:hover > svg, .btn-cyber-slice:hover > div,
.btn-solid-hover:hover > * {
  color: #fff !important;
}

/* Premium card styling: sharp, dark, bordered */
.premium-card {
  border: 1px solid var(--color-border) !important;
  box-shadow: none !important;
  background-color: var(--color-panel) !important;
  border-radius: 0 !important;
}

/* Dropzone */
.dropzone-active {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: var(--color-border-hover) !important;
}

/* Plyr Customizations for Cyberpunk Look */
.plyr {
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: none !important;
  border: 1px solid var(--color-border);
  background: #000 !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: var(--video-aspect, 16 / 9);
  margin: 0 auto;
}
.plyr__video-wrapper {
  background: transparent !important;
  height: 100% !important;
  width: 100% !important;
}
.plyr video {
  object-fit: cover !important;
  height: 100% !important;
  width: 100% !important;
}
.plyr__controls {
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-top: 1px solid var(--color-border);
  font-family: 'Geist Mono', monospace !important;
  color: #111827 !important;
}
.plyr--video .plyr__control.plyr__tab-focus,
.plyr--video .plyr__control:hover,
.plyr--video .plyr__control[aria-expanded=true] {
  background: var(--plyr-color-main) !important;
  color: #fff !important;
}

/* Typography Overrides */
h1, h2, h3, h4, .text-xs, .text-sm, .text-base, .text-lg, .text-xl, .text-2xl, .text-3xl {
  font-family: 'Geist Mono', monospace !important;
}
.text-xs { font-size: 11px !important; line-height: 16px !important; }
.text-sm { font-size: 13px !important; line-height: 18px !important; }
.text-base { font-size: 14px !important; line-height: 20px !important; }
.text-lg { font-size: 16px !important; line-height: 24px !important; }
.text-xl { font-size: 18px !important; line-height: 26px !important; }
.text-2xl { font-size: 20px !important; line-height: 28px !important; }
.text-3xl { font-size: 24px !important; line-height: 32px !important; }
.text-4xl { font-size: 30px !important; line-height: 38px !important; }
.text-5xl { font-size: 38px !important; line-height: 46px !important; }

/* Animations */
.chat-widget-transition { transition: transform 0.2s ease, opacity 0.2s ease; }

@keyframes swipeUpFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-message-user, .animate-message-ai { animation: swipeUpFade 0.3s ease forwards; }

@keyframes charWipe {
  from { opacity: 0; transform: translateX(2px); }
  to { opacity: 1; transform: translateX(0); }
}
.char-wipe-item { display: inline-block; animation: charWipe 0.15s ease forwards; white-space: pre-wrap; }

.animate-fade-in { animation: swipeUpFade 0.3s ease forwards; }

@keyframes typing {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.typing-dot { animation: typing 1s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.video-container { transition: filter 0.3s ease; will-change: filter; }

#video-text-overlay {
  pointer-events: none;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Mobile full screen overlay slide animations */
@media (max-width: 1023px) {
  #chat-container { z-index: 9999 !important; }
  #chat-container:not(.hidden) { animation: slideUpFullScreen 0.3s ease forwards; }
}
@keyframes slideUpFullScreen {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideDownFullScreen {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}
.animate-slide-down { animation: slideDownFullScreen 0.3s ease forwards !important; }

@media (min-width: 1024px) {
  #chat-container {
    transition: width 0.3s ease, opacity 0.2s ease, margin 0.3s ease !important;
    will-change: width, opacity, margin;
  }
}

/* Chat File Attachments Styles */
.attachment-preview-card {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.attachment-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-accent);
  background-color: #f1f5f9;
}

.attachment-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background-color: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20;
  border: 1px solid var(--color-border);
}

.attachment-preview-remove:hover {
  background-color: #ef4444;
}

/* Chat Message Attachments */
.message-attachments-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.message-attachment-item {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.message-attachment-item.item-image {
  padding: 0;
  overflow: hidden;
  max-width: 100px;
  max-height: 100px;
  border: 1px solid var(--color-border);
}

.message-attachment-item.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
}

.message-attachment-item.item-image img:hover {
  opacity: 0.85;
}

.message-attachment-item.item-audio {
  font-size: 10px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 160px;
}

.message-attachment-item.item-audio audio {
  max-width: 100%;
  height: 24px;
  outline: none;
}

.message-attachment-title {
  font-weight: bold;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading Shimmer Animation */
@keyframes textShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.text-shimmer {
  background: linear-gradient(90deg, #000000 20%, #888888 50%, #000000 80%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShimmer 2.2s linear infinite;
  display: inline-block;
}

/* Button Corner Brackets via background outline gradients and hatching */
.btn-cyber-corners {
  position: relative;
  background:
    /* Top-Left */
    linear-gradient(to right, #000000 8px, transparent 8px) 0 0,
    linear-gradient(to bottom, #000000 8px, transparent 8px) 0 0,
    /* Top-Right */
    linear-gradient(to left, #000000 8px, transparent 8px) 100% 0,
    linear-gradient(to bottom, #000000 8px, transparent 8px) 100% 0,
    /* Bottom-Left */
    linear-gradient(to right, #000000 8px, transparent 8px) 0 100%,
    linear-gradient(to top, #000000 8px, transparent 8px) 0 100%,
    /* Bottom-Right */
    linear-gradient(to left, #000000 8px, transparent 8px) 100% 100%,
    linear-gradient(to top, #000000 8px, transparent 8px) 100% 100%,
    /* Diagonal hatching SVG pattern (12px sparse spacing, pixel-perfect rendering) */
    url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-3,3 L3,-3 M0,12 L12,0 M9,15 L15,9' stroke='rgba(0,0,0,0.2)' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: 8px 2px, 2px 8px, 8px 2px, 2px 8px, 8px 2px, 2px 8px, 8px 2px, 2px 8px, auto;
  transition: background-color 0.25s ease;
}

.btn-cyber-corners:hover {
  background-color: #000000 !important;
  background-image: none !important;
}

/* Input Highlighting Styles */
#initial-prompt::placeholder,
#chat-input::placeholder {
  color: #475569 !important; /* slate-600 */
  opacity: 1 !important;
}

#initial-prompt-backdrop,
#chat-input-backdrop {
  font-family: 'Geist Mono', monospace !important;
  color: #4b5563; /* match body text color */
}

/* Style for timecode span tags inside the backdrops */
#initial-prompt-backdrop span,
#chat-input-backdrop span {
  background-color: #0f172a !important; /* slate-900 / dark black */
  color: #f8fafc !important; /* slate-50 / white */
  padding: 1px 3px !important;
  margin: 0 -3px !important; /* offset padding layout shift */
  border-radius: 2px !important;
  font-weight: inherit !important; /* keep identical character widths */
}

/* Chat Message Timecode Badges */
.timecode-badge-user {
  background-color: #ffffff !important; /* white block */
  color: #000000 !important; /* black text */
  padding: 1px 4px !important;
  border-radius: 2px !important;
  font-weight: bold !important;
  font-family: 'Geist Mono', monospace !important;
  display: inline-block;
  vertical-align: middle;
}

.timecode-badge-ai {
  background-color: #0f172a !important; /* dark block */
  color: #f8fafc !important; /* white text */
  padding: 1px 4px !important;
  border-radius: 2px !important;
  font-weight: bold !important;
  font-family: 'Geist Mono', monospace !important;
  display: inline-block;
  vertical-align: middle;
}


