/* CipAuto AI Search - v3.0 - CipAuto Styling */

.cipauto-ai-search-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cipauto-ai-search-header {
    text-align: center;
    margin-bottom: 30px;
}

.cipauto-ai-search-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.cipauto-ai-icon {
    width: 36px;
    height: 36px;
    color: #3B00DD; /* CipAuto purple */
}

.cipauto-ai-search-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.cipauto-ai-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    transition: all 0.3s ease;
}

.cipauto-ai-search-box:focus-within {
    border-color: #3B00DD;
    box-shadow: 0 0 0 3px rgba(59, 0, 221, 0.1);
}

.cipauto-ai-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0 16px;
    transition: background-color 0.2s ease;
}

.cipauto-ai-search-input-wrapper:focus-within {
    background: #fff;
}

.cipauto-ai-search-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    margin-right: 12px;
    flex-shrink: 0;
}

.cipauto-ai-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 0;
    font-size: 16px;
    color: #1a1a1a;
    outline: none;
}

.cipauto-ai-search-input::placeholder {
    color: #9ca3af;
}

.cipauto-ai-search-clear {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    margin-left: 8px;
}

.cipauto-ai-search-clear svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.cipauto-ai-search-clear:hover {
    background: #e5e7eb;
}

.cipauto-ai-search-button {
    background: #3B00DD; /* CipAuto purple */
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cipauto-ai-search-button:hover {
    background: #2d00a8;
    transform: translateY(-1px);
}

.cipauto-ai-search-button:active {
    transform: translateY(0);
}

.cipauto-ai-search-button-icon {
    width: 20px;
    height: 20px;
}

.cipauto-ai-search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.cipauto-ai-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.cipauto-ai-search-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #3B00DD;
    border-radius: 50%;
    animation: cipauto-spin 0.8s linear infinite;
}

@keyframes cipauto-spin {
    to { transform: rotate(360deg); }
}

.cipauto-ai-search-loading-text {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Results */
.cipauto-ai-search-results {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.cipauto-ai-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.cipauto-ai-search-results-count {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cipauto-ai-search-results-clear {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cipauto-ai-search-results-clear:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

.cipauto-ai-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.cipauto-ai-search-filter-tag {
    background: #f3e8ff; /* Light purple */
    border: 1px solid #3B00DD;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2d00a8;
}

.cipauto-ai-search-filter-tag-label {
    font-weight: 600;
}

.cipauto-ai-search-filter-tag-value {
    font-weight: 400;
}

.cipauto-ai-search-feature-tag {
    background: #f0fdf4; /* Light green for features */
    border-color: #10b981;
    color: #047857;
}

.cipauto-ai-search-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #3B00DD;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cipauto-ai-search-view-button:hover {
    background: #2d00a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 0, 221, 0.3);
}

/* Error State */
.cipauto-ai-search-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    margin-bottom: 20px;
}

.cipauto-ai-search-error svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cipauto-ai-search-error-text {
    font-size: 14px;
    font-weight: 500;
}

/* Examples */
.cipauto-ai-search-examples {
    margin-top: 32px;
}

.cipauto-ai-search-examples-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cipauto-ai-search-examples-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.cipauto-ai-search-example {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #4b5563;
}

.cipauto-ai-search-example svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    flex-shrink: 0;
}

.cipauto-ai-search-example:hover {
    border-color: #3B00DD;
    background: #f3e8ff;
    color: #2d00a8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 0, 221, 0.15);
}

.cipauto-ai-search-example:hover svg {
    color: #3B00DD;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cipauto-ai-search-container {
        padding: 0 16px;
        margin: 24px auto;
    }
    
    .cipauto-ai-search-title {
        font-size: 24px;
    }
    
    .cipauto-ai-icon {
        width: 28px;
        height: 28px;
    }
    
    .cipauto-ai-search-subtitle {
        font-size: 14px;
    }
    
    .cipauto-ai-search-box {
        flex-direction: column;
        gap: 8px;
    }
    
    .cipauto-ai-search-button {
        width: 100%;
        justify-content: center;
    }
    
    .cipauto-ai-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .cipauto-ai-search-examples-list {
        grid-template-columns: 1fr;
    }
    
    .cipauto-ai-search-results {
        padding: 16px;
    }
    
    .cipauto-ai-search-filters {
        gap: 8px;
    }
    
    .cipauto-ai-search-filter-tag {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Animation for results appearing */
@keyframes cipauto-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cipauto-ai-search-results {
    animation: cipauto-slide-up 0.4s ease-out;
}
