/* 额外的增强样式 - 提供更精美的视觉效果和交互体验 */

/* 波纹效果 */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 增强的工具提示 */
.enhanced-tooltip {
  position: fixed;
  background-color: #1A1F2C;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px) translateX(-50%);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.enhanced-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1A1F2C;
}

.enhanced-tooltip.show {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
}

/* 增强的Toast提示 */
.enhanced-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: #1A1F2C;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90%;
}

.enhanced-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.toast-success .toast-icon {
  background-color: rgba(46, 213, 115, 0.2);
  color: #2ed573;
}

.toast-error .toast-icon {
  background-color: rgba(255, 71, 87, 0.2);
  color: #ff4757;
}

.toast-warning .toast-icon {
  background-color: rgba(255, 165, 2, 0.2);
  color: #ffa502;
}

/* 编辑器增强效果 */
.editor-focus {
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2) !important;
}

.preview-hover {
  transform: scale(1.01) !important;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

/* 按钮悬停效果增强 */
.action-btn, .control-btn, .fullscreen-btn {
  position: relative;
  overflow: hidden;
}

/* 3D按钮效果 */
.action-btn {
  transform-style: preserve-3d;
  transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:active {
  transform: translateY(2px) scale(0.98) !important;
  box-shadow: 0 2px 5px rgba(74, 108, 247, 0.2) !important;
}

/* 动画控制增强 */
.animation-active {
  position: relative;
}

.animation-active::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 18px;
  background: linear-gradient(45deg, #4A6CF7, #00C8FF, #4A6CF7);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  z-index: -1;
  opacity: 0.7;
}

/* 全屏模式增强 */
#fullscreen-container {
  transition: opacity 0.4s ease;
}

#fullscreen-container.hidden {
  opacity: 0;
  pointer-events: none;
}

#fullscreen-container:not(.hidden) {
  opacity: 1;
}

/* 页面加载动画 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-animation {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4A6CF7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 代码编辑器美化 */
.CodeMirror {
  border-radius: 12px !important;
  padding: 10px !important;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05) !important;
  font-family: 'JetBrains Mono', monospace !important;
  transition: all 0.3s ease !important;
}

.CodeMirror-focused {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(74, 108, 247, 0.2) !important;
}

.CodeMirror-gutters {
  background-color: rgba(248, 250, 255, 0.8) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.CodeMirror-linenumber {
  color: #a0a0a0 !important;
  font-size: 12px !important;
}

/* 美化复选框 */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
  outline: none;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  vertical-align: middle;
  margin-right: 8px;
  background-color: #ffffff;
}

input[type="checkbox"]:checked {
  background-color: #4A6CF7;
  border-color: #4A6CF7;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 美化下拉菜单 */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A6CF7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 30px !important;
}

/* 动画控制标签美化 */
.option-label {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: #1A1F2C;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 10px;
  background-color: rgba(248, 250, 255, 0.8);
}

.option-label:hover {
  background-color: rgba(74, 108, 247, 0.1);
}

/* 美化滑块控件 */
input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  background: linear-gradient(to right, #4A6CF7, #00C8FF);
  border-radius: 5px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(74, 108, 247, 0.4);
}

/* 响应式增强 */
@media (max-width: 768px) {
  .enhanced-toast {
    max-width: 95%;
    bottom: 20px;
  }
  
  .action-btn {
    padding: 10px 16px !important;
  }
}

/* 键盘快捷键提示 */
.shortcut-hint {
  display: inline-block;
  padding: 2px 6px;
  background-color: rgba(0, 0, 0, 0.07);
  border-radius: 4px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-left: 5px;
  color: #666;
}

/* 鼠标悬停时突出显示的元素 */
.highlight-on-hover {
  transition: all 0.3s ease;
}

.highlight-on-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
