/* Main/* Calculadora de Papel Styles */
.calculadora-papel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.calculad.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

/* Header Styles */
.calc-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.calc-header h1 {
  color: #1a365d;
  margin: 0 0 0.75rem;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.calc-header p {
  color: #4a5568;
  font-size: 1.125rem;
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Container */
.calculadora-contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .calculadora-contenedor {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
  }
}

/* Instrucciones */
.calculadora-instrucciones {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

/* Form Styles */
.calculadora-formulario {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: relative;
    top: 0;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .calculadora-formulario {
    position: sticky;
    top: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 0;
  }
}

/* Form Controls */
.form-group {
  margin-bottom: 0.75rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #4a5568;
  font-size: 0.9375rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #4a5568;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 48px; /* Better touch target */
}

.form-control:focus {
  border-color: #4299e1;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Make inputs more touch-friendly on mobile */
@media (max-width: 767px) {
  .form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Ensure select elements are properly sized */
  select.form-control {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a5568'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
  }
}

/* Button Group */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

@media (min-width: 768px) {
  .button-group {
    flex-direction: row;
    gap: 0.75rem;
  }
  
  .button-group .btn {
    margin-bottom: 0;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.5rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  min-height: 48px; /* Better touch target */
  width: 100%; /* Full width on mobile */
  margin-bottom: 0.75rem; /* Space between stacked buttons */
}

@media (min-width: 768px) {
  .btn {
    width: auto;
    margin-bottom: 0;
    margin-right: 0.75rem;
  }
  
  .btn:last-child {
    margin-right: 0;
  }
}

.btn-primary {
  color: #fff;
  background-color: #4299e1;
  border-color: #4299e1;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #3182ce;
  border-color: #2c5282;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-outline-secondary {
  color: #4a5568;
  background-color: transparent;
  border-color: #e2e8f0;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
  background-color: #f7fafc;
  border-color: #cbd5e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #edf2f7;
}

/* Results Section */
.resultados {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .resultados {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
}

.resultado-total {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #edf2f7;
}

.estadistica {
  text-align: center;
}

.estadistica-valor {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2b6cb0;
  line-height: 1.2;
}

.estadistica-etiqueta {
  font-size: 0.8125rem;
  color: #718096;
  margin-top: 0.25rem;
  display: block;
}

/* Canvas Container */
.canvas-container {
  width: 100%;
  height: 250px;
  border: 2px solid #4299e1;
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 1rem 0;
  background-color: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  text-align: center;
}

.canvas-placeholder .placeholder-icon {
  font-size: 4rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: #d1d5db;
}

.canvas-placeholder p {
  margin: 0;
  font-size: 0.875rem;
}

#papel-canvas {
  display: none;
  max-width: 100%;
  height: auto;
}

#papel-canvas.active {
  display: block;
}

.canvas-placeholder.hidden {
  display: none;
}

/* Results Detail */
.resultados-detalle {
  background-color: #f8fafc;
  border-radius: 0.5rem;
  padding: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.resultados-detalle p {
  margin: 0 0 0.75rem;
}

.resultados-detalle p:last-child {
  margin-bottom: 0;
}

/* Instructions Section */
.calculadora-instrucciones {
  background: #fff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  margin-top: 2rem;
}

.calculadora-instrucciones h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: #2d3748;
  font-size: 1.375rem;
  font-weight: 600;
}

.calculadora-instrucciones ol,
.calculadora-instrucciones ul {
  padding-left: 1.5rem;
  margin: 0 0 1.5rem;
}

.calculadora-instrucciones li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.calculadora-instrucciones .consejos {
  background-color: #f0f9ff;
  border-left: 4px solid #0ea5e9;
  padding: 1.25rem;
  border-radius: 0.375rem;
  margin-top: 2rem;
}

.calculadora-instrucciones .consejos h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #0369a1;
  font-size: 1.125rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .calculadora-contenedor {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .calculadora-formulario {
    position: static;
  }
  
  .canvas-container {
    height: 250px;
  }
}

@media (max-width: 640px) {
  .resultados-estadisticas {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}
