/* RREF CALCULATOR STYLES - Add this after your main.css */

/* Define tool-specific variables */
:root {
  --tool-primary-color: #007BFF; /* from main.css */
  --tool-primary-light: #4da3ff;
  --tool-text-light-color: #6c757d;
  --tool-border-color: #ddd;
  --tool-error-color: #e74c3c;
  --tool-success-color: #2ecc71;
  --tool-pivot-highlight-bg: rgba(0, 123, 255, 0.1);
  --tool-pivot-highlight-border: #007BFF;
}

/* Specific overrides and styles for the calculator */
.rref-calculator .card-header {
  border-bottom: none;
  padding: 0;
  margin-bottom: 25px;
}

.rref-calculator .card-header h2 {
  font-size: 1.5rem;
  color: #333;
  margin: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--tool-border-color);
  padding-bottom: 10px;
}

.rref-calculator .card-header p {
  margin: 0;
  color: var(--tool-text-light-color);
  font-size: 0.95rem;
}

.rref-calculator .input-group,
.rref-calculator .results-group {
  margin-top: 1.5rem;
}

.rref-calculator .input-group h3,
.rref-calculator .results-group h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #444;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.rref-calculator .dimension-controls,
.rref-calculator .options-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  padding: 10px 0;
}

.rref-calculator .dimension-controls label,
.rref-calculator .options-controls .option-label,
.rref-calculator .radio-group label {
  font-weight: 500;
  color: #555;
}

.rref-calculator .dimension-controls input[type="number"] {
  width: 70px;
  padding: 0.5rem;
  border: 1px solid var(--tool-border-color);
  border-radius: 5px;
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rref-calculator .dimension-controls input[type="number"]:focus {
  outline: none;
  border-color: var(--tool-primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.rref-calculator #matrix-input-grid-container {
  overflow-x: auto;
  padding-bottom: 10px;
}

.rref-calculator .matrix-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.rref-calculator .matrix-grid .matrix-cell {
  width: 60px;
  height: 40px;
  padding: 0.5rem;
  border: 1px solid var(--tool-border-color);
  border-radius: 5px;
  text-align: center;
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rref-calculator .matrix-grid .matrix-cell:focus {
  outline: none;
  border-color: var(--tool-primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.rref-calculator .matrix-grid .matrix-cell.error {
  border-color: var(--tool-error-color);
  background-color: #f9e5e3;
}

.rref-calculator .tooltip-container {
  position: relative;
  display: inline-flex;
  margin-left: 0.5rem;
}

.rref-calculator .help-icon {
  width: 18px;
  height: 18px;
  background-color: var(--tool-text-light-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-weight: bold;
  font-size: 0.8rem;
  cursor: help;
}

.rref-calculator .tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 10;
  bottom: 150%;
  left: 50%;
  margin-left: -110px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
}

.rref-calculator .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.rref-calculator .tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.rref-calculator .options-controls .option-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rref-calculator .radio-group {
  display: flex;
  gap: 0.5rem 1rem;
  align-items: center;
}

.rref-calculator .cta-button {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-top: 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  background: var(--tool-primary-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.rref-calculator .cta-button:hover {
  background: var(--tool-primary-light);
}

.rref-calculator .cta-button:active {
  transform: translateY(1px);
}

.rref-calculator .results-hidden {
  display: none;
}

.rref-calculator #progress-bar-container {
  width: 100%;
  background-color: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.rref-calculator #progress-bar {
  width: 0%;
  height: 10px;
  background-color: var(--tool-success-color);
  transition: width 0.5s ease-in-out;
}

.rref-calculator .infographics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.rref-calculator .info-card {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--tool-border-color);
  position: relative;
  overflow: hidden;
}

.rref-calculator .info-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--tool-text-light-color);
  font-weight: 500;
}

.rref-calculator .info-card p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--tool-primary-color);
}

.rref-calculator .info-card .info-icon {
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 3rem;
  opacity: 0.08;
  transform: rotate(-15deg);
}

.rref-calculator .step {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--tool-border-color);
}
.rref-calculator .step:last-child {
  border-bottom: none;
}

.rref-calculator .step-description {
  background-color: #e9f2ff;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  font-weight: 500;
  border-left: 4px solid var(--tool-primary-color);
}

.rref-calculator .output-matrix-cell {
  width: 70px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: 1px solid var(--tool-border-color);
  border-radius: 5px;
}

.rref-calculator .output-matrix-cell.pivot-element {
  background-color: var(--tool-pivot-highlight-bg);
  border: 2px solid var(--tool-pivot-highlight-border);
  font-weight: bold;
}

.rref-calculator .matrix-grid.augmented .output-matrix-cell:last-child {
  border-left: 2px dashed var(--tool-primary-color);
}

.rref-calculator #final-result-matrix .output-matrix-cell.pivot-element {
  background-color: #eaf8e7;
  border: 2px solid var(--tool-success-color);
  font-weight: bold;
}





  .sparkle-box {
      width: 100px;
      height: 100px;
      background: linear-gradient(135deg, #00f0ff, #5efce8);
      border-radius: 8px;
      color: #fff;
      font-family: sans-serif;
      font-size: 14px;
      text-align: center;
      line-height: 100px;
      position: relative;
      box-shadow: 0 0 10px #5efce8, 0 0 20px #00f0ff;
      animation: sparkle 1s infinite alternate;
    }

    @keyframes sparkle {
      0% {
        box-shadow: 0 0 5px #5efce8, 0 0 10px #00f0ff;
        transform: scale(1);
      }
      100% {
        box-shadow: 0 0 20px #00f0ff, 0 0 30px #5efce8;
        transform: scale(1.05);
      }
    }