/* Styles for the main wrapper (affects both sections) */
#section-api-documents {
    display: flex;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
    padding: 3rem;
}

/* Filters section styles (separate from solution cards) */
#section-filters {
    position: sticky;
    top: 100px; /* Stops scrolling at this point */
    width: 20%;
    min-width: 250px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 100;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

#section-filters .doc-section-inner {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#section-filters .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#section-filters h3 {
    color: rgb(var(--color-blue));
    font-size: 1.5rem;
    font-family: var(--font-family-nb-international-pro);
    margin: 0;
    margin-bottom: 10px;
}

#section-filters .filter-count {
    background: rgb(var(--color-blue));
    color: rgb(var(--color-white));
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#section-filters .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

#section-filters .filter-group {
    display: flex;
    flex-direction: column;
    max-width: 200px !important;
}

#section-filters .filter-group label {
    font-weight: 600;
    color: rgb(var(--color-blue));
    margin-bottom: 8px;
    font-size: 1.1rem;
}

#section-filters .filter-select {
    padding: 10px 12px;
    border: 2px solid rgb(var(--color-blue));
    border-radius: 15px;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    background: white;
}

#section-filters .filter-select:focus {
    outline: none;
    border-color: rgb(var(--color-green));
    box-shadow: 0 0 0 3px rgba(var(--color-green), 0.1);
}

#section-filters .filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

#section-filters .clear-filters {
    background: none;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    color: rgb(var(--color-blue));
}

#section-filters .clear-filters:hover {
    background: #f5f5f5;
    border-color: rgb(var(--color-green));
}

/* Solution Cards section styles (properly contained) */
#section-document-cards {

    .section-solution-cards-cards {
        margin-top: 0px !important;
    }

    .solution-card-body img {
        max-height: 320px !important;
    }

    /* Filter Section Styles (for any filters within the cards section) */
    .filter-section {
        background: white;
        border-radius: 12px;
        padding: 24px;
        margin: 64px 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Card Tags */
    .card-tags {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 16px !important;
        margin-bottom: 16px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        -ms-overflow-style: none;
    }
    
    .card-tags::-webkit-scrollbar {
        height: 4px;
    }

    .card-tags::-webkit-scrollbar-track {
        background: transparent;
    }

    .card-tags::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 2px;
    }

    .card-tags::-webkit-scrollbar-thumb:hover {
        background: #bbb;
    }

    .tag {
        background: #f8f9fa;
        color: #495057;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.65em;
        font-weight: 500;
        border: 1px solid #dee2e6;
        white-space: nowrap;
        flex-shrink: 0;
    }

/*
    .tag.industry { background: #e3f2fd; color: #1976d2; border-color: #bbdefb; }
    .tag.document { background: #f3e5f5; color: #7b1fa2; border-color: #e1bee7; }
    .tag.geography { background: #e8f5e8; color: #388e3c; border-color: #c8e6c9; }
    .tag.usecase { background: #fff3e0; color: #f57c00; border-color: #ffcc02; }
*/

    /* Card Filtering Animation */
    .solution-card {
        transition: all 0.3s ease;
        opacity: 1;
        transform: scale(1);
    }

    .solution-card.hidden {
        opacity: 0;
        transform: scale(0.95);
        pointer-events: none;
        margin: 0;
        padding: 0;
        height: 0;
        overflow: hidden;
    }

    .solution-card h3 {
        margin-top: 0rem !important;
        height: calc(2 * 1.2em); /* 2 lines × line-height */
        line-height: 1.2; /* Set consistent line-height */
    }

    .solution-card h3 a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 0rem !important;
        line-height: inherit; /* Inherit from parent h3 */
        height: 100%; /* Fill the h3 container */
    }

    .solution-card-body img {
        max-height: 220px !important;
    }

    /* Override specific grid behavior within this container */
    .doc-section > .doc-section-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

}

/* Responsive styles for both sections */
@media (max-width: 768px) {
    #section-api-documents {
        flex-direction: column;
    }

    #section-filters {
        position: relative;
        width: 100%;
        top: 0;
    }

    #section-filters .filter-grid {
        grid-template-columns: 1fr;
    }

    #section-filters .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #section-filters .filter-section {
        margin: 32px 16px;
        padding: 16px;
    }
}