/**
 * Manufacturer Listing Page Styles
 * Filter bar, results grid, manufacturer cards
 * Enhanced with modern, wide design and smooth animations
 */

/* Smooth entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: var(--space-6);
    padding-top: var(--space-5);
    animation: fadeInUp 0.6s ease-out;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Horizontal Filter Bar */
.search-filters {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin: 0 auto var(--space-6);
    max-width: 1400px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.search-filters:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.05);
}

.search-filters.sticky {
    position: sticky;
    top: calc(var(--header-height) + 10px);
    z-index: var(--z-sticky);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: end;
    width: 100%;
}

.filter-row {
    display: contents;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    position: relative;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.search-input,
.filter-select,
.form-control {
    width: 100%;
    padding: 0.1rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1e293b;
    line-height: 1.5;
    height: 48px;
    box-sizing: border-box;
}

.search-input:focus,
.filter-select:focus,
.form-control:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
}

.form-control::placeholder,
.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Select dropdown styling */
.filter-select,
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.form-control:focus,
.filter-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Country locked (Egypt only) */
.filter-group.locked {
    opacity: 0.85;
}

.filter-group.locked select {
    background-color: #f1f5f9;
    cursor: not-allowed;
    border-color: #e2e8f0;
    color: #000000;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.filter-actions .btn {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-actions .btn-primary,
.btn-primary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.filter-actions .btn-primary:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    transform: translateY(-1px);
}

.filter-actions .btn-outline,
.filter-actions .btn-ghost,
.btn-outline,
.btn-ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.filter-actions .btn-outline:hover,
.filter-actions .btn-ghost:hover,
.btn-outline:hover,
.btn-ghost:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #475569;
}

@media (min-width: 640px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .filter-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .filter-actions .btn {
        min-width: 120px;
    }
}

@media (min-width: 768px) {
    .search-form {
        grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr;
        gap: 1rem;
    }
    
    .filter-actions {
        grid-column: auto;
        flex-direction: row;
        align-items: flex-end;
    }
}

@media (min-width: 1024px) {
    .search-filters {
        padding: 2rem 2.5rem;
    }
    
    .search-form {
        grid-template-columns: 2.5fr 1fr 1fr 1fr auto;
        gap: 1.25rem;
    }
}

/* Mobile responsive filter bar */
@media (max-width: 639px) {
    .search-filters {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .filter-group,
    .filter-group.filter-search,
    .filter-group.locked {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
}

/* Results Info */.industry-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Active Filters Bar */
.active-filters-bar {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.active-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e40af;
    margin-right: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.active-filter:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.active-filter strong {
    color: #1e293b;
    font-weight: 600;
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.remove-filter:hover {
    background: #dc2626;
    transform: scale(1.2) rotate(90deg);
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-default);
}

.results-summary {
    font-size: var(--font-size-md);
    color: var(--text-mid);
}

.results-summary strong {
    color: var(--text-strong);
    font-weight: var(--font-weight-bold);
}

.filter-indicator {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* Manufacturer Grid */
.manufacturer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.manufacturer-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.manufacturer-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.card-media {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8fafc;
    position: relative;
}

.card-image,
.card-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Favorite Button - Red as specified */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.favorite-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.favorite-btn svg {
    color: #94a3b8;
    transition: all 0.3s ease;
}

.favorite-btn:hover svg {
    color: #ef4444;
}

.favorite-btn.is-favorite svg {
    fill: #ef4444;
    color: #ef4444;
}

.favorite-btn.is-favorite {
    background: rgba(254, 242, 242, 0.95);
}

.favorite-btn.is-favorite:hover {
    background: #fef2f2;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-title-section h3 {
    font-size: 1.125rem;
    margin: 0;
    flex: 1;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.4;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.location-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.card-specialties {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-specialties strong {
    color: #475569;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.specialty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.specialty-tag {
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.card-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.capability-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
}

.card-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-weight: 400;
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-footer .btn,
.card-actions .btn {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none;
    color: #ffffff;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-footer .btn:hover,
.card-actions .btn:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    transform: translateY(-1px);
}

.verified {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
}

.no-results p {
    font-size: var(--font-size-lg);
    color: var(--text-mid);
    margin-bottom: var(--space-2);
}

/* Responsive */
@media (min-width: 640px) {
    .manufacturer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .manufacturer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .manufacturer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .manufacturer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .manufacturer-grid {
        grid-template-columns: 1fr;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

/* Loading State */
.manufacturer-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}
