/* General container for the Ideal Weight Calculator - Compact & Clean Design */
#ideal-weight-calculator-container {
  max-width: 650px; /* Compact design */
  margin: 2rem auto; /* This centers the calculator block on the page */
  padding: 2.5rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  font-family: Arial, sans-serif;
  color: #333333;
  text-align: left !important; /* Forces all content inside this container to align LEFT */
}

h2 {
  color: #333333;
  margin-bottom: 2rem;
  font-size: 2.2rem;
  font-weight: bold;
  text-align: left !important; /* Force main title to left-align */
}

h3 {
  color: #555555;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: left !important; /* Force subheadings to left-align */
}

/* Input Section */
.input-section {
    margin-bottom: 2.5rem;
    text-align: left !important; /* Force content within input section to left-align */
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: bold;
    color: #333333;
    font-size: 1rem;
    text-align: left !important; /* Force labels to left-align */
}

input[type="number"],
select { /* Include select for gender dropdown */
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #f9f9f9;
    color: #333333;
    text-align: left !important; /* Force input text to left-align */
    appearance: none; /* Remove default select arrow for better cross-browser consistency */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23777777%22%20d%3D%22M287%2C197.3L159.9%2C64.9c-2.2-2.3-5.9-2.3-8.1%2C0L5.4%2C197.3c-2.2%2C2.3-2.2%2C6.1%2C0%2C8.5l11.4%2C11.4c2.2%2C2.3%2C5.8%2C2.3%2C8.1%2C0l110.8-110.8c2.2-2.3%2C5.9-2.3%2C8.1%2C0l110.8%2C110.8c2.2%2C2.3%2C5.9%2C2.3%2C8.1%2C0l11.4-11.4C289.2%2C203.4%2C289.2%2C199.6%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px; /* Make space for the arrow */
}

input[type="number"]:focus,
select:focus {
    border-color: #ff8c00; /* Orange focus color */
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.15);
    outline: none;
    background-color: #ffffff;
}

/* Button Group */
.button-group {
  display: flex;
  justify-content: center; /* Keep buttons centered within their group */
  gap: 0.8rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.button-group button {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  background-color: #ff8c00; /* Orange button color */
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  min-width: 120px;
}

.button-group button:hover {
    background-color: #e67e00;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.button-group button:active {
    background-color: #cc7000;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Error Message */
.error-message {
    color: #e74c3c; /* Red error message */
    font-size: 0.95rem;
    margin-top: 1rem;
    text-align: left !important; /* Force error message to left-align */
    font-weight: bold;
}

/* Output Section */
.output-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    text-align: left !important; /* Force all content inside output section to left-align */
}

#idealWeightResult {
  padding: 1rem;
  background-color: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 4px;
  min-height: 80px; /* Ensure space for results */
  display: flex;
  flex-direction: column;
  align-items: flex-start !important; /* Aligns flex items (the P tags) to the start (left) */
  justify-content: center;
  margin-bottom: 1.5rem;
  text-align: left !important; /* Force result text itself to left aligned */
}

#idealWeightResult p { /* Style for paragraphs inside idealWeightResult */
    margin: 0.2em 0; /* Tighten line spacing */
    width: 100%;
    text-align: left !important; /* Force paragraph text to left-align */
}

#idealWeightResult .result-placeholder {
    color: #777777;
    font-style: italic;
    font-size: 0.95rem;
    padding: 0.8rem;
    text-align: left !important; /* Force placeholder to left-align */
}

#idealWeightResult .ideal-weight-value,
#idealWeightResult .ideal-weight-note {
    text-align: left !important; /* Force these specific result texts to left aligned */
    width: 100%; /* Ensure they take full width for alignment */
    /* Other styles like font-size, margin-bottom are maintained */
}


#idealWeightResult .ideal-weight-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333333;
    margin-bottom: 0.5rem;
}

#idealWeightResult .ideal-weight-note {
    font-size: 0.95rem;
    color: #555555;
    line-height: 1.4;
}

.method-note {
    font-size: 0.8rem;
    color: #777777;
    margin-top: 1rem;
    text-align: left !important; /* Force method note to left-align */
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    #ideal-weight-calculator-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    h2 {
        font-size: 1.8rem;
        text-align: center !important; /* Can be centered on mobile for better appearance */
    }
    h3 {
        font-size: 1.3rem;
        text-align: center !important; /* On mobile, subheadings can be centered */
    }
    .input-group label {
        font-size: 0.95rem;
    }
    input[type="number"],
    select {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    .button-group button {
        width: 100%;
        min-width: unset;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }
    .button-group {
        gap: 0.6rem;
    }
    #idealWeightResult .ideal-weight-value {
        font-size: 1.6rem;
    }
    #idealWeightResult .ideal-weight-note {
        font-size: 0.8rem;
    }
    .method-note {
        font-size: 0.75rem;
        text-align: center !important; /* On mobile, center the method note */
    }
    #idealWeightResult {
        align-items: center !important; /* On mobile, center the result content if preferred */
        text-align: center !important;
    }
    #idealWeightResult .ideal-weight-value,
    #idealWeightResult .ideal-weight-note,
    #idealWeightResult .result-placeholder {
        text-align: center !important; /* Center these on mobile for better readability */
    }
}

@media (max-width: 480px) {
    #ideal-weight-calculator-container {
        padding: 1rem;
    }
    h2 {
        font-size: 1.6rem;
    }
    h3 {
        font-size: 1.2rem;
    }
    .input-group label {
        font-size: 0.85rem;
    }
    input[type="number"],
    select {
        padding: 0.7rem;
        font-size: 0.8rem;
    }
    .button-group button {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    #idealWeightResult .ideal-weight-value {
        font-size: 1.4rem;
    }
    #idealWeightResult .ideal-weight-note {
        font-size: 0.75rem;
    }
}