:root {
    --sp-primary: #10b981;
    --sp-primary-dark: #059669;
    --sp-text: #1f2937;
    --sp-bg-light: #f3f4f6;
    --sp-border: #e5e7eb;
}

.scam-prevention-archive {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Controls */
.sp-controls {
    margin-bottom: 2rem;
    background: #fff;
    padding: 15px;
    border: 1px solid var(--sp-border);
    border-radius: 8px;
}

.sp-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    align-items: center;
}

/* Desktop: Line up controls */
@media (min-width: 992px) {
    .sp-search-form {
        flex-wrap: nowrap !important;
    }
}

.sp-search-form input[type="text"] {
    flex: 1 1 auto; /* Allows the search bar to grow and take up empty space */
    min-width: 250px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--sp-border);
    border-radius: 6px;
    font-size: 0.95rem;
}

.sp-search-form select {
    flex: 0 1 auto; /* Prevents the dropdown from getting too long */
    width: auto;
    min-width: 150px !important;
    padding: 0.6rem 2rem 0.6rem 1rem;
    border: 1px solid var(--sp-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #fff;
    cursor: pointer;
}

div.sp-controls .sp-search-form button[type="submit"] {
    padding: 0.6rem 1.5rem;
    background-color: var(--sp-primary) !important;
    color: white !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    white-space: nowrap;
    flex: 0 0 auto;
    width: auto;
    margin-left: 5px;
}

div.sp-controls .sp-search-form button[type="submit"]:hover {
    background-color: var(--sp-primary-dark) !important;
}

/* Grid */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.sp-card {
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.sp-card:hover {
    transform: translateY(-4px);
}

.sp-card-image {
    width: 100%;
    margin: 0;
    padding: 0;
}

.sp-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.sp-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sp-card-title {
    margin: 0 0 2.5rem 0 !important;
    padding-bottom: 0 !important;
    font-size: 1.25rem;
    line-height: 1.4;
    display: block;
}

.sp-card-title a {
    color: var(--sp-text);
    text-decoration: none;
    display: block;
}

.sp-card-title a:hover {
    color: var(--sp-primary);
}

/* Threat Badge in Card */
.sp-threat-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background-color: var(--sp-primary) !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem;
    align-self: flex-start;
    line-height: 1;
}

/* Intro Text */
.sp-archive-intro {
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--sp-text);
}

.sp-card-excerpt {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    flex: 1;
}

.sp-read-more {
    display: inline-block;
    text-align: center;
    padding: 0.6rem 1rem;
    background-color: var(--sp-primary);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.sp-read-more:hover {
    background-color: var(--sp-primary-dark);
    color: white;
}

/* Pagination */
.sp-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.sp-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--sp-border);
    margin: 0 0.25rem;
    text-decoration: none;
    color: var(--sp-text);
    border-radius: 4px;
}

.sp-pagination .page-numbers.current,
.sp-pagination .page-numbers:hover {
    background-color: var(--sp-primary);
    color: white;
    border-color: var(--sp-primary);
}

/* --- New "Security Card" Design --- */
.sp-security-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 20px 0 30px;
    font-family: inherit;
    max-width: 500px;
    width: 100%;
}

.sp-card-header {
    background-color: #10b981;
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper for Title + Icon */
.sp-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.sp-header-title .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #fff;
    vertical-align: middle;
}

.sp-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.sp-card-body {
    padding: 20px;
}

.sp-data-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sp-data-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sp-data-row:first-child {
    padding-top: 0;
}

.sp-label-col {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

/* Arrow Separator > */
.sp-label-col::after {
    content: "\203A";
    margin-left: auto;
    margin-right: 12px;
    color: #9ca3af;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s;
}

.sp-label-col svg {
    color: #9ca3af;
    width: 18px;
    height: 18px;
}

.sp-value-col {
    flex: 1;
    font-size: 1rem;
    color: #111;
    line-height: 1.5;
}

/* Tag Styles */
.sp-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.sp-tag.critical {
    background-color: #ef4444;
}

.sp-tag.high {
    background-color: #f97316;
}

.sp-tag.medium {
    background-color: #f59e0b;
}

.sp-tag.low {
    background-color: #10b981;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .sp-data-row {
        flex-direction: column;
        gap: 5px;
    }

    .sp-label-col {
        flex: auto;
        width: 100%;
        color: #6b7280;
        font-size: 0.85rem;
    }

    /* Hide arrow on label */
    .sp-label-col::after {
        display: none;
    }

    /* Add arrow > before value items */
    .sp-value-col {
        display: flex;
        align-items: baseline;
    }

    .sp-value-col::before {
        content: "\203A";
        margin-right: 8px;
        color: #9ca3af;
        font-weight: 700;
        font-size: 1.5rem;
        line-height: 1;
    }
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .sp-controls {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .sp-search-form {
        /* Removed the strict 300px width limit so it can grow */
        width: 100%;
    }
}

/* Related Scams Section */
.sp-related-scams {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.sp-related-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--sp-text);
}

.sp-related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.sp-related-card {
    flex: 1 1 300px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s;
}

.sp-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sp-related-thumb img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.sp-related-content {
    padding: 15px;
}

.sp-related-item-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.sp-related-item-title a {
    color: var(--sp-text);
    text-decoration: none;
}

.sp-related-item-title a:hover {
    color: var(--sp-primary);
}