/* Main Wrapper */
.cspm-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
	border: 1px solid #bbb;
}

.cspm-title {
    margin: 0 0 20px 0;
    padding: 0 0 15px 0;
    border-bottom: 3px solid #28a745;
    color: #159000;
    font-size: 1.4em;
    font-weight: 600;
}

/* Matches Container */
.cspm-matches {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Single Match Item */
.cspm-match-item {
    display: flex;
    gap: 20px;
    background: #f9fffa;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #28a745;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
h4.cspm-match-title {
    letter-spacing: -1px !important;
    color: #3f3e3e;
}
.cspm-match-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Match Image */
.cspm-match-image {
    flex-shrink: 0;
    width: 120px;
}

.cspm-match-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.cspm-match-image a:hover img {
    transform: scale(1.05);
}

/* Match Content */
.cspm-match-content {
    flex: 1;
    min-width: 0;
}

.cspm-match-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.3;
}

.cspm-match-title a {
    color: #28a745;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.cspm-match-title a:hover {
    color: #1e7e34;
}

.cspm-external-icon {
    font-size: 0.8em;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cspm-match-title a:hover .cspm-external-icon {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Match Excerpt */
.cspm-match-excerpt {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cspm-match-excerpt p {
    margin: 0;
}

/* Taxonomy Terms */
.cspm-match-terms {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
	
}

.cspm-match-terms span {
    display: inline-block;
    padding: 4px 10px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.8em;
    border-radius: 20px;
}

/* Multiple Matches Layout */
.cspm-matches-count-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 992px) {
    .cspm-matches-count-3,
    .cspm-matches-count-4 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* In Tab Display (no wrapper needed) */
.woocommerce-Tabs-panel--matching_projects .cspm-matches {
    margin-top: 0;
}

.woocommerce-Tabs-panel--matching_projects .cspm-match-item:first-child {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cspm-wrapper {
        padding: 20px;
        margin: 20px 0;
    }
    
    .cspm-match-item {
        flex-direction: column;
        padding: 15px;
    }
    
    .cspm-match-image {
        width: 100%;
    }
    
    .cspm-match-image img {
        width: 100%;
        height: 180px;
    }
    
    .cspm-matches-count-2 {
        grid-template-columns: 1fr;
    }
    
    .cspm-title {
        font-size: 1.2em;
    }
}


/* Animation on Load */
@keyframes cspm-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cspm-match-item {
    animation: cspm-fade-in 0.4s ease forwards;
}

.cspm-match-item:nth-child(2) {
    animation-delay: 0.1s;
}

.cspm-match-item:nth-child(3) {
    animation-delay: 0.2s;
}

.cspm-match-item:nth-child(4) {
    animation-delay: 0.3s;
}