/* ==========================================
   YHR PROS Directory
   Filterable, searchable professional directory
   ========================================== */

/* Hero Background Image */
.yhr-pros-hero {
    position: relative;
    background-image: url('/assets/images/hero/business-hand-shake-hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove the gradient overlay from main.css for this hero */
.yhr-pros-hero::before {
    display: none;
}

/* Make overlay darker for better text contrast */
.yhr-pros-hero .hero-overlay {
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .yhr-pros-hero {
        min-height: 400px;
    }
}

/* Directory Container */
.directory-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

/* Search & Filter Bar */
.directory-controls {
    /* background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem; */
    /* position: sticky;
    top: calc(var(--nav-height) + 1rem);
    z-index: 100; */
    transition: all 0.3s ease;
}

/* Compact state when scrolled */
.directory-controls.scrolled {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Search Row - Search box + Actions inline */
.directory-search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.25rem;
    transition: margin 0.3s ease;
}

.directory-controls.scrolled .directory-search-row {
    margin-bottom: 0.25rem;
}

.directory-search-box {
    position: relative;
    flex: 1;
    min-width: 0;
    /* Allow flexbox to shrink */
}

.directory-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: var(--off-white);
}

.directory-controls.scrolled .directory-search-input {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 1rem;
}

.directory-search-input:focus {
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.directory-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-light);
    pointer-events: none;
    transition: all 0.3s ease;
}

.directory-controls.scrolled .directory-search-icon {
    left: 1rem;
    font-size: 1.1rem;
}

/* Filter Buttons - HIDDEN */
.directory-filters {
    display: none;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.directory-controls.scrolled .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.filter-btn>span:first-child {
    /* Text label styling */
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    background: rgba(52, 152, 219, 0.05);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.filter-btn-icon {
    font-size: 1.1rem;
}

.filter-btn-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.filter-btn.active .filter-btn-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Results Count - Smaller and compact */
.results-count {
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 0.25rem 0;
    margin-top: -0.5rem;
    margin-left: 1.25rem;
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 600;
}

.directory-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.view-toggle {
    display: none;
    /* Hidden per user request */
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--accent-color);
}

/* Featured Banner - HIDDEN */
.featured-pros-banner {
    display: none;
}

/* Professional Cards Grid */
.pros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pros-grid.list-view {
    grid-template-columns: 1fr;
}

/* Professional Card */
.pro-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pro-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.pro-card.featured {
    border: 2px solid var(--secondary-color);
}

.pro-card.featured::before {
    content: '⭐ FEATURED';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* List View Variant */
.pros-grid.list-view .pro-card {
    flex-direction: row;
}

.pros-grid.list-view .pro-card-header {
    width: 200px;
    flex-shrink: 0;
}

.pros-grid.list-view .pro-card-body {
    flex-grow: 1;
}

/* Card Header */
.pro-card-header {
    background: var(--off-white);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.pro-logo {
    width: 180px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    /* No border, no background, no padding by default */
}

/* No Logo Fallback - Show box with border */
.pro-card-header.no-logo {
    padding-top: 1.5rem;
}

.pro-card-header.no-logo .pro-logo {
    display: none !important;
}

/* Placeholder for no logo */
.pro-card-header.no-logo::before {
    content: '';
    display: block;
    width: 100px;
    height: 100px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin: 0 auto 1rem;
}

.pro-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.pro-tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.pro-rating {
    display: none;
    /* Hidden per user request */
}

/* Card Body */
.pro-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pro-categories {
    display: none;
    /* Hidden per user request */
}

.pro-category-badge {
    display: none;
}

.pro-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pro-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.pro-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.pro-info-icon {
    font-size: 1rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.pro-info-text {
    word-break: break-word;
}

.pro-info-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.pro-info-text a:hover {
    text-decoration: underline;
}

/* Card Footer */
.pro-card-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.pro-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pro-btn-primary {
    background: var(--accent-color);
    color: var(--off-white);
    border: 1px solid var(--accent-color);
}

.pro-btn-primary:hover {
    background: var(--off-white);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.pro-btn-secondary {
    background: var(--secondary-color);
    color: var(--off-white);
    border: 1px solid var(--secondary-color);
}

.pro-btn-secondary:hover {
    background: var(--off-white);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

/* Empty State */
.directory-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.directory-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.directory-empty-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.directory-empty-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

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

.directory-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pros-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .directory-container {
        padding: 1rem;
    }

    .directory-controls {
        padding: 1.5rem;
        position: relative;
        top: 0;
    }

    .directory-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .directory-search-input {
        font-size: 1rem;
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }

    .directory-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .directory-actions {
        width: 100%;
    }

    .results-count {
        text-align: center;
    }

    .pros-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pros-grid.list-view .pro-card {
        flex-direction: column;
    }

    .pros-grid.list-view .pro-card-header {
        width: 100%;
    }

    /* Info grid already single column by default */

    .pro-card-footer {
        flex-direction: column;
    }

    .pro-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pro-card-header {
        padding: 1.5rem 1rem;
    }

    .pro-logo {
        width: 150px;
        height: 100px;
    }

    .pro-name {
        font-size: 1.1rem;
    }

    /* View toggle removed */
}

/* Print Styles */
@media print {

    .directory-controls,
    .pro-card-footer {
        display: none;
    }

    .pro-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* --- AI Search Enhancements --- */

/* Search Box Improvements */
.directory-search-box.ai-analyzing {
    border-color: rgba(189, 151, 131, 0.5);
    /* Brand tan color */
}

/* Loading Spinner inside search icon */
.directory-search-box.ai-analyzing .directory-search-icon {
    animation: spin 1s linear infinite;
    transform-origin: center;
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Refinement Chips */
.search-refinements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 0;
    /* Collapsed by default */
    margin-left: 1.25rem;
    margin-bottom: 1rem;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.search-refinements.visible {
    opacity: 1;
    min-height: 2.5rem;
}

.refinement-chip {
    background-color: #f7f3f0;
    border: 1px solid #e0d0c5;
    color: #5a4b41;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    animation: chipPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes chipPopIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.refinement-chip:hover {
    background-color: #eaddd3;
    transform: translateY(-1px);
}

.refinement-chip.active {
    background-color: #BD9783;
    /* Brand Primary */
    color: white;
    border-color: #BD9783;
    box-shadow: 0 2px 4px rgba(189, 151, 131, 0.3);
}

.refinement-chip .chip-cross {
    font-size: 1.1em;
    line-height: 0.8;
    margin-left: 2px;
}

.refinement-hint {
    font-size: 0.85rem;
    color: #888;
    align-self: center;
    margin-right: 0.5rem;
    font-style: italic;
}


/* Pro Card AI Enhancements */
.pro-ai-snippet {
    background-color: #f0f7ff;
    /* Very light blue for "intelligence" or helpfulness */
    color: #4a6fa5;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
    /* Hidden by default */
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
    border-left: 3px solid #6b9ac4;
    transition: all 0.3s ease;
}

.pro-ai-snippet.has-match {
    display: flex;
    animation: fadeInDown 0.3s ease;
}

.ai-snippet-icon {
    font-size: 1rem;
    min-width: 1.2rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}