/* Business Directory Frontend Styles */

.bd-directory {
    margin: 20px 0;
}

/* Two Column Layout */
.bd-directory-columns-2.bd-directory-alphabetical {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bd-directory-columns-2 .bd-listings-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Three Column Layout */
.bd-directory-columns-3.bd-directory-alphabetical {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.bd-directory-columns-3 .bd-listings-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Category Groups (when sorted by category) */
.bd-category-group {
    margin-bottom: 40px;
}

.bd-category-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
}

.bd-listings-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Listing */
.bd-listing {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.bd-listing:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Listing Header */
.bd-listing-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    gap: 15px;
    background: #fafafa;
    transition: background-color 0.2s ease;
}

.bd-listing-header:hover {
    background: #f5f5f5;
}

.bd-listing-logo {
    flex-shrink: 0;
}

.bd-listing-logo img {
    max-width: 80px;
    height: auto;
    display: block;
}

.bd-listing-title-wrapper {
    flex-grow: 1;
}

.bd-listing-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.bd-listing-category {
    margin-top: 5px;
    font-size: 14px;
    color: #777;
}

/* Toggle Button */
.bd-toggle-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
    font-weight: 300;
    color: #333;
    padding: 0;
}

.bd-toggle-btn:hover {
    background: #333;
    color: #fff;
}

.bd-toggle-btn[aria-expanded="true"] .bd-plus-icon {
    transform: rotate(45deg);
}

.bd-plus-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    line-height: 0;
    vertical-align: middle;
}

/* Listing Content (Expandable) */
.bd-listing-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.bd-listing-content.expanded {
    padding: 20px;
    max-height: 2000px;
}

/* Contacts Grid */
.bd-contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.bd-contact-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.bd-contact-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.bd-contact-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.bd-contact-phone,
.bd-contact-email {
    font-size: 14px;
    margin-bottom: 5px;
}

.bd-contact-phone a,
.bd-contact-email a {
    color: #0073aa;
    text-decoration: none;
}

.bd-contact-phone a:hover,
.bd-contact-email a:hover {
    text-decoration: underline;
}

/* Social Links */
.bd-social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.bd-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
}

.bd-social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bd-social-icon svg {
    width: 20px;
    height: 20px;
}

/* Platform-specific colors */
.bd-social-website:hover {
    background: #0073aa;
}

.bd-social-facebook:hover {
    background: #1877f2;
}

.bd-social-twitter:hover {
    background: #000;
}

.bd-social-instagram:hover {
    background: #E4405F;
}

.bd-social-youtube:hover {
    background: #ff0000;
}

.bd-social-linkedin:hover {
    background: #0077b5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* 3-column goes to 2-column on tablets */
    .bd-directory-columns-3.bd-directory-alphabetical,
    .bd-directory-columns-3 .bd-listings-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Stack all columns on mobile */
    .bd-directory-columns-2.bd-directory-alphabetical,
    .bd-directory-columns-2 .bd-listings-wrapper,
    .bd-directory-columns-3.bd-directory-alphabetical,
    .bd-directory-columns-3 .bd-listings-wrapper {
        grid-template-columns: 1fr;
    }
    
    .bd-listing-header {
        padding: 15px;
    }
    
    .bd-listing-logo img {
        max-width: 60px;
    }
    
    .bd-listing-title {
        font-size: 18px;
    }
    
    .bd-contacts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bd-toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .bd-listing-header {
        flex-wrap: wrap;
    }
    
    .bd-listing-logo {
        width: 100%;
        text-align: center;
    }
    
    .bd-listing-logo img {
        max-width: 100px;
        margin: 0 auto;
    }
}
