/**
 * ============================================================================
 * GIRI ORBIT — GOOGLE INPUT TOOLS & DEVANAGARI KEYBOARD STYLING
 * ============================================================================
 */

/* Floating Candidate Box */
.giri-hindi-candidate-box {
  position: fixed;
  z-index: 100000;
  min-width: 260px;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', 'Noto Sans Devanagari', Arial, sans-serif;
  overflow: hidden;
  animation: ghcFadeIn 0.12s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes ghcFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ghc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
}

.ghc-title {
  font-weight: 600;
  color: #0f172a;
}

.ghc-hint {
  color: #64748b;
  font-size: 10px;
  font-family: monospace;
}

.ghc-list {
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.ghc-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.08s ease;
}

.ghc-item:hover {
  background: #f1f5f9;
}

.ghc-item.selected {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.ghc-num {
  font-size: 11px;
  color: #64748b;
  margin-right: 10px;
  font-family: monospace;
  width: 14px;
}

.ghc-item.selected .ghc-num {
  color: #0284c7;
  font-weight: 700;
}

.ghc-text {
  font-size: 15px;
  letter-spacing: 0.3px;
}

/* Toolbar Control Pill */
.giri-hindi-controls-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(241, 245, 249, 0.9);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.giri-hindi-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.giri-hindi-toggle-pill:hover {
  background: rgba(0, 0, 0, 0.06);
}

.giri-hindi-toggle-pill.active {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

.giri-hindi-kbd-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  transition: background 0.15s ease;
}

.giri-hindi-kbd-pill:hover,
.giri-hindi-kbd-pill.active {
  background: #e2e8f0;
  color: #0f172a;
}

/* Virtual Devanagari Keyboard Drawer */
.giri-devanagari-keyboard {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  padding: 8px 16px 14px 16px;
  font-family: 'Segoe UI', 'Noto Sans Devanagari', Arial, sans-serif;
  max-height: 40vh;
  overflow-y: auto;
  user-select: none;
  animation: gdkSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gdkSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.gdk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
}

.gdk-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.gdk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gdk-btn-tab {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s ease;
}

.gdk-btn-tab.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.gdk-btn-close {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #ef4444;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdk-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gdk-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.gdk-key {
  min-width: 38px;
  height: 40px;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.06s ease, background 0.08s ease;
}

.gdk-key:hover {
  background: #e2e8f0;
}

.gdk-key:active {
  transform: scale(0.95);
  background: #cbd5e1;
}

.gdk-key.matra {
  color: #0284c7;
  font-weight: 700;
  background: #f0f9ff;
}

.gdk-key.swar {
  color: #9333ea;
  font-weight: 700;
  background: #faf5ff;
}

.gdk-key.num {
  color: #059669;
  background: #f0fdf4;
}

.gdk-key.action {
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.gdk-key.action.backspace {
  min-width: 80px;
  background: #fee2e2;
  color: #b91c1c;
}

.gdk-key.action.enter {
  min-width: 75px;
  background: #dbeafe;
  color: #1d4ed8;
}

.gdk-key.action.space {
  min-width: 220px;
}

/* Palette mode */
.gdk-palette-group {
  margin-bottom: 8px;
}

.gdk-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 4px;
}

.gdk-group-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Dark mode adjustments if applied */
body.dark-mode .giri-hindi-candidate-box {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
body.dark-mode .ghc-header {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .ghc-title {
  color: #f8fafc;
}
body.dark-mode .ghc-item:hover {
  background: #334155;
}
body.dark-mode .ghc-item.selected {
  background: #0369a1;
  color: #ffffff;
}
body.dark-mode .giri-devanagari-keyboard {
  background: #0f172a;
  border-top-color: #334155;
}
body.dark-mode .gdk-key {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
