/* ============================================================
   Shopify App Detector - Styles
   Ecomlly Design System: --text:#16241C, --green:#1F8A52, Poppins
   ============================================================ */

#sad-detector-wrap {
    font-family: 'Poppins', sans-serif;
    color: #16241C;
    max-width: 900px;
    margin: 0 auto;
}

/* Input Row */
.sad-input-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

#sad-url {
    flex: 1;
    min-width: 240px;
    padding: 14px 18px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid #d0e8d8;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: #16241C;
    transition: border-color 0.2s;
}
#sad-url:focus {
    border-color: #1F8A52;
}
#sad-url::placeholder {
    color: #8fb89e;
}

#sad-submit-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #1F8A52, #1B6B42);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}
#sad-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
#sad-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.sad-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    font-size: 15px;
    color: #1F8A52;
    font-weight: 500;
}
.sad-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #d0e8d8;
    border-top-color: #1F8A52;
    border-radius: 50%;
    animation: sad-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes sad-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.sad-error {
    background: #fff5f5;
    border: 1.5px solid #f5c2c2;
    color: #c0392b;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* Summary Banner */
.sad-summary {
    background: linear-gradient(135deg, #1F8A52, #1B6B42);
    color: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.sad-summary-count {
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
}
.sad-summary-text h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}
.sad-summary-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

/* Zero apps state */
.sad-zero {
    text-align: center;
    padding: 40px 20px;
    color: #4a7c5c;
}
.sad-zero svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.sad-zero h3 {
    font-size: 18px;
    margin: 0 0 8px;
    color: #16241C;
}
.sad-zero p {
    margin: 0;
    font-size: 14px;
}

/* Category Group */
.sad-category-group {
    margin-bottom: 24px;
}
.sad-category-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1F8A52;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f4ed;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sad-category-count {
    background: #e8f4ed;
    color: #1B6B42;
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 11px;
    font-weight: 700;
}

/* App Cards Grid */
.sad-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.sad-app-card {
    background: #fff;
    border: 1.5px solid #e0ede6;
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sad-app-card:hover {
    border-color: #1F8A52;
    box-shadow: 0 4px 16px rgba(31,138,82,0.10);
}
.sad-app-name {
    font-size: 14px;
    font-weight: 600;
    color: #16241C;
    margin: 0;
}
.sad-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    background: #e8f4ed;
    color: #1B6B42;
    border-radius: 20px;
    padding: 2px 8px;
    font-weight: 600;
    width: fit-content;
}
.sad-app-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1F8A52;
}
.sad-app-desc {
    font-size: 12px;
    color: #5a7a66;
    margin: 0;
    line-height: 1.5;
}

/* No apps detected */
.sad-no-apps {
    background: #f6fbf8;
    border: 1.5px dashed #b0d9c0;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: #5a7a66;
}
.sad-no-apps p { margin: 0; font-size: 14px; }

/* Responsive */
@media (max-width: 600px) {
    .sad-input-row { flex-direction: column; }
    #sad-submit-btn { width: 100%; }
    .sad-summary-count { font-size: 38px; }
    .sad-app-grid { grid-template-columns: 1fr; }
}
