/* /resources/css/algebraic-identities.css — styles for algebraic-identities.html */

.aidm-demo { margin: 20px 0 10px; }
.aidm-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; justify-content: center; }
.aidm-leg-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 600; color: #444; }
.aidm-leg-dot { width: 15px; height: 15px; border-radius: 3px; flex-shrink: 0; }
.aidml-kept   { background: #22c55e; border: 1px solid #16a34a; }
.aidml-ab     { background: #93c5fd; border: 1px solid #60a5fa; }
.aidml-corner { background: #f68a0a; border: 1px solid #c2670a; }
.aidml-blue   { background: #3b82f6; border: 1px solid #2563eb; }

.aidm-svg-wrap { text-align: center; }
.aidm-piece  { transition: opacity 0.5s ease-in-out; }
.aidm-egroup {
  transform-box: fill-box; transform-origin: 50% 50%;
  transition: opacity 0.5s ease-in-out, transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.aidm-fillfade { transition: fill 0.5s ease-in-out, stroke 0.5s ease-in-out, opacity 0.5s ease-in-out; }

.aidm-formula { text-align: center; font-size: 1.5rem; font-weight: 800; color: #1e293b; margin: 10px 0 16px; min-height: 1.4em; }
@keyframes aidmFormulaIn { from { transform: scale(0.85); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }
.aidm-formula.aidm-pop { animation: aidmFormulaIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both; }

.aidm-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; justify-content: center; }
.aidm-btn {
  padding: 8px 14px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em;
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.aidm-btn:disabled { opacity: 0.28; cursor: not-allowed !important; transform: none !important; box-shadow: none !important; }
.aidm-btn:not(:disabled):hover { filter: brightness(0.9); }
.aidm-btn.aidm-pulse { box-shadow: 0 0 0 3px rgba(0,0,0,0.18); transform: scale(1.04); }
.aidm-b1 { background: #bbdefb; color: #0d47a1; }
.aidm-b2 { background: #ffe0b2; color: #e65100; }
.aidm-b3 { background: #f3c6e2; color: #880e4f; }
.aidm-b4 { background: #c8e6c9; color: #1b5e20; }
.aidm-ba { background: linear-gradient(135deg,#fff176,#ffca28); color: #7c4a00; border: 1px solid #ff8f00; }
.aidm-br { background: #f0f0f0; color: #555; }

.aidm-msg {
  text-align: center; font-size: 0.88rem; font-weight: 500; color: #444;
  background: #f0f4ff; border-radius: 8px; padding: 12px 14px;
  max-width: 480px; margin: 0 auto 10px; min-height: 18px;
  line-height: 1.5;
}

.aidm-result {
  display: none; text-align: center; font-size: 0.9rem;
  max-width: 480px; margin: 8px auto 0;
  background: #fffde7; border: 1px solid #ffe082; border-radius: 8px; padding: 12px 14px;
  color: #333; line-height: 1.7;
}
.aidm-result strong { color: #e65100; }

@media (max-width: 500px) {
  .aidm-btn { padding: 7px 10px; font-size: 0.76rem; }
  .aidm-formula { font-size: 1.25rem; }
}
