/* Gemini AI Chat Widget Styles */

/* Main Container */
.gemini-chat-widget {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", sans-serif;
}

/* Positioning */
.gemini-position-bottom-right {
  bottom: 20px;
  right: 20px;
}

.gemini-position-bottom-left {
  bottom: 20px;
  left: 20px;
}

.gemini-position-top-right {
  top: 80px;
  right: 20px;
}

.gemini-position-top-left {
  top: 80px;
  left: 20px;
}

/* Floating Action Button (FAB) */
.gemini-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.gemini-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.gemini-fab i {
  font-size: 28px;
}

.gemini-fab-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  animation: pulse 2s infinite;
  opacity: 0;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Chat Window */
.gemini-chat-window {
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gemini-minimized .gemini-chat-window {
  height: auto;
}

/* Header */
.gemini-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gemini-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gemini-header-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.gemini-header-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.gemini-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gemini-status.online::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.gemini-header-actions {
  display: flex;
  gap: 8px;
}

.gemini-btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gemini-btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Messages Container */
.gemini-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gemini-messages::-webkit-scrollbar {
  width: 6px;
}

.gemini-messages::-webkit-scrollbar-track {
  background: transparent;
}

.gemini-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.gemini-messages::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Suggested Prompts */
.gemini-suggested-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gemini-prompt-title {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 4px 0;
  font-weight: 500;
}

.gemini-prompt-item {
  background: white;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.gemini-prompt-item:hover {
  background: #667eea;
  color: white;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.gemini-prompt-item i {
  font-size: 16px;
}

/* Messages */
.gemini-message {
  display: flex;
  gap: 10px;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gemini-message-user {
  flex-direction: row-reverse;
}

.gemini-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.gemini-message-ai .gemini-message-avatar,
.gemini-typing-indicator .gemini-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.gemini-message-user .gemini-message-avatar {
  background: #e2e8f0;
  color: #475569;
}

.gemini-message-system .gemini-message-avatar {
  background: #f59e0b;
  color: white;
}

.gemini-message-error .gemini-message-avatar {
  background: #ef4444;
  color: white;
}

.gemini-message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gemini-message-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 14px;
  max-width: 100%;
}

.gemini-message-ai .gemini-message-bubble {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 12px 12px 12px 2px;
}

.gemini-message-user .gemini-message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 2px 12px;
  margin-left: auto;
}

.gemini-message-system .gemini-message-bubble {
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  margin: 0 auto;
}

.gemini-message-error .gemini-message-bubble {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
}

.gemini-message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  gap: 8px;
}

.gemini-message-time {
  font-size: 11px;
  color: #94a3b8;
}

.gemini-message-user .gemini-message-time {
  text-align: right;
}

/* Message Actions */
.gemini-message-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gemini-message:hover .gemini-message-actions {
  opacity: 1;
}

.gemini-action-btn {
  background: rgba(102, 126, 234, 0.1);
  border: none;
  color: #667eea;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 11px;
}

.gemini-action-btn:hover {
  background: #667eea;
  color: white;
  transform: scale(1.1);
}

.gemini-action-btn.copied {
  background: #10b981;
  color: white;
}

/* Share Dropdown */
.gemini-share-dropdown {
  position: relative;
}

.gemini-share-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 6px;
  margin-bottom: 6px;
  min-width: 160px;
  z-index: 1000;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gemini-share-menu button {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #1e293b;
}

.gemini-share-menu button:hover {
  background: #f1f5f9;
}

.gemini-share-menu button i {
  width: 20px;
  font-size: 16px;
}

.gemini-share-menu button i.fa-whatsapp {
  color: #25d366;
}

.gemini-share-menu button i.fa-linkedin {
  color: #0077b5;
}

.gemini-share-menu button i.fa-twitter {
  color: #1da1f2;
}

.gemini-share-menu button i.fa-facebook {
  color: #1877f2;
}

/* Dark Theme - Share Actions */
.gemini-theme-dark .gemini-action-btn {
  background: rgba(102, 126, 234, 0.2);
  color: #818cf8;
}

.gemini-theme-dark .gemini-action-btn:hover {
  background: #667eea;
  color: white;
}

.gemini-theme-dark .gemini-share-menu {
  background: #334155;
  border: 1px solid #475569;
}

.gemini-theme-dark .gemini-share-menu button {
  color: #f1f5f9;
}

.gemini-theme-dark .gemini-share-menu button:hover {
  background: #475569;
}

/* Toast notification for copy feedback */
.gemini-copy-toast {
  position: fixed;
  bottom: 80px;
  right: 30px;
  background: #10b981;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  animation: toastIn 0.3s ease;
  z-index: 10000;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing Indicator */
.gemini-typing-indicator {
  display: flex;
  gap: 10px;
  align-items: center;
}

.gemini-typing-dots {
  background: white;
  padding: 12px 16px;
  border-radius: 12px 12px 12px 2px;
  display: flex;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.gemini-typing-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.gemini-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.gemini-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Area */
.gemini-input-area {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.gemini-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  transition: all 0.2s ease;
  max-height: 120px;
}

.gemini-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.gemini-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.gemini-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.gemini-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.gemini-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gemini-send-btn i {
  font-size: 16px;
}

/* Footer - Powered by */
.gemini-footer {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.gemini-powered-by {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s ease;
  opacity: 0.9;
}

.gemini-powered-by:hover {
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.gemini-footer-text {
  font-weight: 400;
}

.gemini-footer-brand {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.gemini-powered-by i {
  font-size: 10px;
  opacity: 0.8;
}

/* Dark Theme */
.gemini-theme-dark .gemini-chat-window {
  background: #1e293b;
}

.gemini-theme-dark .gemini-messages {
  background: #0f172a;
}

.gemini-theme-dark .gemini-message-ai .gemini-message-bubble {
  background: #334155;
  color: #f1f5f9;
  border-color: #475569;
}

.gemini-theme-dark .gemini-input-area {
  background: #1e293b;
  border-top-color: #334155;
}

.gemini-theme-dark .gemini-input {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

.gemini-theme-dark .gemini-prompt-item {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

.gemini-theme-dark .gemini-footer {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* Responsive */
@media (max-width: 480px) {
  .gemini-chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    max-height: 600px;
  }
}

/* Utility for HTML content */
.gemini-message-bubble p {
  margin: 0 0 8px 0;
}

.gemini-message-bubble p:last-child {
  margin-bottom: 0;
}

.gemini-message-bubble code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.gemini-message-bubble pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.gemini-message-bubble ul,
.gemini-message-bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}

.gemini-message-bubble li {
  margin: 4px 0;
}

/* RTL (Arabic) Support */
[dir="rtl"] .gemini-chat-widget {
  font-family: "Cairo", "Segoe UI", "Tahoma", sans-serif;
}

[dir="rtl"] .gemini-message-bubble ul,
[dir="rtl"] .gemini-message-bubble ol {
  padding-left: 0;
  padding-right: 20px;
}

[dir="rtl"] .gemini-header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .gemini-message-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .gemini-share-menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .gemini-footer-text,
[dir="rtl"] .gemini-footer-brand {
  margin: 0 0 0 4px;
}
