body {
	font-family: Arial, sans-serif;
	background-color: #f4f4f4;
	margin: 0;
	padding: 0;
}

main {
    max-width: 1200px; /* Increase the maximum width */
    margin: 20px auto; /* Center the content */
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: 90%; /* Ensure it takes up 90% of the screen width */
}

form {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.form-group {
	flex: 1 1 calc(33.33% - 10px);
	display: flex;
	flex-direction: column;
}

/* For the Search button container */
.form-group-search {
    flex: 1 1 100%; /* Full width */
    text-align: center; /* Centers the button horizontally */
}

.form-group label {
	font-weight: bold;
	margin-bottom: 5px;
}

.form-group input,
.form-group select {
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 1rem;
}

button {
	background-color: #333;
	color: white;
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	font-size: 1rem;
	cursor: pointer;
}

button:hover {
	background-color: #555;
}

footer {
	text-align: center;
	background-color: #333;
	color: white;
	padding: 1rem;
	margin-top: 20px;
}

#results {
    margin-top: 20px;
}

#results table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

#results th, #results td {
    border: none;
    padding: 10px;
    text-align: left;
}

#results th {
    background-color: #f4f4f4;
    font-weight: bold;
}

#toggle-search {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
    padding: 5px;
}

/* Ensure the pseudo-element does not interfere with text */
#toggle-search::before {
    content: "";
}

/* Optional: Add some styling to ensure the button is aligned properly */
#search-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
	width: 100%;
}

/* Ensure the main search controls always look good */


#search-form {
    display: flex;              /* Use flexbox for layout */
    flex-wrap: wrap;            /* Allow wrapping of fields to the next row */
    gap: 15px;                  /* Add spacing between fields */
    width: 100%;                /* Full-width form */
}

/* Make the advanced search fields consistent with other form controls */
#search-form .form-group {
    flex: 1 1 calc(33.33% - 10px); /* Inputs take up one-third of the row, with spacing */
    display: flex;
    flex-direction: column;
}

#search-form.hidden {
    visibility: hidden; /* Hide without affecting layout */
    opacity: 0; /* Fade out */
    height: 0; /* Optional: Ensure the form doesn't take space when hidden */
    margin-bottom: 0; /* Optional: Adjust layout spacing */
}

#search-button {
    padding: 10px 20px;
    background-color: #007BFF; /* Example: Blue background */
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* Ensure the search button doesn't stretch */
#search-form .form-group:last-child {
    flex: 0 0 auto;               /* Prevent the last item (button) from stretching */
}

/* Registration Form Styling */

.registration-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.registration-form fieldset {
    margin-bottom: 20px;
    border: none;
    padding: 0;
}

.registration-form legend {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.registration-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.registration-form input,
.registration-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

/* Flex container for name fields */
.name-fields, .contact-fields {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* Ensure equal width for fields in flex containers */
.name-fields .field-group, .contact-fields .field-group {
    flex: 1;
}

/* Button styling */
.registration-form .btn-submit {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.registration-form .btn-submit:hover {
    background-color: #0056b3;
}

/* Button Styling */
.form-group button {
    flex-grow: 0;
    background-color: #4CAF50;
    color: white;
    font-size: 1em;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    width: auto;
}

.form-group button:hover {
    background-color: #45a049;
}

/* Advanced Search Styling */
#advanced-search {
    display: none; /* Initially hidden */
    width: 100%; /* Ensure it spans the full width of the form */
}

#advanced-search.visible {
    display: flex; /* Make the advanced search controls visible */
    flex-wrap: wrap; /* Allow controls to wrap */
    gap: 15px; /* Add space between the controls */
}

/* Style for the advanced search toggle */
.advanced-options-toggle {
    display: flex;
    align-items: center; /* Align the checkbox and label vertically */
    gap: 10px; /* Add spacing between the checkbox and label */
    margin-top: 15px;
}

.advanced-options-toggle input[type="checkbox"] {
    margin: 0; /* Remove default margin for better alignment */
}

/* Highlight past tournaments */
.highlight {
    background-color: #f8d7da; /* Light red background */
    color: #721c24; /* Dark red text */
}

.past-tournament {
    background-color: #d20f20;  /* Light red for past tournaments */
}

.today-tournament {
    background-color: #cce5ff;  /* Light blue for today's tournaments */
}

.future-tournament {
    background-color: #d4edda;  /* Light green for future tournaments */
}

.fab {
    position: fixed;
    bottom: 20px; /* Distance from the bottom of the viewport */
    right: 20px; /* Distance from the right of the viewport */
    background-color: #4CAF50; /* Button color */
    color: white; /* Text color */
    width: 60px; /* Diameter of the button */
    height: 60px; /* Diameter of the button */
    border-radius: 50%; /* Makes it a circle */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em; /* Text size */
    text-decoration: none; /* Removes underline */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Adds shadow for a floating effect */
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 1000; /* Ensures it appears above other elements */
}

.fab:hover {
    background-color: #45a049; /* Slightly darker shade on hover */
    transform: scale(1.1); /* Slightly enlarges on hover */
}

.fab:active {
    transform: scale(0.95); /* Shrinks slightly on click */
}

/* Modal background */
#addTournamentModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 1000; /* Ensure it's above other elements */
}

/* Modal content box */
#addTournamentModal .modal-content {
    max-width: 80%; /* Consistent modal content width */
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    max-height: 90vh; /* Ensure modal doesn't exceed viewport height */
    overflow-y: auto; /* Enable scrolling if needed */
}

/* Close button (X) */
#addTournamentModal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

/* Modal form styling */
#addTournamentModal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Form inputs and buttons */
#addTournamentModal input,
#addTournamentModal select,
#addTournamentModal button {
    padding: 10px;
    font-size: 16px;
    width: 100%;
}

/* OK and Cancel buttons */
#addTournamentModal .modal-buttons {
    display: flex;
    justify-content: space-between;
}

#addTournamentModal .modal-buttons button {
    width: 48%;
}

/* Ensure all fieldsets have consistent width */
fieldset {
    flex: 1 1 auto; /* Allow fieldsets to adjust proportionally */
    max-width: 500px; /* Consistent max width */
    width: 100%; /* Let fieldsets fill their container */
    box-sizing: border-box;
}

fieldset label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

fieldset input, 
fieldset select, 
fieldset textarea {
    width: 100%; /* Ensure inputs span the entire fieldset */
    margin-bottom: 15px;
    padding: 10px;
    box-sizing: border-box;
}

fieldset.basic-info, 
fieldset.tournament-specifics, 
fieldset.location-info {
    max-width: 600px; /* Ensure uniformity */
}

legend {
    font-weight: bold;
    padding: 0 10px;
    text-align: center; /* Optional: Center-align the legend */
}

#addTournamentForm input, 
#addTournamentForm select, 
#addTournamentForm textarea {
    border-radius: 8px; /* Adjust the value for more or less rounding */
    padding: 8px;       /* Ensures better spacing inside fields */
    border: 1px solid #ccc;
    width: 100%;        /* Makes inputs responsive */
    box-sizing: border-box; /* Prevents padding from affecting total width */
}

#addTournamentForm button {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    background: #007bff;
    color: white;
    cursor: pointer;
}

#addTournamentForm button:hover {
    background: #0056b3;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent backdrop */
    display: none; /* Hidden by default */
    z-index: 1000; /* Ensure it appears above other elements */
    align-items: center; /* Center content */
    justify-content: center;
}

.modal-content {
    max-width: 80%;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    max-height: 90vh; /* Set a maximum height for the modal */
    overflow-y: auto; /* Enable vertical scrolling */
}

textarea {
    width: 100%; /* Match the width of input fields */
    resize: none; /* Disable manual resizing */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box; /* Include padding and border in width */
}

input, textarea, select {
    border: 2px solid #ccc; /* Increase the border width */
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%; /* Ensure fields maintain full width */
    box-sizing: border-box; /* Include padding and border in width calculations */
}

input:focus, textarea:focus, select:focus {
    border-color: #007BFF; /* Optional: Add a focus color for better UX */
    outline: none; /* Remove the default focus outline */
}

.add-tournament-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto; /* Center the form on the page */
}

.add-tournament-form h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #333; /* Optional: Customize text color */
}

#weeklyDayContainer,
#monthlyOptionContainer {
    display: none;
    transition: all 0.3s ease-in-out;
}

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

#addTournamentForm input:invalid, 
#addTournamentForm select:invalid {
    border: 2px solid red;
}

input:required::placeholder {
    color: gray;
    font-style: italic;
}

.tournament-details {
    margin: 20px;
    font-family: Arial, sans-serif;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Creates two equal columns */
    gap: 30px; /* Space between the columns */
    grid-template-areas: 
        "header header"
        "contact times"
        "details details"
        "description description"
        "rules rules";
}

.header {
    grid-area: header;
    background-color: #f4f4f4;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.details-group {
    margin-bottom: 20px;
}

.details-group h2 {
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: bold;
    text-transform: uppercase;
    color: #333;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-row p {
    margin: 5px 0;
}

.detail-row strong {
    font-weight: bold;
    color: #0056b3;
}

.details-group strong {
    font-weight: bold;
    color: #0056b3; /* Same blue color as other sections */
}

.details-group p {
    color: #555;
    line-height: 1.5;
}

.contact-info, .event-times {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contact-info p, .event-times p {
    margin: 10px 0;
}

.rules-image {
    text-align: center;
    margin-top: 30px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tournament-details {
        grid-template-columns: 1fr; /* Stack everything vertically on mobile */
    }
}

.comments-section {
    margin-top: 30px;
}

.comment-list {
    margin-top: 20px;
}

/*.comment, .reply {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
}*/

.reply-form textarea {
    width: 100%;
    height: 80px;
    margin-top: 10px;
}

.reply-form textarea {
    width: 100%;
    height: 100px;
}

.reply-form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.comment {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.replies {
    margin-left: 20px; /* Indent replies */
    padding-left: 10px; /* Optional: Add some padding */
    border-left: 2px solid #ddd; /* Optional: Add a subtle border to differentiate replies */
}
.reply {
    margin-bottom: 15px; /* Add space between individual replies */
}
.seo-hidden-table {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Landing page wrapper */
.landing-page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Section headers */
.landing-page-content h1,
.landing-page-content h2 {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Paragraph spacing */
.landing-page-content p {
    margin-bottom: 1.2rem;
}

/* Unordered list style */
.landing-page-content ul {
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
}

.landing-page-content ul li {
    margin-bottom: 0.5rem;
}

/* Call to action button */
.cta-button {
    display: inline-block;
    background-color: #0077cc;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #005fa3;
}

/* Section spacing */
.landing-page-content section {
    margin-bottom: 2.5rem;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .landing-page-content {
        padding: 1rem;
    }

    .cta-button {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
}

.contact-form {
    display: block;
    width: 100%;
}

.contact-form .form-group {
    display: block;
    width: 100%;
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.contact-form textarea {
    resize: vertical;
}

th.sortable {
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

.suggestions-box {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccc;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-box div {
    padding: 8px;
    cursor: pointer;
}

.suggestions-box div:hover {
    background-color: #f0f0f0;
}