/* Respark Frontend Styles - Premium SaaS Design */

:root {
    --respark-primary: #10b981;       /* Emerald 500 */
    --respark-primary-dark: #059669;  /* Emerald 600 */
    --respark-bg-surface: #ffffff;
    --respark-bg-subtle: #f9fafb;     /* Gray 50 */
    --respark-border: #e5e7eb;        /* Gray 200 */
    --respark-text-main: #111827;     /* Gray 900 */
    --respark-text-muted: #6b7280;    /* Gray 500 */
    --respark-radius: 12px;
    --respark-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.respark-boosted-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 10px;
    font-family: var(--respark-font);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.respark-boosted-container * {
    box-sizing: border-box;
}

.respark-boosted-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* --- Card Design --- */

.respark-product-card {
    background: var(--respark-bg-surface);
    border: 1px solid var(--respark-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%; /* Ensures equal height in grid */
}

.respark-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

/* --- Image Wrapper (Fixed the Gap) --- */

.respark-product-image-wrapper {
    position: relative;
    width: 100%;
    background: var(--respark-bg-subtle);
    border-bottom: 1px solid var(--respark-border);
    display: flex;            /* THIS FIXES THE GAP */
    align-items: center;      /* Centers content */
    justify-content: center;
    overflow: hidden;
}

@supports not (aspect-ratio: 1 / 1) {
    .respark-product-image-wrapper {
        height: 280px; /* Fallback height */
    }
}

.respark-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;           /* Ensures no inline spacing */
    transition: transform 0.5s ease;
}

.respark-product-card:hover .respark-product-image {
    transform: scale(1.05);
}

/* --- Badge --- */

.respark-boosted-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--respark-primary-dark);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Content --- */

.respark-product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes content to fill height */
}

.respark-product-header {
    margin-bottom: 12px;
}

.respark-product-id {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    color: var(--respark-text-muted);
    background: var(--respark-bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.respark-product-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--respark-text-main);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Footer (Old Title) --- */

.respark-product-footer {
    margin-top: auto; /* Pushes this section to the bottom */
    padding-top: 16px;
    border-top: 1px dashed var(--respark-border);
}

.respark-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--respark-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.respark-old-title-text {
    font-size: 13px;
    color: var(--respark-text-muted);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Keep compact */
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

/* --- Pagination --- */

.respark-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.respark-pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--respark-border);
    border-radius: 6px;
    color: var(--respark-text-main);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.respark-pagination-link:hover {
    background: var(--respark-bg-subtle);
    border-color: #d1d5db;
}

.respark-pagination-link.respark-pagination-current {
    background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .respark-boosted-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .respark-boosted-grid { grid-template-columns: repeat(2, 1fr); }
    .respark-product-content { padding: 16px; }
}

@media (max-width: 480px) {
    .respark-boosted-grid { grid-template-columns: 1fr; }
}