/* =============================================================
   SaaS Compare Plugin – v3.0
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------
   SEARCH WIDGET
--------------------------------------------------------------- */
.sc-search-widget { position: relative; font-family: inherit; }

/* Pill-style search bar — like the screenshot */
.sc-search-wrap {
    display: flex;
    align-items: center;
    border: none;
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
    padding: 6px 6px 6px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    transition: box-shadow .2s;
}
.sc-search-wrap:focus-within {
    box-shadow: 0 6px 32px rgba(59,76,232,0.18);
}
.sc-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px 12px 10px 0;
    font-size: 15px;
    background: transparent !important;
    color: #1e293b;
    font-family: inherit;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
.sc-search-input::placeholder { color: #94a3b8; }
.sc-search-input:focus,
.sc-search-input:focus-visible,
.sc-search-input:focus-within,
.sc-search-input:active,
.sc-search-widget input,
.sc-search-widget input:focus,
.sc-search-widget input:focus-visible,
.sc-search-widget input:active,
.sc-search-widget input:hover {
    outline: none !important;
    outline-width: 0 !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-color: transparent !important;
    -webkit-box-shadow: none !important;
}
.sc-search-wrap:focus-within {
    box-shadow: 0 6px 32px rgba(59,76,232,0.18) !important;
    outline: none !important;
    border: none !important;
}

/* Icon-only circular button */
.sc-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: #3b4ce8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s, transform .15s;
    color: #fff;
}
.sc-search-btn:hover {
    background: #2d3dd4;
    transform: scale(1.05);
}
.sc-search-btn svg {
    stroke: #fff;
    display: block;
}

/* Suggestions dropdown */
.sc-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.13);
    z-index: 9999;
    max-height: 340px;
    overflow-y: auto;
}
.sc-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.sc-suggestion-item:last-child { border-bottom: none; }
.sc-suggestion-item:hover { background: #f8fafc; }

.sc-suggestion-logo {
    width: 34px; height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.sc-suggestion-logo--placeholder {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: #3b4ce8;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.sc-suggestion-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.sc-suggestion-cat  { font-size: 12px; color: #64748b; margin-top: 2px; }

.sc-suggestion-add {
    margin-left: auto;
    background: #eef2ff;
    color: #3b4ce8;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.sc-suggestion-add:hover { background: #3b4ce8; color: #fff; }
.sc-suggestion-add.sc-in-tray { background: #dcfce7; color: #16a34a; }

.sc-no-results {
    padding: 18px;
    color: #64748b;
    text-align: center;
    font-size: 14px;
}

/* Compare tray (search widget) */
.sc-compare-tray {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
}
.sc-tray-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }

.sc-chip {
    display: flex; align-items: center; gap: 6px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 20px;
    padding: 5px 10px 5px 8px;
    font-size: 13px; font-weight: 600;
}
.sc-chip-remove {
    background: none; border: none; cursor: pointer;
    color: #6366f1; font-size: 16px; line-height: 1; padding: 0;
}
.sc-chip-remove:hover { color: #dc2626; }

.sc-compare-now-btn {
    background: #3b4ce8; color: #fff;
    border: none; border-radius: 8px;
    padding: 9px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .2s; white-space: nowrap;
    font-family: inherit;
}
.sc-compare-now-btn:disabled { background: #c7d2fe; cursor: not-allowed; }
.sc-compare-now-btn:not(:disabled):hover { background: #2d3dd4; }

.sc-clear-tray-btn {
    background: none; color: #64748b;
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 9px 14px; font-size: 13px; cursor: pointer;
    font-family: inherit;
}
.sc-clear-tray-btn:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ---------------------------------------------------------------
   COMPARE CARDS  (used by both search widget and grid widget)
--------------------------------------------------------------- */
.sc-compare-result,
.sc-grid-compare-result { margin-top: 28px; }

.sc-compare-grid {
    display: grid;
    gap: 20px;
}
.sc-compare-grid--1 { grid-template-columns: 1fr; max-width: 380px; }
.sc-compare-grid--2 { grid-template-columns: repeat(2, 1fr); }
.sc-compare-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .sc-compare-grid--2,
    .sc-compare-grid--3 { grid-template-columns: 1fr; }
}

.sc-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.sc-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.09);
    transform: translateY(-2px);
}

.sc-card-header {
    background: #FAFBFC;
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 20px 16px;
    display: flex; align-items: center; gap: 14px;
}
.sc-card-logo {
    width: 50px; height: 50px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.sc-card-logo--placeholder {
    width: 50px; height: 50px;
    border-radius: 10px;
    background: #3b4ce8;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    flex-shrink: 0;
}
.sc-card-name {
    margin: 0; padding: 0;
    color: #1e293b;
    font-size: 17px; font-weight: 700;
    line-height: 1.2;
}
.sc-card-category {
    display: inline-block; margin-top: 4px;
    background: #eef2ff; color: #3b4ce8;
    font-size: 11px; font-weight: 600;
    padding: 2px 9px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .5px;
}

.sc-card-body {
    padding: 18px 20px 20px;
    flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.sc-card-tagline { margin: 0; font-size: 13px; color: #475569; font-style: italic; }
.sc-card-desc    { margin: 0; font-size: 13px; color: #64748b; line-height: 1.6; }

/* King Key badge */
.sc-king-key {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
}
.sc-king-key-crown {
    display: none;
}
.sc-king-key-text {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}
.sc-king-key-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    margin-bottom: 2px;
}

.sc-card-meta {
    list-style: none; margin: 0; padding: 10px 14px;
    background: #f8fafc; border-radius: 8px;
    display: flex; flex-direction: column; gap: 7px;
}
.sc-card-meta li {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px;
}
.sc-meta-label { color: #64748b; font-weight: 500; }
.sc-card-meta li > span:last-child { color: #1e293b; font-weight: 600; text-align: right; }

.sc-star        { color: #cbd5e1; font-size: 14px; }
.sc-star.filled,
.sc-star--filled { color: #f59e0b; }

.sc-features { }
.sc-features-title {
    margin: 0 0 7px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .7px; color: #94a3b8;
}
.sc-features ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sc-features ul li {
    font-size: 13px; color: #334155;
    padding-left: 18px; position: relative;
}
.sc-features ul li::before { content: '✓'; position: absolute; left: 0; color: #22c55e; font-weight: 700; }

/* Two CTA buttons — now just Visit + Add to Compare handled separately */
.sc-card-cta-wrap {
    margin-top: auto;
    display: flex;
    gap: 8px;
}
.sc-card-cta-visit {
    display: block; text-align: center;
    font-weight: 600; font-size: 13px;
    padding: 10px 12px; border-radius: 8px;
    transition: all .2s; border: none; cursor: pointer;
    font-family: inherit; text-decoration: none;
    flex: 1;
    background: #3b4ce8; color: #fff;
}
.sc-card-cta-visit:hover { background: #2d3dd4; color: #fff; text-decoration: none; }

/* Hide review button everywhere */
.sc-card-cta-review { display: none !important; }

/* ---------------------------------------------------------------
   TOOLS GRID WIDGET
--------------------------------------------------------------- */
.sc-grid-widget { }

/* Filter bar */
.sc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.sc-filter-btn {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.sc-filter-btn:hover { border-color: #3b4ce8; color: #3b4ce8; }
.sc-filter-btn.active {
    background: #3b4ce8;
    border-color: #3b4ce8;
    color: #fff;
}

/* Grid */
.sc-grid {
    display: grid;
    gap: 20px;
}
.sc-grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.sc-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sc-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sc-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .sc-grid-cols-3,
    .sc-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .sc-grid-cols-2,
    .sc-grid-cols-3,
    .sc-grid-cols-4 { grid-template-columns: 1fr; }
}

/* Grid card */
.sc-grid-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.sc-grid-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.sc-grid-card-header {
    background: #FAFBFC;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 18px;
    display: flex; align-items: center; gap: 12px;
}
.sc-grid-logo {
    width: 44px; height: 44px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.sc-grid-logo-placeholder {
    width: 44px; height: 44px;
    border-radius: 9px;
    background: #3b4ce8;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
    flex-shrink: 0;
}
.sc-grid-card-name {
    font-size: 15px; font-weight: 700; color: #1e293b;
    margin: 0; line-height: 1.2;
}
.sc-grid-card-cat {
    display: inline-block; margin-top: 4px;
    background: #eef2ff; color: #3b4ce8;
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .4px;
}

.sc-grid-card-body {
    padding: 14px 18px 16px;
    flex: 1; display: flex; flex-direction: column; gap: 10px;
}
.sc-grid-card-meta {
    display: flex; flex-direction: column; gap: 5px;
}
.sc-grid-card-pricing {
    font-size: 13px; color: #475569; font-weight: 500;
}
.sc-grid-stars {
    font-size: 13px; color: #f59e0b;
}
.sc-grid-stars small { color: #94a3b8; font-size: 12px; }

/* King Key on grid card */
.sc-grid-king-key {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.sc-grid-king-key-crown { display: none; }

/* Grid card buttons — Visit + Compare side by side, equal size */
.sc-grid-card-btns {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: auto;
}
.sc-grid-visit-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    text-decoration: none;
    border: none;
    background: #3b4ce8;
    color: #fff;
}
.sc-grid-visit-btn:hover { background: #2d3dd4; color: #fff; text-decoration: none; }

/* Hide review button */
.sc-grid-review-btn { display: none !important; }

/* Add to compare — identical height, outlined style */
.sc-grid-add-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 8px;
    background: transparent;
    color: #3b4ce8;
    border: 2px solid #3b4ce8;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    width: auto;
}
.sc-grid-add-btn:hover { background: #eef2ff; }
.sc-grid-add-btn.sc-grid-added {
    background: #dcfce7; color: #16a34a; border-color: #86efac;
}
.sc-grid-add-btn.sc-grid-added:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Floating tray for grid widget */
.sc-float-tray {
    position: sticky; bottom: 20px;
    z-index: 999;
    background: #1e293b;
    color: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    margin: 20px 0 0;
}
.sc-float-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.sc-float-chip {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px; font-weight: 500;
}
.sc-float-chip-remove {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.7); font-size: 15px; line-height: 1; padding: 0;
}
.sc-float-chip-remove:hover { color: #f87171; }

.sc-float-compare-btn {
    background: #3b4ce8; color: #fff;
    border: none; border-radius: 8px;
    padding: 9px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .2s; white-space: nowrap;
    font-family: inherit;
}
.sc-float-compare-btn:disabled { background: #374151; color: #6b7280; cursor: not-allowed; }
.sc-float-compare-btn:not(:disabled):hover { background: #2d3dd4; }

.sc-float-clear-btn {
    background: none; color: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
    padding: 9px 14px; font-size: 13px; cursor: pointer;
    font-family: inherit;
}
.sc-float-clear-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Loading / error */
.sc-loading {
    text-align: center; padding: 30px; color: #64748b; font-size: 14px;
}
.sc-loading::before {
    content: '';
    display: block; margin: 0 auto 10px;
    width: 30px; height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b4ce8;
    border-radius: 50%;
    animation: sc-spin .7s linear infinite;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }

.sc-error {
    background: #fef2f2; color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 8px; padding: 14px 16px;
    font-size: 14px; text-align: center;
}
