/* === Reset & Base === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #333; /* Standard text color */
    background-color: #f8f8f8; /* Light background for the whole page */
    overflow-x: hidden; /* Prevent horizontal scrollbar if content overflows */
}

/* Page Title (H1 at the top of advanced_search.php) */
h1 {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    color: #0056b3; /* A primary blue for titles */
    font-size: 2.2em;
}

/* === Layout Containers === */
.container {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    /* This padding now defines the overall padding for the entire page's content area. */
    /* It pushes the whole flex container (sidebar + results) 20px from the left edge. */
    padding: 20px 20px 40px 20px;
    width: 100%;
    /* No max-width or auto margin here, as we want it to span the full width */
    justify-content: flex-start; /* Keeps the children (sidebar) aligned to the start */
}

/* === Sidebar Filters (search form) === */
.search-form {
    flex: 0 0 300px; /* Fixed width for the sidebar */
    /* Remove margin-left: 20px here, as the container's padding is handling it now */
    margin-left: 0; /* Ensure no extra left margin */
    margin-right: 40px; /* Gap between sidebar and main content */
    padding: 20px; /* Internal padding for the form */
    box-sizing: border-box;
    border-right: 2px dotted #ccc;
    align-self: stretch;
}

.search-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 0.95em;
}

.search-form input[type="text"],
.search-form select {
    width: calc(100% - 16px);
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em;
}

.search-form input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle;
}

.search-form label[for^="region_"] {
    display: inline-block;
    margin-top: 0;
    margin-right: 15px;
    font-weight: normal;
    color: #333;
}

.search-form input[type="submit"],
.search-form button[type="button"] {
    width: auto;
    padding: 8px 20px;
    margin-top: 20px;
    margin-right: 10px;
    background-color: #007BFF;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-size: 1em;
}

.search-form input[type="submit"]:hover,
.search-form button[type="button"]:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.search-form button[type="button"] {
    background-color: #6c757d;
}

.search-form button[type="button"]:hover {
    background-color: #5a6268;
}


/* === Main Content Area (search results) === */
.search-results-container {
    flex: 1; /* Allows it to grow and take remaining space */
    /* This padding controls the internal spacing of the results box. */
    /* Keep it consistent on all sides for a balanced look. */
    padding: 20px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.search-results-container h2 {
    margin-top: 0;
    font-size: 1.8em;
    color: #0056b3;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.search-results-container p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.search-results-list {
    list-style-type: none;
    padding-left: 0; /* Remove default UL padding */
    margin: 0;      /* Remove default UL margin */
}

.search-result-item {
    background-color: #fefefe;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px; /* Internal padding for each item */
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    list-style-type: none; /* Remove bullet from LI */
    margin-left: 0; /* Ensure no extra left margin on LI */
}

.search-result-item:hover {
    background-color: #e6f7ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-result-item a {
    font-size: 1.3em;
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.search-result-item a:hover {
    text-decoration: underline;
    color: #004c99;
}

.game-details {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
}

/* Optional: Media Queries for responsiveness, if needed */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px; /* Reduce overall padding for small screens */
    }

    .search-form {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 30px;
        border-right: none;
        border-bottom: 2px dotted #ccc;
    }

    .search-form input[type="submit"],
    .search-form button[type="button"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .search-results-container {
        padding: 10px; /* Reduce padding for small screens */
    }
}