/* Tailwind CSS for Venice AI Plugin - Light Theme */
@import 'https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css';

:root {
  --primary: #5D5CDE;
  --primary-light: #7E7DF0;
  --primary-dark: #4847B0;
  --accent: #FF5733;
}

/* Custom classes to match Tailwind design */
.bg-primary { background-color: var(--primary) !important; }
.bg-primary-light { background-color: var(--primary-light) !important; }
.bg-primary-dark { background-color: var(--primary-dark) !important; }
.bg-accent { background-color: var(--accent) !important; }
.bg-gray-50 { background-color: #fafafa !important; }
.bg-gray-100 { background-color: #f5f5f5 !important; }
.bg-gray-150 { background-color: #eeeeee !important; }
.bg-gray-200 { background-color: #e5e5e5 !important; }

.border-gray-200 { border-color: #e5e5e5 !important; }
.border-gray-300 { border-color: #d1d5db !important; }

.text-primary { color: var(--primary) !important; }
.text-white { color: #ffffff !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-800 { color: #1f2937 !important; }

.hover\:bg-primary-light:hover { background-color: var(--primary-light) !important; }
.hover\:bg-gray-200:hover { background-color: #e5e5e5 !important; }
.hover\:text-gray-800:hover { color: #1f2937 !important; }

.border-primary { border-color: var(--primary) !important; }

/* Venice AI Chat Container */
.venice-chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background-color: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Fullscreen mode - adjusted to preserve menu bar and enable scrolling */
.venice-fullscreen {
  position: relative; /* Changed from fixed to relative */
  height: 90vh; /* Use 90% of viewport height instead of 100% */
  width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 5; /* Lower z-index to not overlay site menu */
  overflow: visible; /* Allow scrolling */
}

/* Top Navigation Bar */
.venice-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.venice-header-left {
  display: flex;
  align-items: center;
}

.venice-header-right {
  display: flex;
  align-items: center;
}

.venice-menu-button {
  padding: 0.25rem;
  margin-right: 0.5rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-menu-button:hover {
  color: #1f2937;
}

.venice-model-button {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.venice-model-button:hover {
  background-color: #e5e5e5;
}

.venice-model-icon {
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 9999px;
  background-color: var(--primary);
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.venice-new-chat-button {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  margin-right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.venice-new-chat-button:hover {
  background-color: #e5e5e5;
}

.venice-settings-button {
  padding: 0.25rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-settings-button:hover {
  color: #1f2937;
}

/* Main Chat Area */
.venice-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Chat Messages Container */
.venice-chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat History */
.venice-chat-messages {
  flex: 1;
  overflow-y: auto; /* Ensure scrolling works */
  padding: 1rem;
  background-color: #fafafa;
}

.venice-message-group {
  margin-bottom: 1.5rem;
}

.venice-message {
  display: flex;
  align-items: flex-start;
}

.venice-message-user {
  justify-content: flex-end;
}

.venice-avatar {
  height: 2rem;
  width: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.venice-avatar-ai {
  background-color: var(--primary);
  margin-right: 0.75rem;
  color: white;
}

.venice-avatar-user {
  background-color: #d1d5db;
  margin-left: 0.75rem;
}

.venice-message-content {
  max-width: 48rem;
}

.venice-message-bubble {
  border-radius: 0.5rem;
  padding: 1rem;
}

.venice-message-bubble-ai {
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.venice-message-bubble-user {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.venice-message-actions {
  display: flex;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.venice-message-action {
  margin-right: 0.75rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.venice-message-action:hover {
  color: #1f2937;
}

.venice-message-actions-right {
  justify-content: flex-end;
}

/* Input Area */
.venice-input-area {
  border-top: 1px solid #e5e5e5;
  padding: 0.75rem;
  background-color: #ffffff;
}

.venice-input-container {
  background-color: #fafafa;
  border-radius: 0.5rem;
  border: 1px solid #e5e5e5;
}

.venice-input-toolbar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e5e5;
}

.venice-input-tool {
  padding: 0.25rem;
  margin-right: 0.25rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-input-tool:hover {
  color: #1f2937;
}

.venice-input-wrapper {
  padding: 0.75rem;
}

.venice-textarea {
  width: 100%;
  background-color: #fafafa;
  color: #1f2937;
  resize: none;
  border: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-family: inherit;
}

.venice-textarea:focus {
  outline: none;
}

.venice-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e5e5e5;
}

.venice-attach-button {
  padding: 0.25rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-attach-button:hover {
  color: #1f2937;
}

.venice-send-button {
  background-color: var(--primary);
  border-radius: 0.375rem;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  border: none;
  cursor: pointer;
}

.venice-send-button:hover {
  background-color: var(--primary-light);
}

/* Settings Panel */
.venice-settings-panel {
  width: 20rem;
  border-left: 1px solid #e5e5e5;
  background-color: #ffffff;
  overflow-y: auto;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

.venice-settings-content {
  padding: 1rem;
}

.venice-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.venice-settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.venice-close-settings {
  color: #6b7280;
  background: none;
  border: none;
  padding: 0.25rem;
  border-radius: 9999px;
  cursor: pointer;
}

.venice-close-settings:hover {
  color: #1f2937;
}

.venice-settings-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.venice-settings-tab {
  padding: 0.5rem 1rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-settings-tab-active {
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
}

.venice-settings-tab-inactive {
  color: #6b7280;
}

.venice-settings-tab-inactive:hover {
  color: #1f2937;
}

.venice-settings-section {
  margin-bottom: 1.5rem;
}

.venice-settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.venice-settings-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
}

.venice-info-icon {
  margin-left: 0.25rem;
  color: #6b7280;
}

.venice-info-icon:hover {
  color: #1f2937;
}

.venice-settings-select {
  width: 100%;
  background-color: #fafafa;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: #1f2937;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.venice-settings-group-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.venice-toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.venice-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.venice-toggle-track {
  width: 2.25rem;
  height: 1.25rem;
  background-color: #d1d5db;
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.2s;
}

.venice-toggle-track.active {
  background-color: var(--primary);
}

.venice-toggle-thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.venice-toggle-track.active .venice-toggle-thumb {
  transform: translateX(1rem);
}

.venice-range-container {
  margin-bottom: 1.5rem;
}

.venice-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.venice-range-value {
  font-size: 0.875rem;
}

.venice-range {
  width: 100%;
  height: 0.5rem;
  background-color: #d1d5db;
  border-radius: 0.25rem;
  appearance: none;
  cursor: pointer;
}

.venice-range::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  background-color: var(--primary);
  border-radius: 50%;
}

.venice-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.venice-settings-footer {
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
}

.venice-reset-button {
  font-size: 0.875rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.venice-reset-button:hover {
  color: #1f2937;
}

.venice-apply-button {
  font-size: 0.875rem;
  background-color: var(--primary);
  border-radius: 0.375rem;
  padding: 0.375rem 1rem;
  color: white;
  border: none;
  cursor: pointer;
}

.venice-apply-button:hover {
  background-color: var(--primary-light);
}

/* Model dropdown */
.venice-model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background-color: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 10;
  max-height: 20rem;
  overflow-y: auto;
}

.venice-model-dropdown-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e5e5;
}

.venice-model-dropdown-item {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}

.venice-model-dropdown-item:hover {
  background-color: #f9fafb;
}

.venice-model-dropdown-item-icon {
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 9999px;
  background-color: var(--primary);
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.venice-model-dropdown-item-content {
  flex: 1;
}

.venice-model-dropdown-item-title {
  font-weight: 500;
  color: #1f2937;
}

.venice-model-dropdown-item-description {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Image Generator Container */
.venice-image-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background-color: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .venice-settings-panel {
    position: fixed;
    inset: 0;
    z-index: 50;
    width: 100%;
  }
  
  .venice-button-text {
    display: none;
  }
  
  .venice-model-button {
    padding: 0.25rem 0.5rem;
  }
  
  .venice-message-actions {
    flex-wrap: wrap;
  }
  
  .venice-message-action {
    margin-bottom: 0.25rem;
  }
  
  .venice-input-toolbar {
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .venice-input-footer {
    flex-wrap: wrap;
  }
  
  .venice-send-button {
    margin-top: 0.25rem;
    width: 100%;
  }
  
  .venice-message-bubble {
    max-width: calc(100vw - 4rem);
  }
  
  /* Adjust fullscreen for mobile */
  .venice-fullscreen {
    height: 80vh; /* Smaller height on mobile to ensure menu visibility */
  }
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
  .venice-header {
    padding: 0.25rem;
  }
  
  .venice-chat-messages {
    padding: 0.5rem;
  }
  
  .venice-input-area {
    padding: 0.5rem;
  }
  
  .venice-avatar {
    height: 1.75rem;
    width: 1.75rem;
  }
  
  .venice-message-bubble {
    padding: 0.75rem;
  }
  
  .venice-settings-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .venice-settings-tab {
    padding: 0.5rem 0.75rem;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Markdown content styling */
.venice-markdown h1, .venice-markdown h2, .venice-markdown h3 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #1f2937;
}

.venice-markdown h1 {
  font-size: 1.5rem;
}

.venice-markdown h2 {
  font-size: 1.25rem;
}

.venice-markdown h3 {
  font-size: 1.125rem;
}

.venice-markdown p {
  margin-bottom: 0.75rem;
}

.venice-markdown ul, .venice-markdown ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.venice-markdown li {
  margin-bottom: 0.25rem;
}

.venice-markdown code {
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.venice-markdown pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.75rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.venice-markdown pre code {
  background-color: transparent;
  padding: 0;
}

.venice-markdown blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.venice-markdown a {
  color: var(--primary);
  text-decoration: underline;
}

.venice-markdown a:hover {
  color: var(--primary-dark);
}

.venice-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
}

.venice-markdown th, .venice-markdown td {
  border: 1px solid #d1d5db;
  padding: 0.5rem;
}

.venice-markdown th {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Toggle fullscreen button */
.venice-toggle-fullscreen {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid #e5e5e5;
  color: #6b7280;
}

.venice-toggle-fullscreen:hover {
  background-color: #ffffff;
  color: #1f2937;
}

/* Ensure the chat container takes appropriate height */
.venice-fullscreen .venice-main {
  height: calc(90vh - 3.5rem); /* Adjusted for 90vh container */
}

/* Ensure the chat messages container takes appropriate height */
.venice-fullscreen .venice-chat-messages {
  max-height: calc(90vh - 10rem); /* Adjusted for 90vh container */
  overflow-y: auto; /* Ensure scrolling works */
}

/* Ensure the settings panel takes appropriate height */
.venice-fullscreen .venice-settings-panel {
  height: calc(90vh - 3.5rem); /* Adjusted for 90vh container */
}

/* Ensure the image container takes appropriate height */
.venice-fullscreen .venice-image-main {
  height: calc(90vh - 3.5rem); /* Adjusted for 90vh container */
}

/* Ensure the image response container takes appropriate height */
.venice-fullscreen .venice-image-response {
  height: calc(90vh - 15rem); /* Adjusted for 90vh container */
}


:root {
  --venice-primary: #3b82f6;
  --venice-secondary: #6366f1;
  --venice-accent: #22d3ee;
  --venice-bg: #f9fafb;
  --venice-text: #1f2937;
  --venice-border: #e5e7eb;
  --venice-danger: #ef4444;
  --venice-success: #10b981;
}

@keyframes skeleton-loading {
  0% {
    background-color: #f3f4f6;
  }
  100% {
    background-color: #e5e7eb;
  }
}

.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}



:root {
  --venice-primary: #6366f1;
  --venice-primary-hover: #5b5cf6;
  --venice-secondary: #8b5cf6;
  --venice-accent: #06b6d4;
  --venice-background: #f8fafc;
  --venice-surface: #ffffff;
  --venice-surface-hover: #f1f5f9;
  --venice-border: #e2e8f0;
  --venice-text-primary: #0f172a;
  --venice-text-secondary: #64748b;
  --venice-success: #10b981;
  --venice-warning: #f59e0b;
  --venice-error: #ef4444;
  --venice-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --venice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.venice-chat-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.venice-message-bubble {
  font-size: 15px;
  line-height: 1.6;
}

.venice-settings-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--venice-text-secondary);
}

.venice-message-skeleton {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.venice-skeleton-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.venice-skeleton-content {
  flex: 1;
  margin-left: 0.75rem;
}

.venice-skeleton-line {
  height: 1rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile-first styles */
.venice-chat-container {
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

/* Tablet and desktop */
@media (min-width: 768px) {
  .venice-chat-container {
    height: 600px;
    width: 100%;
    max-width: 1024px;
    position: relative;
    border-radius: 12px;
    box-shadow: var(--venice-shadow-lg);
  }
}

/* Better mobile settings panel */
@media (max-width: 767px) {
  .venice-settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--venice-surface);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .venice-settings-panel:not(.hidden) {
    transform: translateX(0);
  }
}
