/* Base Styles for All Screen Sizes */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  line-height: 1.5;
}

.calculator {
  width: 90%;                /* Dynamically responsive width for mobile-first */
  max-width: 800px;          /* Limit width for larger screens */
  background: #fff;
  margin: 30px auto;         /* Center the calculator on the page */
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;        /* Center-align contents */
}

.calculator h1 {
  font-size: 1.8em;
  margin-bottom: 20px;       /* Add spacing beneath the title */
  text-align: center;
  color: #333;
}

.form-group-container {
  display: flex;
  flex-wrap: wrap;           /* Wrap fields if needed */
  gap: 15px;                 /* Space between inputs */
  justify-content: center;   /* Center the input fields together */
}

.form-group {
  flex: 1 1 100%;            /* Make each form group take full width for mobile */
  max-width: 100%;           /* Ensure no overlap on small screens */
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;           /* Slightly larger labels */
  color: #555;               /* Softer label color */
  text-align: left;          /* Stay aligned left */
}

.form-group input {
  width: 100%;               /* Input fields fill container */
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;    /* Include padding in width calculation */
}

button {
  width: 100%;               /* Button takes full width on mobile */
  padding: 12px 0;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #007BFF;
  color: white;
  text-transform: uppercase;
  font-weight: bold;
  transition: background-color 0.3s ease;
  margin-top: 15px;          /* Add extra spacing above button */
}

button:hover {
  background-color: #0056b3;
}

/* Output Section */
.output {
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1.1rem;
  text-align: center;
  word-wrap: break-word;     /* Break long text properly */
}

/* Center the icon in the header */
.icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;       /* Add space beneath the icon */
}

img {
  max-width: 200px;           /* Restrict size for mobile */
  height: auto;
}

/* Footer Section */
footer {
  margin-top: 30px;
  text-align: center;
  font-size: 0.9em;
  color: #666;
  background-color: #f4f4f4;
  padding: 10px 0;
  border-top: 1px solid #ddd;
}

/* === MOBILE-FIRST APPROACH: Default Vertical Layout === */
.calculator .form-group {
  text-align: left;          /* Align labels left for readability */
}

/* === DESKTOP LAYOUT: Adjustments for Larger Screens === */
@media screen and (min-width: 768px) {
  .form-group-container {
    display: grid;           /* Grid layout for larger screens */
    grid-template-columns: repeat(2, 1fr); /* Two input columns */
    gap: 15px;
  }

  .form-group {
    flex: none;               /* Standardize input size */
    max-width: unset;
  }

  button {
    width: auto;             /* Adjust button size on larger screens */
    max-width: 300px;        /* Limit size for readability */
  }
}

/* --- TAB SYSTEM STYLES --- */

/* Tabs Container */
.tab-container {
  display: flex;
  justify-content: center;
  margin: 10px 0 20px 0;     /* Extra spacing above and below the tabs */
  border-bottom: 2px solid #ddd; /* Underline for tabs */
}

/* Tab Buttons */
.tab {
  cursor: pointer;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #007BFF;
  background: none;
  border: none;
  outline: none;
  border-bottom: 3px solid transparent; /* Neutral border */
  transition: color 0.3s ease, border-bottom 0.3s ease;
}

.tab:hover {
  color: #0056b3; /* Change tab text color on hover */
}

.tab.active {
  color: #333;                    /* Highlight the active tab */
  border-bottom: 3px solid #007BFF; /* Blue border for the active tab */
}

/* Tab Content Container */
.tab-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  width: 100%;
}

/* Hide inactive tabs by default */
.tab-pane {
  display: none;
  width: 100%;                    /* Ensure consistent width */
}

/* Only the active tab-pane is visible */
.tab-pane.active {
  display: block;
}

/* Club Toggle Styles */
.club-toggle {
  display: flex;
  align-items: center; /* Center align the checkbox with its label text */
  margin-top: 15px;    /* Add spacing above this row */
}

.club-toggle label {
  display: flex;           /* Use flex to align checkbox and text inline */
  align-items: center;     /* Vertically center align the checkbox with text */
  font-size: 1rem;         /* Make text consistent with the rest of the form */
  color: #555;             /* Softer text color */
  cursor: pointer;         /* Make it clear it's clickable */
  padding: 8px 12px;       /* Add padding around the label */
  background-color: #f9f9f9; /* Light grey background for the clickable area */
  border: 1px solid #ccc;  /* Add a border for definition */
  border-radius: 4px;      /* Slightly rounded corners for a modern look */
  transition: background-color 0.3s ease, border-color 0.3s ease; /* Smooth hover transition */
}

.club-toggle label:hover {
  background-color: #e9e9e9; /* Slightly darker grey on hover */
  border-color: #bbb;        /* Darken border color on hover */
}

.club-toggle input[type="checkbox"] {
  margin-right: 10px;      /* Add some space between the checkbox and the text */
  transform: scale(1.1);   /* Slightly enlarge the checkbox for better usability */
  cursor: pointer;         /* Pointer cursor for the checkbox */
}