/* Calculette Peintures Naturelles - Design harmonisé avec la page d'accueil */

:root {
  --primary-color: #2c5530;
  --secondary-color: #7fb069;
  --accent-color: #a7c957;
  --background-light: #f8faf8;
  --text-dark: #2d3748;
  --text-light: #4a5568;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.15);
  --card-bg: #ffffff;
  --success-color: #10b981;
  --warning-color: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--background-light) 0%, #ffffff 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header moderne */
.modern-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: var(--shadow-large);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-width: 0;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.brand img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-modern:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--accent-color);
  color: var(--primary-color);
  border-color: var(--accent-color);
}

.btn-primary:hover {
  background: #b8d168;
  border-color: #b8d168;
}

/* Contenu principal */
.main-content {
  padding: 3rem 0;
}

/* Section d'introduction */
.intro-section {
  text-align: center;
  margin-bottom: 3rem;
}

.intro-content h2 {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
  position: relative;
}

.intro-content h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

.intro-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 2rem auto 0;
}

/* Section de contrôles */
.controls-section {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.section-label {
  display: block;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--background-light);
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.quick-btn:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.input-group input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-dark);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(127, 176, 105, 0.1);
}

/* Cartes de calculette */
.calculator-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.calculator-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recipe-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.recipe-icon.argile {
  background: linear-gradient(135deg, #8b5a3c, #a0522d);
}

.recipe-icon.fromage {
  background: linear-gradient(135deg, #4a90e2, #357abd);
}

.recipe-icon.caseine {
  background: linear-gradient(135deg, #f5a623, #e8930c);
}

.recipe-icon.ble {
  background: linear-gradient(135deg, #d4af37, #b8941f);
}

.recipe-icon.chaux {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.card-title h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.card-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.print-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  position: relative;
}

.print-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  height: 20px;
  width: 20px;
  background-color: var(--background-light);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.print-toggle input:checked ~ .checkmark {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.print-toggle input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.print-single-btn {
  background: var(--background-light);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.print-single-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Contenu des cartes */
.card-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

.surface-input label {
  display: block;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: white;
  color: var(--text-dark);
  font-size: 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.input-with-unit input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(127, 176, 105, 0.1);
}

.input-with-unit .unit {
  position: absolute;
  right: 1rem;
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.2rem;
  pointer-events: none;
}

/* Résultats */
.results {
  min-height: 100px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: var(--text-light);
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
  margin: 0;
}

.results-header {
  margin-bottom: 1.5rem;
}

.results-header h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.surface-badge {
  background: var(--accent-color);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.1rem;
}

.ingredients-table {
  background: var(--background-light);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.ingredients-table table {
  width: 100%;
  border-collapse: collapse;
}

.ingredients-table th,
.ingredients-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.ingredients-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ingredients-table tbody tr:last-child td {
  border-bottom: none;
}

.ingredients-table tbody tr:hover {
  background: rgba(127, 176, 105, 0.05);
}

.ingredient {
  font-weight: 500;
  color: var(--text-dark);
}

.quantity {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.unit {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Footer */
.modern-footer {
  background: var(--primary-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

.modern-footer p {
  margin: 0.5rem 0;
}

.modern-footer strong {
  color: var(--accent-color);
}

/* Mode sombre (chantier) */
:root[data-theme="chantier"] {
  --primary-color: #1a1a1a;
  --secondary-color: #2d3748;
  --accent-color: #68d391;
  --background-light: #0f1419;
  --text-dark: #f7fafc;
  --text-light: #cbd5e0;
  --border-color: #2d3748;
  --card-bg: #1a202c;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.4);
}

:root[data-theme="chantier"] body {
  background: linear-gradient(135deg, #0f1419 0%, #1a202c 100%);
}

:root[data-theme="chantier"] .modern-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
}

:root[data-theme="chantier"] .calculator-card,
:root[data-theme="chantier"] .controls-section {
  background: var(--card-bg);
  border-color: var(--border-color);
}

:root[data-theme="chantier"] .ingredients-table {
  background: #0f1419;
}

:root[data-theme="chantier"] .ingredients-table th {
  background: #2d3748;
}

:root[data-theme="chantier"] .input-with-unit input,
:root[data-theme="chantier"] .input-group input {
  background: #0f1419;
  border-color: var(--border-color);
  color: var(--text-dark);
}

/* Responsive */
@media (max-width: 1024px) {
  .controls-section {
    grid-template-columns: 1fr;
  }
  
  .card-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-left {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .header-controls {
    width: 100%;
    justify-content: center;
  }
  
  .brand h1 {
    font-size: 1.25rem;
  }
  
  .quick-buttons {
    justify-content: center;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .intro-content h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .calculator-card,
  .controls-section {
    padding: 1.5rem;
  }
  
  .main-content {
    padding: 2rem 0;
  }
  
  .quick-buttons {
    flex-direction: column;
  }
  
  .quick-btn {
    justify-content: center;
  }
}

/* Styles d'impression */
@media print {
  .modern-header,
  .controls-section,
  .intro-section {
    display: none !important;
  }
  
  .calculator-card {
    box-shadow: none;
    border: 1px solid #999;
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
  
  .ingredients-table th {
    background: #f5f5f5 !important;
    color: black !important;
  }
}
