/* ========== AI TOOL FINDER WIDGET (FINAL POLISH) ========== */
#ai-tool-finder-widget {
    position: fixed;
    bottom: 100px;
    /* Lifted up as requested */
    right: 24px;
    z-index: 9998;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Minimized State */
#ai-tool-finder-widget.minimized {
    transform: translateX(calc(100% - 40px));
    opacity: 0.5 !important;
}

#ai-tool-finder-widget.minimized:hover {
    transform: translateX(calc(100% - 50px));
    opacity: 1 !important;
}

#ai-tool-finder-widget.minimized .ask-raitly-btn {
    padding-right: 15px;
}

#ai-tool-finder-widget.minimized .widget-close-btn {
    display: none;
}

/* Ask Raitly Button */
.ask-raitly-btn {
    background: linear-gradient(135deg, #A855F7, #EC4899);
    /* Lighter purple/pink gradient */
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    /* Full pill shape */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
    opacity: 0.6;
    /* More transparent when idle as requested */
    position: relative;
    padding-right: 44px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ask-raitly-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.6);
    opacity: 1;
    /* Fully opaque on hover */
}

/* Close/Minimize Button */
.widget-close-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: white;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.2s;
    z-index: 2;
}

.widget-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* Finder Modal Overlay */
.finder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

/* Finder Container (The Modal Card) */
.finder-container {
    background: white;
    border-radius: 24px;
    /* Matches reference rounded corners */
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #F3F4F6;
}

html.dark .finder-container {
    background: #1F2937;
    border-color: #374151;
}

/* Responsive */
@media (max-width: 768px) {
    .finder-container {
        max-width: 92%;
        border-radius: 20px;
    }
}

/* Header */
.finder-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px 0;
    /* No bottom padding, flows into body */
    background: transparent;
    flex-shrink: 0;
}

.finder-icon {
    width: 48px;
    height: 48px;
    background: #F3E8FF;
    /* Light purple bg */
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9333EA;
    /* Purple icon */
    font-size: 24px;
    flex-shrink: 0;
}

html.dark .finder-icon {
    background: rgba(147, 51, 234, 0.2);
    color: #C084FC;
}

.finder-title {
    flex: 1;
}

.finder-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

html.dark .finder-title h2 {
    color: white;
}

#finder-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

#finder-close-btn:hover {
    color: #6B7280;
    transform: rotate(90deg);
}

/* Body */
.finder-body {
    padding: 24px 32px 32px;
    overflow-y: auto;
}

/* Search Input */
.search-wrapper {
    position: relative;
    width: 100%;
}

#finder-input {
    width: 100%;
    padding: 20px 24px;
    border: 2px solid #E5E7EB;
    /* Lighter border */
    border-radius: 100px;
    /* Very rounded pill shape input */
    font-size: 18px;
    background: #F9FAFB;
    /* Very light grey bg */
    color: #111827;
    outline: none;
    transition: all 0.3s ease;
}

html.dark #finder-input {
    background: #374151;
    border-color: #4B5563;
    color: white;
}

#finder-input:focus {
    border-color: #C084FC;
    /* Light purple border focus */
    background: white;
    box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.15);
}

html.dark #finder-input:focus {
    background: #374151;
}

#finder-input::placeholder {
    color: #9CA3AF;
}

.finder-hint {
    margin-top: 16px;
    font-size: 14px;
    color: #6B7280;
    text-align: center;
    font-weight: 500;
}

/* Results Area */
#finder-results {
    margin-top: 32px;
    display: none;
}

.recommended-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html.dark .recommended-label {
    color: white;
}

#finder-tools-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tool Card */
.finder-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark .finder-tool-card {
    background: #1F2937;
    border-color: #374151;
}

.finder-tool-card:hover {
    border-color: #C084FC;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

.finder-tool-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.finder-tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.finder-tool-info {
    flex: 1;
}

.finder-tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.finder-tool-name {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

html.dark .finder-tool-name {
    color: white;
}

.finder-tool-description {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finder-tool-category {
    display: inline-block;
    padding: 6px 12px;
    background: #F3E8FF;
    color: #9333EA;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

/* Loading Spinner */
#finder-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.finder-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: #9333EA;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ask Another Button */
#ask-another-btn {
    width: 100%;
    padding: 16px;
    margin-top: 24px;
    background: white;
    border: 1px solid #E5E7EB;
    color: #9333EA;
    border-radius: 100px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#ask-another-btn:hover {
    border-color: #9333EA;
    background: #F3E8FF;
}

@media (max-width: 768px) {
    #ai-tool-finder-widget {
        right: 16px;
        bottom: 90px;
    }
}