/* Base Reset and Responsive Layout */
body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  padding: 40px;
  margin: 0;
}

.container {
  margin: auto;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

h1 {
  color: #1f4ea1;
  margin-bottom: 20px;
}

/* Hybrid Grid Layout Container */
.inputs-wrapper {
  position: relative;
  margin-bottom: 20px;
}

/* 3-Column Grid for Direct Typography Entry */
.inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.inputs input[type="number"] {
  padding: 12px;
  font-size: 16px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
}

/* Hidden Native Date Picker overlayed on the side */
.datepicker-container {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
}

/* Styled calendar icon click target */
.calendar-icon {
  font-size: 20px;
  cursor: pointer;
  pointer-events: none; /* Passes clicks directly to the input below it */
}

input[type="date"] {
  position: absolute;
  right: 0;
  top: -15px;
  opacity: 0; /* Invisible but clickable */
  width: 30px;
  height: 30px;
  cursor: pointer;
}

button {
  padding: 12px 20px;
  font-size: 16px;
  background: #5a8f29;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

button:hover {
  background: #4b7a22;
}

.result-box {
  margin-top: 30px;
}

.result-title {
  background: #5a8f29;
  color: white;
  padding: 10px;
  font-size: 18px;
  font-weight: bold;
}

.result-content {
  padding: 15px;
  font-size: 17px;
  line-height: 1.8;
}

.error {
  color: red;
  font-weight: bold;
}

/* Media Queries for Desktop vs Mobile Adaptation */
@media (max-width: 600px) {
  body {
    padding: 15px;
  }
  
  .container {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  /* Adapts the grid for cramped mobile screens */
  .inputs {
    grid-template-columns: 1fr; 
    gap: 10px;
  }
  
  .datepicker-container {
    top: 22px; /* aligns calendar icon perfectly inside the first input row */
  }

  button {
    width: 100%;
  }
}