/**
 * Styles pour calculateurs JavaScript
 * MaCalculatrice - 2025
 */

/* Grid calculateur */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

/* Groupe input */
.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a1a;
}

.calc-input-group input,
.calc-input-group select {
  padding: 0.75rem;
  border: 3px solid #1a1a1a;
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: all 0.2s;
}

.calc-input-group input:focus,
.calc-input-group select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 4px 4px 0 #0066cc;
  transform: translate(-2px, -2px);
}

.calc-input-group input[type="number"] {
  -moz-appearance: textfield;
}

.calc-input-group input[type="number"]::-webkit-inner-spin-button,
.calc-input-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Résultats */
.calc-result {
  margin-top: 1.5rem;
  min-height: 50px;
}

.result-success {
  background: #e8f5e9;
  border: 3px solid #2e7d32;
  padding: 1.5rem;
  box-shadow: 6px 6px 0 #2e7d32;
}

.result-success h3 {
  margin: 0 0 1rem 0;
  color: #1b5e20;
  font-size: 1.3rem;
}

.result-success p {
  margin: 0.5rem 0;
  font-size: 1rem;
  line-height: 1.6;
}

.result-success p strong {
  color: #1b5e20;
  font-weight: 700;
}

.result-success .info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #2e7d32;
  font-size: 0.9rem;
  color: #2e7d32;
}

.error {
  background: #ffebee;
  border: 3px solid #c62828;
  padding: 1rem;
  color: #b71c1c;
  font-weight: 600;
  box-shadow: 4px 4px 0 #c62828;
}

/* Liste notes (calculateur moyenne) */
.notes-list {
  background: #f5f5f5;
  border: 3px solid #1a1a1a;
  padding: 1rem;
  margin: 1rem 0;
}

.notes-list h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
}

.note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: #fff;
  border: 2px solid #1a1a1a;
  margin-bottom: 0.5rem;
}

.note-item span {
  font-weight: 600;
}

.btn-small {
  background: #ff5252;
  color: #fff;
  border: 2px solid #1a1a1a;
  padding: 0.25rem 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: #ff1744;
  transform: scale(1.1);
}

/* Boutons calculateur */
.calculator-grid button {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .result-success {
    padding: 1rem;
  }

  .result-success h3 {
    font-size: 1.1rem;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calc-result > div {
  animation: slideIn 0.3s ease-out;
}

/* États de chargement */
.calc-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #1a1a1a;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tooltips */
.calc-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 2px dotted #0066cc;
}

.calc-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.85rem;
  z-index: 1000;
  margin-bottom: 0.5rem;
}

/* Tableaux de résultats */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.result-table th,
.result-table td {
  border: 2px solid #1a1a1a;
  padding: 0.75rem;
  text-align: left;
}

.result-table th {
  background: #1a1a1a;
  color: #fff;
  font-weight: 700;
}

.result-table tr:nth-child(even) {
  background: #f5f5f5;
}

/* Badges */
.calc-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #0066cc;
  color: #fff;
  border: 2px solid #1a1a1a;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.25rem;
}

.calc-badge.success {
  background: #2e7d32;
}

.calc-badge.warning {
  background: #f57c00;
}

.calc-badge.error {
  background: #c62828;
}

/* Progress bar */
.calc-progress {
  width: 100%;
  height: 30px;
  background: #f5f5f5;
  border: 3px solid #1a1a1a;
  position: relative;
  overflow: hidden;
}

.calc-progress-bar {
  height: 100%;
  background: #0066cc;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Accordéon résultats */
.calc-accordion {
  border: 3px solid #1a1a1a;
  margin: 1rem 0;
}

.calc-accordion-header {
  background: #1a1a1a;
  color: #fff;
  padding: 1rem;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-accordion-header:hover {
  background: #333;
}

.calc-accordion-content {
  padding: 1rem;
  background: #fff;
  display: none;
}

.calc-accordion-content.active {
  display: block;
}

/* Graphiques simples */
.calc-chart-bar {
  display: flex;
  align-items: flex-end;
  height: 200px;
  gap: 1rem;
  padding: 1rem;
  border: 3px solid #1a1a1a;
  background: #f5f5f5;
}

.calc-chart-bar-item {
  flex: 1;
  background: #0066cc;
  border: 2px solid #1a1a1a;
  position: relative;
  min-height: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Comparaisons */
.calc-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.calc-comparison-item {
  background: #f5f5f5;
  border: 3px solid #1a1a1a;
  padding: 1rem;
  text-align: center;
}

.calc-comparison-item strong {
  display: block;
  font-size: 1.5rem;
  color: #0066cc;
  margin-bottom: 0.5rem;
}

.calc-comparison-vs {
  font-weight: 700;
  font-size: 1.2rem;
  color: #1a1a1a;
}

/* Alertes */
.calc-alert {
  padding: 1rem;
  border: 3px solid;
  margin: 1rem 0;
  font-weight: 600;
}

.calc-alert.info {
  background: #e3f2fd;
  border-color: #1976d2;
  color: #0d47a1;
}

.calc-alert.success {
  background: #e8f5e9;
  border-color: #388e3c;
  color: #1b5e20;
}

.calc-alert.warning {
  background: #fff3e0;
  border-color: #f57c00;
  color: #e65100;
}

.calc-alert.error {
  background: #ffebee;
  border-color: #d32f2f;
  color: #b71c1c;
}

