body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #35424a;
    color: #ffffff;
    padding: 1rem 20px; /* Keeps horizontal padding for switcher spacing from edge */
    text-align: center;
    position: relative; /* Establishes a positioning context for the absolute switcher */
}

header h1 {
    margin: 0 auto; /* Centers the h1 if it's a block with a defined width or max-width */
    display: inline-block; /* Allows text-align:center on parent to center it */
    font-size: 1.8em;
    line-height: 1.4; /* Adjust for good vertical spacing within the header's padding */
    vertical-align: middle; /* Helps align with other potential inline-block elements or the switcher's perceived middle */
}

.language-switcher-container {
    position: absolute; /* Take switcher out of normal flow */
    right: 20px;        /* Position 20px from the right edge of the header */
    top: 50%;           /* Position its top at the vertical midpoint of the header */
    transform: translateY(-50%); /* Shift it up by half of its own height to truly center it vertically */

    /* Styles for its internal content (label + select) */
    display: flex;
    align-items: center; /* Vertically align label and select within this container */
}

.language-switcher-container label {
    margin-right: 6px; /* Space between label and select */
    font-size: 0.75em;  /* Smaller font size for the label */
    font-weight: normal; /* Less emphasis */
    color: #e0e0e0;    /* Light color to be visible on the dark header */
    flex-shrink: 0; /* Prevent the label from shrinking if space is tight */
}

#language-switcher {
    padding: 3px 5px;     /* Reduced padding to make it smaller */
    font-size: 0.75em;    /* Smaller font size for the select box */
    border-radius: 3px;   /* Slightly smaller border radius */
    border: 1px solid #6c757d; /* A border that works on dark backgrounds */
    background-color: #495057; /* A darker background for the select element */
    color: #ffffff;       /* White text for the selected option */
    cursor: pointer;
    flex-grow: 1; /* Allows the select to expand within the container's fixed width */
    width: auto;
    min-width: 70px;
}

/* Styling the <option> elements when the dropdown is open */
#language-switcher option {
    background-color: #ffffff; /* Light background for the options themselves */
    color: #333333;       /* Dark text for the options */
}

main {
    flex: 1;
    padding: 20px;
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

section {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

h2 {
    color: #35424a;
    text-align: center;
    margin-bottom: 20px;
}

.selection-group {
    margin-bottom: 15px;
}

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

.select-with-icon {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
}

.select-with-icon img.icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: contain;
}

select {
    width: calc(100% - 55px);
    padding: 10px;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #f9f9f9;
}

#weapon-checkbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust item width */
    gap: 12px; /* Increased gap for better touch targets/visual separation */
    margin-top: 10px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0; /* Softer border */
    padding: 12px;
    border-radius: 5px; /* Consistent with other elements */
    background-color: #f9f9f9; /* Light background for the container */
}

@media (min-width: 768px) {
    #weapon-checkbox-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    #weapon-checkbox-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

.weapon-checkbox-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px; /* Reduced padding for a more compact look */
    border: 2px solid #ddd; /* Slightly thicker border for clickability */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease; /* Added transform */
    background-color: #fff; /* White background for items */
}

.weapon-checkbox-item:hover {
    border-color: #007bff; /* Highlight border on hover */
    background-color: #f0f8ff; /* AliceBlue, a very light blue hover */
    transform: translateY(-2px); /* Slight lift on hover */
}

.weapon-checkbox-item.selected {
    background-color: #d1eaff; /* Brighter blue for selected state */
    border-color: #007bff; /* Stronger blue border for selected */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3); /* Subtle glow for selected */
}

.weapon-checkbox-item.selected:hover {
    background-color: #badeff; /* Slightly darker blue on hover when selected */
}


.weapon-checkbox-item img.weapon-item-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 5px;
}

.weapon-checkbox-item span.weapon-item-name {
    font-size: 0.8em;
    line-height: 1.2;
    color: #333;
    word-break: break-word;
    min-height: 2.4em; /* Reserve space for two lines of text to prevent layout shifts */
}

#weapon-validation-message {
    color: #000000;
    font-size: 0.8em;
    margin-bottom: 8px;
}

button {
    display: block;
    width: 100%;
    padding: 12px;
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

button:hover {
    background: #4cae4c;
}

button:disabled {
    background-color: #cccccc;
    color: #666666;
    border-color: #999999;
    opacity: 0.7;
    cursor: not-allowed;
}

#results-area {
    margin-top: 30px;
    text-align: center;
}

#predicted-rating {
    font-size: 2.5em;
    font-weight: bold;
    color: #337ab7;
    margin-top: 10px;
    padding: 15px;
    background-color: #e9f2f9;
    border-radius: 5px;
    display: inline-flex;
    width: 180px;
    height: 120px;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    text-align: center;
}

footer {
    text-align: center;
    padding: 15px;
    background: #35424a;
    color: #ffffff;
    font-size: 0.8em;
}

.footer-github-info {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #5a6268; 
}

.footer-github-info p {
    margin: 5px 0;
    line-height: 1.4;
}

.footer-github-info a {
    color: #a9d1f8;
    text-decoration: underline;
    transition: color 0.2s ease; /* Smooth color transition on hover */
}

.footer-github-info a:hover {
    color: #ffffff; /* Link becomes white on hover */
    text-decoration: none; /* Remove underline on hover */
}
