/* --- Main layout change for left-alignment --- */
.search-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Widen the search bar with a MORE SPECIFIC selector */
#custom-search-form {
    width: 100%;
    max-width: 960px; /* Set desired wider width here */
}

/* Remove self-centering from controls wrapper */
.search-labels-wrapper {
    margin: 15px 0 0 0;
    max-width: 100%;
    display: flex;
    align-items: center;
}

/* --- Make the sidebar less prominent --- */
main > aside {
    flex: 0 0 240px; /* Sets a fixed, narrower width for the sidebar */
    opacity: 0.85;   /* Makes it slightly transparent */
    transition: opacity 0.3s ease; /* Smooth transition for the hover effect */
    margin-left: 20px; /* Adds a little space between the search results and the sidebar */
}

main > aside:hover {
    opacity: 1; /* Make it fully opaque on hover for readability */
}


/* Blurring effect for non-vegan results */
.non-vegan-result {
    filter: blur(4px);
    opacity: 0.5;
    transition: all 0.3s ease;
}
.non-vegan-result:hover {
    filter: blur(0);
    opacity: 1;
}

/* Styles for the Safe Search toggle switch */
.safe-search-toggle { display: flex; align-items: center; gap: 8px; margin: 0 10px; }
.safe-search-toggle label { color: #ccc; font-size: 14px; user-select: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4d5052; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #26a269; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Helper class to hide elements */
.hidden {
    display: none !important;
}

/* Styles for the new exclude websites card */
.exclude-websites-card {
    margin-top: 20px;
}
.exclude-websites-card input[type="text"] {
    width: calc(100% - 22px); /* Account for padding */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #333;
    color: #eee;
}
.exclude-websites-card button {
    width: 100%;
    padding: 10px;
    background-color: #26a269;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}
.exclude-websites-card button:hover {
    background-color: #1e8b5a;
}
#exclusion-list {
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    border-top: 1px solid #444;
    padding-top: 10px;
}
#exclusion-list div {
    background-color: #444;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#exclusion-list div span {
    color: #eee;
    flex-grow: 1;
}
#exclusion-list div button {
    width: auto;
    padding: 5px 10px;
    margin-left: 10px;
    background-color: #d9534f;
    font-weight: normal;
}
#exclusion-list div button:hover {
    background-color: #c9302c;
}
.exclusion-message {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}
.exclusion-message.success {
    background-color: #28a745;
    color: white;
}
.exclusion-message.error {
    background-color: #dc3545;
    color: white;
}
.exclusion-message.info {
    background-color: #17a2b8;
    color: white;
}

/* --- DROPDOWN STYLES --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #3a3a3a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 100;
    border-radius: 5px;
    border: 1px solid #555;
    margin-top: 8px; /* Space between button and menu */
}

/* Highlight the active item in a dropdown menu */
.dropdown-menu .dropdown-item.active {
    background-color: #4f4f4f; /* A slightly lighter background */
    color: #ffffff;
    font-weight: 600;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background-color: transparent;
    border: none;
    border-radius: 0;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #555;
}

.dropdown-item:hover {
    background-color: #4f4f4f;
}

#more-dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7em;
    margin-left: 4px;
}

/* --- NEW: Styles to make sidebar elements smaller --- */

/* Reduce the size of the main heading (h3) in the sidebar */
aside h3 {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
}

/* Reduce the size of the sub-headings (strong) within sidebar cards */
aside .card strong {
    font-size: 1.0rem;
}

/* Make the call-to-action buttons in the sidebar smaller */
aside .call-to-action-button {
    padding: 8px 10px; /* Reduce vertical padding */
    font-size: 0.85rem;  /* Slightly smaller font */
    font-weight: 600;
}
