/* EGP Card Items Styles */
.egp-carditem-container {
    margin-bottom: 40px;
}

/* Filter Section */
.egp-filter-section {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.egp-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.egp-search-box {
    flex: 1 1 280px;
}

.egp-filter-box {
    display: flex;
    gap: 10px;
    flex: 2 1 400px;
}

.egp-perpage-box {
    flex: 0 0 auto;
}

.egp-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.egp-search-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.egp-select {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    min-width: 140px;
    color: #333;
    transition: all 0.2s ease;
}

.egp-select:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Cards Container */
.egp-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Card Styles */
.egp-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
}

.egp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.egp-card-link {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: block;
}

.egp-card-image {
    height: 160px;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
}

.egp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.egp-card:hover .egp-card-image img {
    transform: scale(1.05);
}

.egp-card-main {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #f8f9fa;
}

.egp-card-no {
    font-size: 0.85rem;
    color: #0056b3;
    font-weight: 600;
    margin-bottom: 8px;
}

.egp-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.egp-card-details {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.egp-detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    line-height: 1.4;
}

.egp-label {
    color: #666;
    flex: 0 0 100px;
}

.egp-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.egp-doc-count {
    color: #0056b3;
    font-weight: 600;
}

/* Cards with documents */
.egp-card.has-documents {
    border-left: 3px solid #2196f3;
}

/* No Results */
.egp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    border: 1px dashed #e0e0e0;
}

.egp-no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #9e9e9e;
}

.egp-no-results-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.egp-no-results-suggestion {
    font-size: 0.95rem;
    color: #666;
}

/* Error Display */
.egp-error {
    grid-column: 1 / -1;
    background-color: #fff3f3;
    color: #d32f2f;
    padding: 16px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
}

/* Loading State */
.egp-cards-container.loading {
    min-height: 200px;
    position: relative;
}

.egp-cards-container.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    margin-left: -25px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .egp-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .egp-filter-box {
        flex-direction: column;
        gap: 8px;
    }
    
    .egp-cards-container {
        grid-template-columns: 1fr;
    }
    
    .egp-card-image {
        height: 140px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .egp-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1025px) {
    .egp-cards-container.large-cards {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}