/* Directory Container */
.directory-container {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

/* Sidebar Filters */
.filters-sidebar {
    flex: 1 1 20%;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 0;
    min-width: 300px;
    box-sizing: border-box;
    max-height: fit-content;
}

.filters-sidebar h2 {
    margin: 0;
    background-color: #000;
    color: #fff;
    padding: 0.75rem;
    font-size: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.filter-group {
    margin: 1rem;
}

.filter-group label {
    display: flex;
    align-items: center;
    font-weight: bold;
}

/* Checkbox Styling */
.filters-sidebar input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 22px;
    height: 22px;
    border: 0.2px solid #000;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    background-color: #fff;
    cursor: pointer;
}

.filters-sidebar input[type="checkbox"]:hover {
    background-color: #f0f0f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filters-sidebar input[type="checkbox"]:checked {
    background-color: #007bff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.173 11.233l-3.482-3.483 1.237-1.237 2.245 2.246 5.088-5.088 1.237 1.237z'/%3E%3C/svg%3E");
    background-size: 22px;
    background-position: center;
    background-repeat: no-repeat;
}

.filters-sidebar input[type="checkbox"]:checked:hover {
    background-color: #0056b3;
}

/* Search Input */
.filter-input {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    height: 50px;
}

/* Submit Button */
.filter-submit {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    width: calc(100% - 2rem);
    margin: 1rem;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-submit:hover {
    background-color: #0056b3;
}

/* Collapsible Filter Sections */
.collapsible {
    border: none;
    margin: 0 1rem;
}

.collapsible-btn {
    background-color: transparent;
    border: none;
    color: #000;
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
    width: 100%;
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.collapsible-btn::after {
    content: "+";
    margin-left: auto;
    font-size: 1.5rem;
}

.collapsible-btn.active::after {
    content: "-";
}

.collapsible-content {
    display: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.collapsible-content label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.collapsible.active .collapsible-content {
    display: block;
}

/* Directory Results */
.directory-results {
    flex: 1 1 75%;
    box-sizing: border-box;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin: 0 auto;
    gap: 1rem;
    place-items: start;
}

.result-item {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Make the entire card clickable */
.result-item .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0;
}

/* Add hover effect for the card */
/*.result-item .card:hover {*/
/*    transform: translateY(-5px);*/
/*    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);*/
/*}*/

/* Card Image */
.card-image img {
    width: 100%;
    height: 100%;
    /*max-height: 400px; This will only need applied when items are less than 3*/
    display: block;
    object-fit: cover;
    background-color: #f0f0f0;
}

/* Card Body */
.card-content {
    padding: 1rem;
    background-color: #000;
    color: #fff;
    text-align: center;
    font-weight: bold;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
    transition: color 0.3s ease;
}

/* Bold Text */
.card-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
    transition: color 0.3s ease;
}

.result-item .card:hover .card-content h3 {
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .directory-container {
        flex-direction: column;
    }

    .filters-sidebar {
        flex: 1 1 100%;
    }

    .directory-results {
        flex: 1 1 100%;
    }
}

@media (max-width: 675px) {
    .results-grid {
        display: inline-block;
    }

    .result-item {
        margin-bottom: 1em;
    }

    .result-item:last-child {
        margin-bottom: 0;
    }
}

/* Loading Indicator while the section filters */
.loading-indicator {
    /*position: fixed;*/
    /*top: 50%;*/
    /*left: 50%;*/
    /*transform: translate(-50%, -50%);*/
    /*z-index: 9999; !* Ensure it appears on top of other elements *!*/
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.8); /* Optional: Add a semi-transparent background */
    padding: 1rem;
    /*border-radius: 8px; !* Optional: Rounded edges for the container *!*/
    /*box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); !* Optional: Add a subtle shadow *!*/
}

.spinner {
    animation: rotate 2s linear infinite;
}

.spinner .path {
    stroke: #007bff; /* Primary color */
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

/* Rotate the spinner */
@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* Dash animation for the spinner's path */
@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Hide results grid when loading indicator is active */
.results-grid.loading {
    visibility: hidden;
}

.results-grid.hidden {
    display: none;
}