/* Gemo AI (Google Docs Style Gemini Assistant) - Stylesheet */

/* Floating Bottom Bar (Image 1 & 2) */
.gemo-bottom-bar-container {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90%;
  max-width: 680px;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.gemo-bottom-bar-container.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translate(-50%, 15px);
}

.gemo-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: auto;
}

.gemo-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f0f4f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1f1f1f;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.gemo-chip-btn:hover {
  background: #e1e7f0;
}

.gemo-chip-btn.active {
  background: #d3e3fd;
  color: #041e49;
  border-color: #0b57d0;
  font-weight: 600;
}

.gemo-chip-btn i {
  font-size: 0.85rem;
  color: #444746;
}

.gemo-chip-btn.active i {
  color: #0b57d0;
}

/* Main Pill Input Bar */
.gemo-pill-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #d3e3fd;
  border-radius: 36px;
  padding: 8px 14px 8px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  width: 100%;
  pointer-events: auto;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.gemo-pill-bar:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 6px 24px rgba(26, 115, 232, 0.18), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.gemo-pill-action-icon {
  background: none;
  border: none;
  color: #444746;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.gemo-pill-action-icon:hover {
  background-color: #f1f3f4;
  color: #1a73e8;
}

.gemo-sparkle-icon {
  color: #1a73e8;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gemo-pill-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: #1f1f1f;
  font-family: inherit;
  padding: 4px 0;
}

.gemo-pill-input::placeholder {
  color: #747775;
}

.gemo-submit-btn {
  background: #e3e3e3;
  color: #8e8e8e;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.gemo-submit-btn.ready {
  background: #1a73e8;
  color: #ffffff;
  cursor: pointer;
}

.gemo-submit-btn.ready:hover {
  background: #1557b0;
  transform: scale(1.05);
}

.gemo-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pill Options Menu (Switch to Side Panel / Turn off bottom bar) */
.gemo-pill-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 12px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  padding: 6px 0;
  min-width: 200px;
  z-index: 150;
  display: none;
  flex-direction: column;
}

.gemo-pill-menu.open {
  display: flex;
}

.gemo-pill-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: #1f1f1f;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.15s ease;
}

.gemo-pill-menu-item:hover {
  background-color: #f1f3f4;
}

.gemo-pill-menu-item i {
  font-size: 0.95rem;
  color: #444746;
  width: 18px;
  text-align: center;
}

/* Attached Files & Exemplar Chips in Pill */
.gemo-pill-attachments-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  padding: 2px 4px 6px 4px;
}

.gemo-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f0fe;
  color: #1967d2;
  border: 1px solid #c2e7ff;
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  max-width: 240px;
}

.gemo-attachment-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gemo-attachment-pill .remove-att-btn {
  background: none;
  border: none;
  color: #5f6368;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gemo-attachment-pill .remove-att-btn:hover {
  color: #d93025;
}

.gemo-attachment-pill.exemplar-format {
  background: #fef7e0;
  color: #b06000;
  border-color: #fce8b2;
}

/* Side Panel (Image 3) */
.doc-gemo-sidebar {
  width: 380px;
  min-width: 380px;
  background: #ffffff;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  z-index: 30;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.doc-gemo-sidebar.collapsed {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  border-left: none;
}

.gemo-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
}

.gemo-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gemo-header-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: #1f1f1f;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gemo-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gemo-icon-btn {
  background: none;
  border: none;
  color: #444746;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
}

.gemo-icon-btn:hover {
  background-color: #f1f3f4;
  color: #1a73e8;
}

.gemo-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
}

.gemo-hero-title {
  font-size: 1.6rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1a73e8, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  line-height: 1.25;
}

.gemo-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

.gemo-quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1f1f1f;
  font-size: 0.92rem;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.gemo-quick-item:hover {
  background: #f0f4f9;
  color: #1a73e8;
}

.gemo-quick-item i {
  color: #444746;
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.gemo-quick-item:hover i {
  color: #1a73e8;
}

.gemo-chat-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.gemo-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
}

.gemo-chat-msg.user {
  align-self: flex-end;
  background: #d3e3fd;
  color: #041e49;
  padding: 10px 14px;
  border-radius: 16px 16px 2px 16px;
  font-size: 0.9rem;
}

.gemo-chat-msg.ai {
  align-self: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 16px 2px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  width: 100%;
}

.gemo-ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.gemo-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
}

.gemo-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.gemo-action-btn.primary {
  background: #1a73e8;
  color: #ffffff;
  border-color: #1a73e8;
}

.gemo-action-btn.primary:hover {
  background: #1557b0;
}

/* Sidebar Footer / Input Area */
.gemo-sidebar-footer {
  padding: 14px 18px 16px 18px;
  border-top: 1px solid #f1f3f4;
  background: #ffffff;
}

.gemo-sidebar-input-card {
  border: 1px solid #d3e3fd;
  border-radius: 16px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gemo-sidebar-input-card:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}

.gemo-sidebar-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.92rem;
  color: #1f1f1f;
  min-height: 48px;
  max-height: 140px;
  line-height: 1.4;
}

.gemo-sidebar-textarea::placeholder {
  color: #747775;
}

.gemo-sidebar-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.gemo-card-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gemo-sidebar-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: #747775;
  margin-top: 10px;
}

.gemo-sidebar-disclaimer a {
  color: #747775;
  text-decoration: underline;
}

/* Floating bottom toggle button when bottom bar is dismissed */
.gemo-bottom-bar-restore-pill {
  position: absolute;
  bottom: 20px;
  right: 24px;
  z-index: 95;
  background: #ffffff;
  border: 1px solid #d3e3fd;
  color: #1a73e8;
  padding: 8px 14px;
  border-radius: 24px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gemo-bottom-bar-restore-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

/* AI Credits Badge */
.gemo-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  padding: 3px 8px;
  border-radius: 12px;
}

/* Dark mode support */
[data-theme="dark"] .gemo-pill-bar,
[data-theme="dark"] .doc-gemo-sidebar,
[data-theme="dark"] .gemo-pill-menu,
[data-theme="dark"] .gemo-sidebar-footer,
[data-theme="dark"] .gemo-sidebar-input-card,
[data-theme="dark"] .gemo-bottom-bar-restore-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .gemo-pill-input,
[data-theme="dark"] .gemo-sidebar-textarea,
[data-theme="dark"] .gemo-header-title,
[data-theme="dark"] .gemo-pill-menu-item,
[data-theme="dark"] .gemo-quick-item {
  color: #f8fafc;
}

[data-theme="dark"] .gemo-chip-btn {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}

[data-theme="dark"] .gemo-chip-btn.active {
  background: #1e3a8a;
  color: #93c5fd;
  border-color: #3b82f6;
}

[data-theme="dark"] .gemo-chip-btn i {
  color: #94a3b8;
}

[data-theme="dark"] .gemo-sidebar-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .gemo-chat-msg.ai {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}


/* Gemo AI Credits Modal */
.gemo-credits-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.gemo-credits-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.gemo-credits-modal-box {
  background: #ffffff;
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: gemoModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gemoModalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.gemo-credits-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.gemo-credits-modal-close:hover {
  color: #0f172a;
}

.gemo-credits-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.gemo-credits-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.gemo-credits-modal-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.gemo-pricing-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.gemo-tier-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  background: #f8fafc;
}

.gemo-tier-card:hover {
  border-color: #93c5fd;
  background: #ffffff;
}

.gemo-tier-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.gemo-tier-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.gemo-tier-amount {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.gemo-tier-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2563eb;
}

.gemo-tier-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 4px;
}

.gemo-credits-modal-balance {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 16px;
}

[data-theme="dark"] .gemo-credits-modal-box {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .gemo-credits-modal-title {
  color: #f8fafc;
}

[data-theme="dark"] .gemo-tier-card {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .gemo-tier-card.selected {
  border-color: #3b82f6;
  background: #1e3a8a;
}

[data-theme="dark"] .gemo-tier-amount {
  color: #f8fafc;
}
