/**
 * BFHD Pro - Pro 1 Theme
 * Modern, premium frontend styling for directory listings
 * Version: 1.0.2 - Fixed clickable cards
 */

/* ====================================
   1. GLOBAL STYLES & RESET
   ==================================== */

.bfhd-pro1-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: #1a202c;
    line-height: 1.6;
}

/* ====================================
   2. FILTER BAR - Pro 1 Theme
   ==================================== */

.bfhd-filter-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.bfhd-filter-bar:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 24px rgba(0, 0, 0, 0.05);
}

.bfhd-filter-bar label {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5568;
    margin-bottom: 0.5rem;
    display: block;
}

.bfhd-filter-bar input,
.bfhd-filter-bar select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.bfhd-filter-bar input:focus,
.bfhd-filter-bar select:focus {
    border-color: #00E2C1;
    box-shadow: 0 0 0 3px rgba(0, 226, 193, 0.1);
}

.bfhd-filter-bar button {
    background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
    color: white;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 226, 193, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bfhd-filter-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 226, 193, 0.4);
}

.bfhd-filter-bar button:active {
    transform: translateY(0);
}

/* ====================================
   3. DIRECTORY GRID - Pro 1 Theme
   ==================================== */

.bfhd-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ====================================
   4. LISTING CARD - Pro 1 Theme
   ==================================== */

.bfhd-card-pro1 {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Gradient border effect on hover - FIXED: Added pointer-events: none */
.bfhd-card-pro1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    /* CRITICAL FIX: Allow clicks to pass through */
    z-index: 0;
}

.bfhd-card-pro1:hover::before {
    opacity: 1;
}

.bfhd-card-pro1:hover {
    transform: translateY(-12px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 24px 48px rgba(0, 226, 193, 0.15);
}

/* Logo styling */
.bfhd-card-logo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 1rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid #f7fafc;
    position: relative;
    z-index: 1;
    /* Ensure it's above ::before */
}

.bfhd-card-pro1:hover .bfhd-card-logo {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Logo placeholder */
.bfhd-card-logo-placeholder {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1;
    /* Ensure it's above ::before */
}

/* Card content */
.bfhd-card-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    /* Ensure it's above ::before */
}

.bfhd-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.bfhd-card-description {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    flex: 1;
}

/* Category badges */
.bfhd-card-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.bfhd-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00E2C1 0%, #00b8a0 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 226, 193, 0.3);
    transition: all 0.3s ease;
}

.bfhd-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 226, 193, 0.4);
}

/* Meta info (phone, email, etc.) */
.bfhd-card-meta {
    display: flex;
    justify-content: center;

    .bdp-categories-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .bfhd-category-card-pro1 {
        background: white;
        border-radius: 1.25rem;
        padding: 2rem 1.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        border: 2px solid transparent;
        position: relative;
        overflow: hidden;
    }

    .bfhd-category-card-pro1::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(0, 226, 193, 0.05) 0%, rgba(117, 125, 254, 0.05) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .bfhd-category-card-pro1:hover::before {
        opacity: 1;
    }

    .bfhd-category-card-pro1:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 24px 48px rgba(0, 226, 193, 0.15);
        border-color: #00E2C1;
    }

    .bfhd-category-icon {
        font-size: 3.5rem;
        margin-bottom: 1rem;
        transition: transform 0.3s ease;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 80px;
        height: 80px;
        border-radius: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    }

    .bfhd-category-card-pro1:hover .bfhd-category-icon {
        transform: scale(1.15) rotate(5deg);
    }

    .bfhd-category-name {
        font-weight: 700;
        font-size: 1.125rem;
        color: #1a202c;
        margin-bottom: 0.75rem;
    }

    .bfhd-category-count {
        background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.4rem 1rem;
        border-radius: 2rem;
        box-shadow: 0 2px 8px rgba(0, 226, 193, 0.3);
    }

    /* ====================================
   6. PAGINATION - Pro 1 Theme
   ==================================== */

    .bfhd-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        margin-top: 3rem;
        flex-wrap: wrap;
    }

    /* Remove borders from inner span wrappers */
    .bfhd-pagination span.mx-1 {
        border: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }

    .bfhd-pagination a {
        padding: 0.75rem 1.25rem;
        border-radius: 0.75rem;
        background: white;
        color: #4a5568;
        text-decoration: none;
        font-weight: 600;
        border: none;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .bfhd-pagination a:hover {
        background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 226, 193, 0.3);
    }

    .bfhd-pagination a.current {
        background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
        color: white;
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(0, 226, 193, 0.4);
    }

    /* Pagination ellipsis */
    .bfhd-pagination .ellipsis {
        padding: 0.75rem 0.5rem;
        color: #4a5568;
        font-weight: 600;
        user-select: none;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    /* Pagination Previous/Next buttons */
    .bfhd-pagination-prev,
    .bfhd-pagination-next {
        padding: 0.75rem 1.25rem;
        border-radius: 0.75rem;
        background: white;
        color: #4a5568;
        text-decoration: none;
        font-weight: 600;
        border: none;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        margin: 0 0.5rem;
    }

    .bfhd-pagination-prev:hover,
    .bfhd-pagination-next:hover {
        background: linear-gradient(135deg, #00E2C1 0%, #757DFE 100%);
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 226, 193, 0.3);
    }

    /* ====================================
   7. RESPONSIVE DESIGN
   ==================================== */

    @media (max-width: 768px) {
        .bfhd-directory-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        .bdp-categories-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 1rem;
        }

        .bfhd-filter-bar {
            padding: 1.5rem;
        }

        .bfhd-card-pro1 {
            padding: 1.5rem;
        }

        .bfhd-card-title {
            font-size: 1.25rem;
        }
    }

    @media (min-width: 769px) and (max-width: 1024px) {
        .bfhd-directory-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .bdp-categories-grid {
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        }
    }

    /* ====================================
   8. LOADING STATES
   ==================================== */

    .bfhd-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: bfhd-loading 1.5s ease-in-out infinite;
    }

    @keyframes bfhd-loading {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }

    /* ====================================
   9. ACCESSIBILITY
   ==================================== */

    .bfhd-card-pro1:focus,
    .bfhd-category-card-pro1:focus,
    .bfhd-btn-view-details:focus {
        outline: 3px solid #00E2C1;
        outline-offset: 3px;
    }

    /* High contrast mode support */
    @media (prefers-contrast: high) {

        .bfhd-card-pro1,
        .bfhd-category-card-pro1 {
            border: 2px solid #1a202c;
        }
    }

    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {

        .bfhd-card-pro1,
        .bfhd-category-card-pro1,
        .bfhd-btn-view-details,
        .bfhd-category-icon {
            transition: none;
        }
    }

    /* ====================================
   10. EMPTY STATE
   ==================================== */

    .bfhd-empty-state {
        text-align: center;
        padding: 4rem 2rem;
        background: white;
        border-radius: 1.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .bfhd-empty-state-icon {
        font-size: 5rem;
        margin-bottom: 1.5rem;
        opacity: 0.3;
    }

    .bfhd-empty-state-title {
        font-size: 1.75rem;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 0.75rem;
    }

    .bfhd-empty-state-message {
        color: #718096;
        font-size: 1.125rem;
    }