/* General container for the Random Word Generator - Wider Layout */
#random-word-generator-container {
  max-width: 1100px; /* Consistent wider layout */
  margin: 2rem auto; /* Centers the tool 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; /* Ensures all content inside this container aligns LEFT by default */
}

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 */
}

/* Options Section Styling */
.tool-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px; /* Vertical and horizontal gap */
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.option-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 calc(33.33% - 20px); /* Approx 3 items per row on wider screens */
    min-width: 180px; /* Ensure a minimum width for fields */
    box-sizing: border-box;
}

.option-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: bold;
    color: #333333;
    font-size: 1rem;
}

.option-group input[type="number"],
.option-group input[type="text"],
.option-group select {
    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;
}

.option-group input:focus,
.option-group select:focus {
    border-color: #ff8c00;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.15);
    outline: none;
    background-color: #ffffff;
}

/* Checkbox specific styling */
.checkbox-group {
    flex-direction: row; /* Align checkbox and label horizontally */
    align-items: center; /* Vertically align them */
    gap: 8px; /* Space between checkbox and label */
    padding-top: 1.5rem; /* Give some space above the checkbox */
    flex: 1 1 100%; /* Make checkbox take full width on its own row */
}

.checkbox-group input[type="checkbox"] {
    width: 18px; /* Standardize checkbox size */
    height: 18px;
    margin: 0; /* Remove default margin */
    accent-color: #ff8c00; /* Orange color for the checkbox */
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0; /* Remove bottom margin for labels in checkbox group */
    font-weight: normal; /* Less bold for checkbox label */
    cursor: pointer;
}


/* Output Section */
.output-section {
    margin-top: 2rem; /* Space above output container */
    text-align: left !important;
}

.output-section label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: bold;
    color: #333333;
    font-size: 1rem;
}

/* Styles for the new word output container */
#wordOutputContainer {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: #f9f9f9;
    min-height: 150px; /* Ensure some height even if no words generated */
    max-height: 300px; /* Limit height and enable scrolling */
    overflow-y: auto; /* Enable vertical scrolling if content overflows */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    line-height: 1.6; /* Improve readability */
    font-size: 1.1em;
    font-family: monospace; /* Common for word lists */

    /* --- COLUMN STYLES --- */
    /* Adjust these values as needed */
    columns: 200px 3; /* Min width 200px per column, max 3 columns */
    -webkit-columns: 200px 3; /* For Safari */
    -moz-columns: 200px 3; /* For Firefox */
    column-gap: 30px; /* Space between columns */
    -webkit-column-gap: 30px;
    -moz-column-gap: 30px;
}

/* Style for individual words within the columns */
#wordOutputContainer span {
    display: block; /* Make each word take its own line within a column */
    margin-bottom: 5px; /* Space between words */
    white-space: nowrap; /* Prevent words from breaking to keep columns clean */
}


/* Button Group - for all buttons */
.button-group {
  display: flex;
  justify-content: center; /* Centers buttons */
  gap: 0.8rem; /* Space between buttons */
  margin-top: 2rem; /* Space above button group */
  flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
}

/* Styling for ALL buttons within the button-group */
.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 !important; /* IMPORTANT: Force orange color */
  color: #ffffff !important; /* IMPORTANT: Force white text color */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  min-width: 150px; /* Make buttons slightly wider for better appearance */
}

.button-group button:hover {
    background-color: #e67e00 !important; /* IMPORTANT: Force hover color */
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.button-group button:active {
    background-color: #cc7000 !important; /* IMPORTANT: Force active color */
    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: center !important; /* Center error message */
    font-weight: bold;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #random-word-generator-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    h2 {
        font-size: 1.8rem;
    }
    .tool-options {
        flex-direction: column; /* Stack options vertically */
        gap: 15px;
        padding: 1rem;
    }
    .option-group {
        flex: 1 1 100%; /* Each option takes full width */
        min-width: unset;
    }
    .option-group label {
        font-size: 0.95rem;
    }
    .option-group input,
    .option-group select {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    #wordOutputContainer { /* Adjust min-height for mobile if needed */
        min-height: 120px;
        font-size: 0.9rem;
        columns: 1; /* Force single column on smaller screens */
        -webkit-columns: 1;
        -moz-columns: 1;
    }
    .button-group button { /* All buttons */
        width: 100%; /* Full width on mobile */
        min-width: unset;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }
    .button-group {
        gap: 0.6rem;
    }
}

@media (max-width: 480px) {
    #random-word-generator-container {
        padding: 1rem;
    }
    h2 {
        font-size: 1.6rem;
    }
    .option-group label {
        font-size: 0.85rem;
    }
    .option-group input,
    .option-group select {
        padding: 0.7rem;
        font-size: 0.8rem;
    }
    #wordOutputContainer {
        min-height: 100px;
        font-size: 0.8em;
    }
    .button-group button {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}