/**
 * Vendor Finder Plugin Styles
 * Matches the Event Planner Pro theme design system
 */

/* Main Container */
.vendor-finder-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0;
}

/* Controls Section */
.vendor-finder-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid #F3F4F6;
}

/* Search Box */
.vendor-search-box {
    position: relative;
    margin-bottom: 2rem;
}

.vendor-search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    transition: all 200ms ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.vendor-search-input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.vendor-search-box .search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: #9CA3AF;
    pointer-events: none;
}

.vendor-search-box .search-icon svg {
    width: 100%;
    height: 100%;
}

/* Filters */
.vendor-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filter-select,
.filter-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: white;
    transition: all 200ms ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-actions .btn {
    white-space: nowrap;
}

/* Results Header */
.vendor-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.results-count {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.results-layout-toggle {
    display: flex;
    gap: 0.5rem;
}

.layout-btn {
    padding: 0.5rem;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-btn svg {
    width: 20px;
    height: 20px;
    color: #6B7280;
}

.layout-btn:hover {
    border-color: #4F46E5;
    background: #F9FAFB;
}

.layout-btn.active {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-color: #4F46E5;
}

.layout-btn.active svg {
    color: white;
}

/* Vendor Results Grid Layout */
.vendor-results {
    min-height: 300px;
}

.vendor-results.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Vendor Results List Layout */
.vendor-results.list-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vendor-results.list-layout .vendor-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.vendor-results.list-layout .vendor-image {
    height: 100%;
    min-height: 200px;
}

/* Vendor Card */
.vendor-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 200ms ease;
    border: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
}

.vendor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #818CF8;
}

/* Vendor Image */
.vendor-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vendor-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.vendor-card:hover .vendor-image img {
    transform: scale(1.05);
}

.vendor-image-placeholder svg {
    width: 64px;
    height: 64px;
    color: #A78BFA;
    opacity: 0.5;
}

.vendor-rating-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.vendor-rating-badge .rating-stars {
    color: #F59E0B;
    font-size: 0.875rem;
}

/* Vendor Content */
.vendor-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.vendor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.vendor-name {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.vendor-name a {
    color: #1F2937;
    text-decoration: none;
    transition: color 200ms ease;
}

.vendor-name a:hover {
    color: #4F46E5;
}

.vendor-service-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    color: #4338CA;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.vendor-company {
    font-size: 1rem;
    color: #6B7280;
    margin: 0;
    font-weight: 500;
}

.vendor-description {
    font-size: 0.9375rem;
    color: #4B5563;
    line-height: 1.6;
    margin: 0;
}

/* Vendor Meta */
.vendor-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #F3F4F6;
}

.vendor-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6B7280;
}

.vendor-meta-item svg {
    width: 18px;
    height: 18px;
    color: #9CA3AF;
    flex-shrink: 0;
}

.vendor-meta-item.vendor-rating {
    gap: 0.375rem;
}

.vendor-meta-item .rating-stars {
    color: #F59E0B;
    font-size: 1rem;
}

.vendor-meta-item .rating-text {
    font-weight: 600;
    color: #374151;
}

/* Vendor Actions */
.vendor-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.vendor-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
}

/* No Vendors Found */
.no-vendors-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.no-vendors-found svg {
    width: 80px;
    height: 80px;
    color: #D1D5DB;
    margin: 0 auto 1.5rem;
}

.no-vendors-found h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.no-vendors-found p {
    font-size: 1rem;
    color: #6B7280;
    margin: 0;
}

/* Loading State */
.vendor-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #E5E7EB;
    border-top-color: #4F46E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.vendor-loading p {
    font-size: 1rem;
    color: #6B7280;
    margin: 0;
}

/* Plugin Notice */
.vendor-finder-notice {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.vendor-finder-notice p {
    color: #92400E;
    font-weight: 500;
    margin: 0;
    font-size: 1.125rem;
}

/* Buttons - Match theme style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    font-size: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 300ms ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: transparent;
    border: 2px solid #4F46E5;
    color: #4F46E5;
}

.btn-outline:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .vendor-finder-controls {
        padding: 1.5rem;
    }

    .vendor-filters {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .vendor-results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .results-layout-toggle {
        align-self: flex-end;
    }

    .vendor-results.grid-layout {
        grid-template-columns: 1fr;
    }

    .vendor-results.list-layout .vendor-card {
        grid-template-columns: 1fr;
    }

    .vendor-results.list-layout .vendor-image {
        height: 220px;
    }

    .vendor-actions {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .vendor-finder-container {
        margin: 1rem 0;
    }

    .vendor-finder-controls {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .vendor-search-input {
        font-size: 1rem;
        padding: 0.875rem 3rem 0.875rem 1rem;
    }

    .results-count {
        font-size: 1rem;
    }

    .vendor-card {
        border-radius: 8px;
    }

    .vendor-name {
        font-size: 1.25rem;
    }

    .vendor-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation for vendor cards appearing */
.vendor-card {
    animation: fadeInUp 300ms ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
