/* Directory Results Page - Grid Modern Style */
:root {
    --primary-color: #FFD230;
    --primary-hover: #f5c820;
    --primary-dark: #e6bd1f;
}

.ph-directory-results-wrapper,
.ph-directory-results-wrapper * {
    font-family: 'Gilroy', sans-serif !important;
    box-sizing: border-box;
}

.ph-directory-results-wrapper {
    width: 100%;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.ph-directory-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Title */
.ph-directory-title {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.ph-directory-title h1 {
    font-size: 42px !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.2 !important;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ph-title-location {
    font-weight: 400;
    color: #4a5568;
}

.ph-results-summary {
    font-size: 16px;
    color: #718096;
    margin: 0;
    font-weight: 500;
}

/* Search and Filters Bar */
.ph-search-filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    align-items: stretch;
    width: 100%;
}

/* Unified Search Box */
.ph-search-box {
    flex: 1;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
}

.ph-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 210, 48, 0.2);
}

.ph-search-box-field {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
}

.ph-search-box-field.ph-category-search {
    flex: 2;
}

.ph-search-box-icon {
    position: absolute;
    left: 16px;
    color: #a0aec0;
    pointer-events: none;
    flex-shrink: 0;
    z-index: 1;
}

.ph-search-box-field input[type="text"] {
    width: 100%;
    padding: 16px 16px 16px 44px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    color: #2d3748;
}

.ph-search-box-field input[type="text"]::placeholder {
    color: #a0aec0;
}

.ph-search-box-divider {
    width: 1px;
    background: #e2e8f0;
    margin: 10px 0;
    flex-shrink: 0;
}

.ph-search-box-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    flex-shrink: 0;
    background: var(--primary-color);
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1a202c;
}

.ph-search-box-btn:hover {
    background: var(--primary-hover);
}

/* Autocomplete dropdown positioning */
.ph-search-box-field .ph-autocomplete-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
}

/* Filters Toggle */
.ph-filters-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.ph-filters-toggle:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 210, 48, 0.3);
}

.ph-filters-toggle svg {
    stroke: currentColor;
}

.ph-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--primary-color);
    color: #1a202c;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.ph-filters-panel {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease;
}

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

.ph-filters-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ph-filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ph-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Location Filter */
.ph-filter-location {
    position: relative;
}

.ph-filter-location input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.ph-filter-location input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 210, 48, 0.2);
}

.ph-filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ph-filter-field {
    display: flex;
    flex-direction: column;
}

.ph-location-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background-color: #ffffff;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23718096" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.ph-location-select:disabled {
    background-color: #f7fafc;
    cursor: not-allowed;
    opacity: 0.6;
}

.ph-location-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 210, 48, 0.2);
}

/* Category Chips */
.ph-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ph-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #edf2f7;
    color: #2d3748;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ph-category-chip:hover {
    background: var(--primary-color);
    color: #1a202c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 210, 48, 0.3);
}

.ph-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #cbd5e0;
    color: #2d3748;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
}

.ph-category-chip:hover .ph-chip-count {
    background: rgba(0, 0, 0, 0.15);
    color: #1a202c;
}

.ph-category-chip.ph-category-hidden {
    display: none;
}

.ph-show-more-chip {
    padding: 10px 16px;
    background: none;
    border: 2px dashed #cbd5e0;
    border-radius: 20px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.ph-show-more-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
    background: rgba(255, 210, 48, 0.1);
}

/* Filter Actions */
.ph-filter-actions {
    display: flex;
    gap: 12px;
    padding-top: 12px;
}

.ph-btn-clear,
.ph-btn-apply {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.ph-btn-clear {
    background: #edf2f7;
    color: #4a5568;
}

.ph-btn-clear:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ph-btn-apply {
    background: var(--primary-color);
    color: #1a202c;
    box-shadow: 0 4px 12px rgba(255, 210, 48, 0.3);
}

.ph-btn-apply:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 210, 48, 0.4);
}

/* Type Toggle - Filter Panel */
.ph-type-toggle-panel {
    display: flex;
    gap: 8px;
}

.ph-type-btn-panel {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #4a5568;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ph-type-btn-panel.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #111827;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 210, 48, 0.3);
}

.ph-type-btn-panel:hover:not(.active) {
    border-color: #cbd5e0;
    background: #f7fafc;
}

/* Results Grid */
.ph-directory-results {
    background: transparent;
}

.ph-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

/* Crew Card - Vertical Style */
.ph-crew-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.ph-crew-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.ph-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.ph-card-image {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* Type Badge (Crew / Vendor) */
.ph-card-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ph-card-type-badge.ph-type-crew {
    background: #FFD230;
    color: #1a202c;
}

.ph-card-type-badge.ph-type-vendor {
    background: #1a3a6b;
    color: #ffffff;
}

.ph-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ph-crew-card:hover .ph-card-image img {
    transform: scale(1.08);
}

.ph-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 210, 48, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ph-crew-card:hover .ph-card-overlay {
    opacity: 1;
}

.ph-view-profile {
    color: #1a202c;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #1a202c;
    border-radius: 24px;
    backdrop-filter: blur(4px);
}

.ph-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.ph-card-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ph-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.ph-card-location svg {
    flex-shrink: 0;
    color: #a0aec0;
}

.ph-card-description {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.ph-card-footer {
    padding-top: 14px;
    border-top: 2px solid #edf2f7;
}

.ph-member-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.ph-member-badge svg {
    color: #fbbf24;
}

/* Pagination */
.ph-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    padding: 20px 0;
}

.ph-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ph-pagination .page-numbers:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #1a202c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 210, 48, 0.3);
}

.ph-pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #1a202c;
    box-shadow: 0 4px 12px rgba(255, 210, 48, 0.4);
}

.ph-pagination .page-numbers svg {
    width: 16px;
    height: 16px;
}

/* No Results */
.ph-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.ph-no-results svg {
    color: #cbd5e0;
    margin-bottom: 24px;
}

.ph-no-results h3 {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
}

.ph-no-results p {
    font-size: 16px;
    color: #718096;
    margin: 0;
    max-width: 400px;
}

/* Error */
.ph-directory-error {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #d32f2f;
}

/* Autocomplete */
#ph-category-autocomplete,
#ph-search-location-autocomplete,
#ph-filter-location-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
}

.ph-autocomplete-item {
    padding: 14px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.2s;
    border-bottom: 1px solid #f7fafc;
}

.ph-autocomplete-item:last-child {
    border-bottom: none;
}

.ph-autocomplete-item:hover {
    background: var(--primary-color);
    color: #1a202c;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ph-results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (max-width: 992px) {
    .ph-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .ph-search-filters-bar {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .ph-directory-title h1 {
        font-size: 28px !important;
    }

    .ph-search-box {
        flex-direction: column;
        border-radius: 12px;
    }

    .ph-search-box-divider {
        width: auto;
        height: 1px;
        margin: 0 12px;
    }

    .ph-search-box-btn {
        width: 100%;
        border-radius: 0 0 10px 10px;
        padding: 14px;
    }

    .ph-type-toggle-panel {
        flex-wrap: wrap;
    }

    .ph-filters-toggle {
        width: 100%;
        justify-content: center;
    }

    .ph-filters-panel {
        padding: 24px;
    }

    .ph-filter-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ph-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ph-card-image {
        height: 220px;
    }

    .ph-pagination {
        flex-wrap: wrap;
    }

    .ph-pagination .page-numbers {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ph-directory-results-wrapper {
        padding: 24px 16px;
    }

    .ph-directory-title h1 {
        font-size: 24px !important;
    }

    .ph-card-title {
        font-size: 16px !important;
    }

    .ph-results-summary {
        font-size: 14px;
    }

    .ph-search-input-wrapper input[type="text"] {
        padding: 14px 16px 14px 46px;
        font-size: 14px;
    }

    .ph-search-icon {
        left: 14px;
        width: 18px;
        height: 18px;
    }

    .ph-filters-toggle {
        padding: 14px 20px;
        font-size: 14px;
    }

    .ph-filters-toggle svg {
        width: 18px;
        height: 18px;
    }

    .ph-filters-panel {
        padding: 20px;
        border-radius: 12px;
    }

    .ph-filters-content {
        gap: 20px;
    }

    .ph-filter-actions {
        flex-direction: column;
    }

    .ph-card-content {
        padding: 20px;
    }

    .ph-card-title {
        font-size: 18px;
    }

    .ph-card-description {
        font-size: 13px;
    }

    .ph-card-image {
        height: 200px;
    }

    .ph-category-chips {
        gap: 8px;
    }

    .ph-category-chip {
        font-size: 13px;
        padding: 8px 14px;
    }
}

/* Elementor Compatibility - scoped overrides */
.ph-directory-results-wrapper button.ph-search-box-btn {
    background: var(--primary-color);
    color: #1a202c;
    border: none;
    cursor: pointer;
}
.ph-directory-results-wrapper button.ph-search-box-btn:hover {
    background: var(--primary-hover);
}
.ph-directory-results-wrapper button.ph-filters-toggle {
    background: #ffffff;
    color: #2d3748;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}
.ph-directory-results-wrapper button.ph-filters-toggle:hover {
    background: var(--primary-color);
    color: #1a202c;
}
.ph-directory-results-wrapper button.ph-btn-apply {
    background: var(--primary-color);
    color: #1a202c;
    border: none;
    cursor: pointer;
}
.ph-directory-results-wrapper button.ph-btn-apply:hover {
    background: var(--primary-hover);
}
.ph-directory-results-wrapper button.ph-btn-clear {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    cursor: pointer;
}
.ph-directory-results-wrapper button.ph-btn-clear:hover {
    background: #e2e8f0;
}
.ph-directory-results-wrapper .ph-search-box-field input[type="text"] {
    border: none;
    background: transparent;
    color: #2d3748;
    box-shadow: none;
}
.ph-directory-results-wrapper .ph-filter-location input[type="text"] {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #2d3748;
}
.ph-directory-results-wrapper .ph-location-select {
    border: 2px solid #e2e8f0;
    background-color: #ffffff;
    color: #2d3748;
}
.ph-directory-results-wrapper .ph-location-select:disabled {
    background-color: #f7fafc;
}
.ph-directory-results-wrapper a.ph-card-link {
    text-decoration: none;
    color: inherit;
}
.ph-directory-results-wrapper a.ph-category-chip {
    text-decoration: none;
    color: #2d3748;
    background: #edf2f7;
}
.ph-directory-results-wrapper a.ph-category-chip:hover {
    background: var(--primary-color);
    color: #1a202c;
    text-decoration: none;
}
.ph-directory-results-wrapper .ph-pagination .page-numbers {
    background-color: #ffffff;
    color: #4a5568;
    text-decoration: none;
    border: 2px solid #e2e8f0;
}
.ph-directory-results-wrapper .ph-pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #1a202c;
}
.ph-directory-results-wrapper button.ph-type-btn-panel {
    cursor: pointer;
}
.ph-directory-results-wrapper button.ph-type-btn-panel.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #111827;
}
.ph-directory-results-wrapper button.ph-type-btn-panel:not(.active) {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #4a5568;
}
