/* Category Grid Display Styles - Enhanced Design */
.cgd-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive columns */
    gap: 25px; /* Space between grid items */
    margin-bottom: 30px;
    padding: 10px 0; /* Add some padding around the grid */
}

.cgd-category-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* Ensures content respects border-radius */
    display: flex; /* Use flex to structure content within the card */
    flex-direction: column; /* Stack content vertically */
}

.cgd-category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.cgd-category-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Make the link take up all space in the card */
    padding: 20px;
}

.cgd-category-item .cgd-category-content {
    flex-grow: 1; /* Allows content to fill space, pushing footer down */
}

.cgd-category-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.4em; /* Larger title */
    font-weight: 600;
    color: #2c3e50; /* Darker, more modern color */
    line-height: 1.3;
}

.cgd-category-description {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
    min-height: 60px; /* Give some consistent space for descriptions */
}

.cgd-category-footer {
    margin-top: auto; /* Pushes footer to the bottom if content is short */
    padding-top: 10px; /* Space above the footer content */
    border-top: 1px solid #eee; /* Subtle separator */
}

.cgd-category-count {
    font-size: 0.85em;
    color: #7f8c8d; /* Softer color for meta info */
    text-align: right;
}

/* Message Styling (if no categories are selected or found) */
.cgd-no-categories-message {
    padding: 20px;
    background-color: #fefae0; /* Light yellow */
    border: 1px solid #fae588;
    color: #8a6d3b; /* Darker yellow/brown for text */
    border-radius: 6px;
    text-align: center;
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .cgd-category-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 20px;
    }

    .cgd-category-item {
        margin-bottom: 0; /* Gap handles spacing */
    }
}