/* ============================================
   USB Keyboard Config Tool - Cute Theme
   Colors: White + Matcha Green + Light Purple
   ============================================ */

:root {
  --bg-primary: #faf8f6;
  --bg-card: #ffffff;
  --bg-hover: #f5f2f8;
  --matcha: #8ba888;
  --matcha-light: #b8d4a3;
  --matcha-pale: #e8f0e3;
  --lavender: #b8a9c9;
  --lavender-light: #d4c8e0;
  --lavender-pale: #f0ebf5;
  --text-primary: #5d4e6d;
  --text-secondary: #8b7d9b;
  --text-light: #b0a0b8;
  --border-color: #e8dce8;
  --shadow-soft: 0 2px 12px rgba(139, 168, 136, 0.1);
  --shadow-card: 0 4px 20px rgba(139, 168, 136, 0.08);
  --shadow-hover: 0 6px 28px rgba(139, 168, 136, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Reset & Body
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Helvetica, sans-serif;
  background: linear-gradient(135deg, #faf8f6 0%, #f5f0f7 30%, #f0f5ee 70%, #faf8f6 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  position: relative;
}

/* Decorative background blobs */
body::before {
  content: "";
  position: fixed;
  top: -180px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--lavender-pale) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -120px;
  left: -100px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--matcha-pale) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   App Container
   ============================================ */
#app {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

/* ============================================
   Headings
   ============================================ */
#app h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  width: 100%;
}

#app h1::after {
  content: "⌨️";
  display: inline-block;
  margin-left: 10px;
  font-size: 26px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   Language Toggle
   ============================================ */
#app .change-language {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

#app .change-language .el-button--text {
  font-size: 14px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

#app .change-language .el-button--text.light {
  color: #fff;
  background: var(--matcha);
  box-shadow: 0 2px 8px rgba(139, 168, 136, 0.3);
}

#app .change-language .el-button--text.normal:hover {
  color: var(--matcha);
  background: var(--matcha-pale);
}

/* ============================================
   Help Button
   ============================================ */
#app .el-button--info {
  background: var(--lavender);
  border-color: var(--lavender);
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 13px;
  padding: 10px 22px;
  transition: var(--transition);
  color: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(184, 169, 201, 0.3);
}

#app .el-button--info:hover {
  background: #a895bc;
  box-shadow: 0 4px 16px rgba(184, 169, 201, 0.4);
  transform: translateY(-1px);
}

/* ============================================
   Connect / Disconnect Button
   ============================================ */
#app .el-button--primary {
  background: var(--matcha);
  border-color: var(--matcha);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 16px;
  padding: 12px 32px;
  transition: var(--transition);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(139, 168, 136, 0.3);
  letter-spacing: 0.5px;
}

#app .el-button--primary:hover {
  background: #7d9a7b;
  box-shadow: 0 6px 20px rgba(139, 168, 136, 0.4);
  transform: translateY(-2px);
}

#app .el-button--warning {
  background: #d4a08b;
  border-color: #d4a08b;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 16px;
  padding: 12px 32px;
  transition: var(--transition);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(212, 160, 139, 0.3);
  letter-spacing: 0.5px;
}

/* ============================================
   Card Container for Config Sections
   ============================================ */
#app .el-row {
  margin-bottom: 16px;
}

/* Wrap each config area in a card look */
#app > div > div {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

#app > div > div:hover {
  box-shadow: var(--shadow-hover);
}

/* ============================================
   Labels
   ============================================ */
#app label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

/* ============================================
   Radio Group
   ============================================ */
#app .el-radio-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

#app .el-radio {
  margin-right: 0;
  color: var(--text-secondary);
  font-weight: 400;
}

#app .el-radio .el-radio__input.is-checked + .el-radio__label {
  color: var(--matcha);
}

#app .el-radio .el-radio__inner {
  border-color: var(--border-color);
  background: var(--bg-card);
  width: 16px;
  height: 16px;
}

#app .el-radio .el-radio__inner::after {
  width: 6px;
  height: 6px;
}

#app .el-radio .el-radio__input.is-checked .el-radio__inner {
  border-color: var(--matcha);
  background: var(--matcha);
}

/* Radio pill style */
#app .el-radio__label {
  font-size: 13px;
  padding-left: 6px;
}

/* ============================================
   Select Dropdown
   ============================================ */
#app .el-select .el-input__inner {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  height: 38px;
  line-height: 38px;
  font-size: 14px;
  transition: var(--transition);
  padding: 0 30px 0 14px;
}

#app .el-select .el-input__inner:hover {
  border-color: var(--lavender);
}

#app .el-select .el-input__inner:focus,
#app .el-select .el-input.is-focus .el-input__inner {
  border-color: var(--matcha);
  box-shadow: 0 0 0 3px var(--matcha-pale);
}

/* ============================================
   Text Inputs
   ============================================ */
#app .el-input__inner {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  height: 38px;
  line-height: 38px;
  font-size: 14px;
  padding: 0 14px;
  transition: var(--transition);
}

#app .el-input__inner:hover {
  border-color: var(--lavender);
}

#app .el-input__inner:focus {
  border-color: var(--matcha);
  box-shadow: 0 0 0 3px var(--matcha-pale);
}

/* Input number */
#app .el-input-number {
  line-height: 38px;
}

#app .el-input-number .el-input__inner {
  text-align: center;
  padding: 0 40px;
}

#app .el-input-number__decrease,
#app .el-input-number__increase {
  background: var(--lavender-pale);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--lavender);
  width: 32px;
  font-size: 14px;
  transition: var(--transition);
  cursor: pointer;
  line-height: 36px;
}

#app .el-input-number__decrease:hover,
#app .el-input-number__increase:hover {
  background: var(--lavender-light);
  color: #fff;
}

/* ============================================
   Submit Button
   ============================================ */
#app .el-button--success {
  background: var(--matcha);
  border-color: var(--matcha);
  border-radius: var(--radius-sm);
  font-weight: 500;
  padding: 8px 18px;
  font-size: 13px;
  transition: var(--transition);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(139, 168, 136, 0.2);
}

#app .el-button--success:hover {
  background: #7d9a7b;
  box-shadow: 0 4px 12px rgba(139, 168, 136, 0.35);
  transform: translateY(-1px);
}

#app .el-button--danger {
  background: #d4948b;
  border-color: #d4948b;
  border-radius: var(--radius-sm);
  font-weight: 500;
  padding: 8px 18px;
  font-size: 13px;
  transition: var(--transition);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(212, 148, 139, 0.2);
}

#app .el-button--danger:hover {
  background: #c27f76;
  box-shadow: 0 4px 12px rgba(212, 148, 139, 0.35);
  transform: translateY(-1px);
}

/* ============================================
   Popover / Help dialog
   ============================================ */
.el-popover {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 24px !important;
  background: var(--bg-card) !important;
}

.el-popover h2 {
  color: var(--text-primary);
  font-size: 20px;
}

.el-popover .el-row {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 2;
}

/* ============================================
   Checkbox
   ============================================ */
#app .el-checkbox__inner {
  border-color: var(--border-color);
  border-radius: 4px;
  width: 16px;
  height: 16px;
}

#app .el-checkbox__input.is-checked .el-checkbox__inner {
  background: var(--matcha);
  border-color: var(--matcha);
}

#app .el-checkbox__label {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================
   Table (Common Combinations)
   ============================================ */
#app .el-table {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

#app .el-table th.el-table__cell {
  background: var(--lavender-pale);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--lavender-light);
}

#app .el-table td.el-table__cell {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

#app .el-table tr:hover > td.el-table__cell {
  background: var(--matcha-pale);
}

#app .el-table .el-button--success {
  padding: 5px 14px;
  font-size: 12px;
}

/* ============================================
   Message / Toast
   ============================================ */
.el-message {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card) !important;
  font-weight: 500;
}

.el-message--success {
  background: var(--matcha-pale) !important;
  border-color: var(--matcha-light) !important;
  color: #5a8a5e !important;
}

.el-message--error {
  background: #fce8e8 !important;
  border-color: #f0b8b8 !important;
  color: #c06060 !important;
}

/* ============================================
   Confirm Dialog
   ============================================ */
.el-message-box {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 8px 40px rgba(139, 168, 136, 0.15) !important;
  border: 1px solid var(--border-color) !important;
}

.el-message-box__headerbtn .el-message-box__close {
  color: var(--text-light);
}

.el-message-box__title {
  color: var(--text-primary);
  font-weight: 600;
}

.el-message-box__message {
  color: var(--text-secondary);
}

/* ============================================
   Select Dropdown Popper
   ============================================ */
.el-select-dropdown {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-card) !important;
}

.el-select-dropdown__item {
  color: var(--text-secondary);
  font-size: 13px;
  height: 36px;
  line-height: 36px;
  transition: var(--transition);
}

.el-select-dropdown__item.hover,
.el-select-dropdown__item:hover {
  background: var(--lavender-pale);
}

.el-select-dropdown__item.selected {
  color: var(--matcha);
  font-weight: 600;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--lavender-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--lavender);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#app > div > div {
  animation: fadeInUp 0.5s ease-out both;
}

#app > div > div:nth-child(1) { animation-delay: 0.05s; }
#app > div > div:nth-child(2) { animation-delay: 0.1s; }
#app > div > div:nth-child(3) { animation-delay: 0.15s; }
#app > div > div:nth-child(4) { animation-delay: 0.2s; }
#app > div > div:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  #app {
    padding: 16px 12px 40px;
  }

  #app > div > div {
    padding: 20px 16px;
  }

  #app h1 {
    font-size: 22px;
  }

  #app .el-radio-group {
    flex-direction: column;
    gap: 4px;
  }
}
