﻿#aiAssistantBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #01354d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 100000;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.2s ease;
  border: 2px solid #3791af;
}
#aiAssistantBtn.ai-btn-hidden {
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
}
#aiAssistantBtn:hover {
  background: #3791af;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
#aiAssistantBtn:active {
  transform: translateY(0);
}
#aiAssistantBtn i {
  font-size: 20px;
}
@media (max-width: 480px) {
  #aiAssistantBtn {
    width: 48px;
    height: 48px;
    bottom: 14px;
    right: 14px;
  }
  #aiAssistantBtn i {
    font-size: 18px;
  }
}

.ai-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.ai-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ai-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 25%;
  min-width: 320px;
  height: 100vh;
  background: #fafafa;
  z-index: 99999;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.ai-side-panel.open {
  transform: translateX(0);
}

.ai-side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 20px;
  height: 52px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0d1e26 0%, #1c3846 100%);
  border-bottom: 2px solid #3791af;
}

.ai-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-family: "FontSiteSansCondensed";
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ai-header-title i {
  color: #3791af;
  font-size: 17px;
}

.ai-side-panel-close {
  background: none;
  border: none;
  color: #aac0cf;
  cursor: pointer;
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}
.ai-side-panel-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.ai-side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fafafa;
}

.ai-tool-section {
  background: #ffffff;
  border: 1px solid #e0e8ec;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ai-tool-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #edf2f5;
  border-bottom: 1px solid #d8e4ea;
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #01354d;
}
.ai-tool-section-title i {
  color: #3791af;
  font-size: 13px;
}

.ai-tool-field {
  padding: 12px 14px 0;
}
.ai-tool-field:last-of-type {
  padding-bottom: 12px;
}

.ai-tool-label {
  display: block;
  font-family: "FontSiteSansCondensed";
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #809096;
  margin-bottom: 5px;
}

.ai-tool-input,
.ai-tool-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  font-family: "FontSiteSansRoman";
  font-size: 13px;
  color: #333;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}
.ai-tool-input:focus,
.ai-tool-textarea:focus {
  outline: none;
  border-color: #3791af;
  background: #ffffff;
}
.ai-tool-input::placeholder,
.ai-tool-textarea::placeholder {
  color: #b0bec5;
  font-style: italic;
}

.ai-tool-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.ai-lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  align-items: center;
}

.ai-lang-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #01354d;
  color: #ffffff;
  border-radius: 12px;
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  letter-spacing: 1px;
}
.ai-lang-chip.ai-lang-chip-sm {
  padding: 2px 8px;
  font-size: 10px;
}

.ai-lang-none {
  font-size: 12px;
  color: #aaa;
  font-style: italic;
}

.ai-lang-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-lang-toggle {
  cursor: pointer;
}
.ai-lang-toggle input[type=checkbox] {
  display: none;
}
.ai-lang-toggle span {
  display: inline-block;
  padding: 3px 11px;
  border: 1px solid #d0dce2;
  border-radius: 12px;
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  letter-spacing: 1px;
  color: #809096;
  background: #ffffff;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.ai-lang-toggle input:checked + span {
  background: #01354d;
  color: #ffffff;
  border-color: #01354d;
}

.ai-tool-actions {
  padding: 12px 14px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0d1e26 0%, #1c3846 100%);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: "FontSiteSansCondensed";
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.ai-btn-action i {
  color: #3791af;
  font-size: 13px;
}
.ai-btn-action:hover {
  opacity: 0.85;
}
.ai-btn-action:active {
  transform: scale(0.98);
}
.ai-btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ai-btn-clear {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  color: #809096;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ai-btn-clear i {
  font-size: 13px;
}
.ai-btn-clear:hover {
  border-color: #c0392b;
  color: #c0392b;
  background: #fdf0ef;
}

.ai-status {
  margin: 10px 14px 12px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  display: none;
  line-height: 1.5;
}
.ai-status.ai-status-loading {
  display: block;
  background: #e8f4f8;
  color: #3791af;
  border-left: 3px solid #3791af;
}
.ai-status.ai-status-error {
  display: block;
  background: #fdf0ef;
  color: #c0392b;
  border-left: 3px solid #c0392b;
}
.ai-status.ai-status-success {
  display: block;
  background: #f0faf4;
  color: #27ae60;
  border-left: 3px solid #27ae60;
}
.ai-status.ai-status-success .ai-lang-chip {
  background: #27ae60;
  font-size: 10px;
  padding: 1px 7px;
  vertical-align: middle;
}
.ai-status.ai-status-success .ai-skipped {
  color: #aaa;
  font-style: italic;
  font-size: 11px;
}
.ai-status.ai-status-success .ai-detected-lang {
  color: #3791af;
  font-style: normal;
  font-size: 11px;
}
.ai-status.ai-status-success .ai-detected-lang i {
  font-size: 10px;
}

.ai-tool-section-title {
  cursor: pointer;
  justify-content: space-between;
  user-select: none;
}
.ai-tool-section-title:hover {
  background: #e0eaef;
}

.ai-section-chevron {
  color: #809096;
  font-size: 11px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ai-tool-section-body {
  display: none;
  margin-bottom: 20px;
}

.ai-section-open .ai-tool-section-body {
  display: block;
}

.ai-section-open .ai-section-chevron {
  transform: rotate(180deg);
}

.ai-tool-hint {
  margin: 10px 14px 0;
  font-size: 11px;
  color: #9aabae;
  line-height: 1.5;
  font-style: italic;
}

.ai-tool-select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  font-family: "FontSiteSansCondensed";
  font-size: 12px;
  color: #333;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ai-tool-select:focus {
  outline: none;
  border-color: #3791af;
}

.ai-radio-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ai-radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  color: #444;
  cursor: pointer;
}
.ai-radio-group label input[type=radio] {
  accent-color: #01354d;
  cursor: pointer;
}

.ai-preview-box {
  margin: 10px 14px 0;
  background: #ffffff;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  overflow: hidden;
}

.ai-preview-item {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f5;
}
.ai-preview-item:last-of-type {
  border-bottom: none;
}

.ai-preview-item-label {
  display: block;
  font-family: "FontSiteSansCondensed";
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #3791af;
  margin-bottom: 4px;
}

.ai-preview-item-text {
  font-size: 12px;
  color: #333;
  line-height: 1.5;
  white-space: pre-line;
  padding: 10px 12px;
}

.ai-preview-actions {
  padding: 8px 12px !important;
  background: #f0f4f6;
  border-top: 1px solid #e0e8ec;
}

.ai-btn-apply {
  background: linear-gradient(135deg, #1a6b3e 0%, #27ae60 100%) !important;
}
.ai-btn-apply i {
  color: #a8f0c8 !important;
}

.ai-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.ai-label-row .ai-tool-label {
  margin-bottom: 0;
}

.ai-btn-inline {
  background: none;
  border: 1px solid #d0dce2;
  border-radius: 10px;
  padding: 2px 9px;
  font-family: "FontSiteSansCondensed";
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #3791af;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-btn-inline i {
  font-size: 10px;
}
.ai-btn-inline:hover {
  background: #e8f4f8;
  border-color: #3791af;
}

.ai-check-result {
  margin: 10px 14px 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.8;
  color: #333;
}

.ai-free-text {
  max-height: 220px;
  overflow-y: auto;
}

.ai-copy-row {
  padding: 8px 12px;
  border-top: 1px solid #e0e8ec;
  background: #f0f4f6;
}

.ai-btn-copy {
  background: none;
  border: 1px solid #d0dce2;
  border-radius: 4px;
  padding: 5px 12px;
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #809096;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-btn-copy i {
  font-size: 12px;
  margin-right: 4px;
}
.ai-btn-copy:hover {
  border-color: #3791af;
  color: #3791af;
  background: #e8f4f8;
}

.ai-ctx-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ai-ctx-toggle input[type=checkbox] {
  accent-color: #01354d;
  cursor: pointer;
}
.ai-ctx-toggle .ai-ctx-label {
  font-family: "FontSiteSansCondensed";
  font-size: 11px;
  color: #809096;
  letter-spacing: 0.5px;
}
