/* assets/css/grctech-module-cards.css */

.cards-container {
    padding: 20px 0;
}

ul.cards {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 -10px; /* Offset padding on cards */
    padding: 0;
    justify-content: center;
}

.grctech-module-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    width: calc(25% - 20px); /* Four cards per row with spacing */
    max-width: 300px; /* Max width for very large screens */
    margin: 10px;
    background: linear-gradient(135deg, rgba(30, 35, 60, 0.75), rgba(50, 55, 80, 0.85));
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    overflow: hidden; /* Ensures content respects border-radius */
}

.grctech-module-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    background: linear-gradient(135deg, rgba(40, 45, 70, 0.8), rgba(60, 65, 90, 0.9));
    border-color: rgba(255, 255, 255, 0.25);
}

.grctech-module-card .card-image-wrapper {
    position: relative;
    border-radius: 18px 18px 0 0; /* Rounded top corners for image container */
    overflow: hidden; /* Clip image to rounded corners */
    margin: -12px -12px 12px -12px; /* Extend to card edges, add bottom margin */
}

.grctech-module-card .grctech-modal-trigger-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 160px; /* Adjusted image height for smaller cards */
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.grctech-module-card .grctech-modal-trigger-image:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.grctech-module-card .note {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px; /* Adjusted for border */
    border-radius: 10px;
    background-color: var(--primary-color, #8A2BE2); /* Use theme color or fallback */
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.grctech-module-card .card-content {
    padding: 0 8px 8px 8px; /* Adjusted padding */
    color: #E0E0E0; /* Light text for dark glassmorphism */
    flex-grow: 1; /* Allows content to fill space */
    display: flex;
    flex-direction: column;
}

.grctech-module-card .card-content h4 {
    font-size: 1.2em;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin-bottom: 10px;
}

.grctech-module-card .card-content .grctech-modal-description {
    font-size: 0.85em;
    line-height: 1.6;
    color: #E0E0E0; /* Brighter text for description */
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Calculate min-height to reserve space for 3 lines to prevent jumpiness */
    min-height: calc(0.85em * 1.5 * 3);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .grctech-module-card {
        width: calc(33.333% - 20px); /* Three cards per row */
    }
}

@media (max-width: 992px) {
    .grctech-module-card {
        width: calc(50% - 20px); /* Two cards per row */
    }
}

@media (max-width: 768px) {
    .grctech-module-card {
        width: calc(100% - 20px); /* One card per row */
        margin-left: auto;
        margin-right: auto;
    }
    ul.cards {
        margin-left: 0;
        margin-right: 0;
    }
}
