/**
 * B2B Directory Styles
 *
 * Consistent with ATL HubSpot theme styling
 */

/* ====================
   Directory Layout
   ==================== */

.b2b-directory-wrapper {
    display: flex;
    gap: 30px;
    padding: 20px 0;
}

/* Filters Sidebar */
.b2b-filters-sidebar {
    flex: 0 0 280px;
    background: #ff8126;
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.b2b-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.b2b-filters-header h4 {
    margin: 0;
    color: var(--n1-color, #ffffff);
    font-size: 18px;
    font-weight: 600;
}

.b2b-clear-filters {
    background: transparent;
    border: none;
    color: var(--n1-color, #ffffff);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    opacity: 0.8;
}

.b2b-clear-filters:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Filter Groups */
.b2b-filter-group {
    margin-bottom: 20px;
}

.b2b-filter-group label {
    display: block;
    color: var(--n1-color, #ffffff);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.b2b-filter-group select,
.b2b-filter-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--n1-color, #ffffff);
    font-size: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.b2b-filter-group select:focus,
.b2b-filter-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.b2b-filter-group select option {
    background: #ff8126;
    color: var(--n1-color, #ffffff);
}

/* Checkbox Lists */
.b2b-checkbox-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
}

.b2b-checkbox-list.collapsed {
    max-height: 140px;
}

.b2b-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    transition: color 0.2s ease;
}

.b2b-checkbox-item:hover {
    color: var(--n1-color, #ffffff);
}

.b2b-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--n1-color, #ffffff);
}

.b2b-toggle-more {
    background: transparent;
    border: none;
    color: var(--n1-color, #ffffff);
    cursor: pointer;
    font-size: 12px;
    padding: 8px 0 0;
    opacity: 0.8;
}

.b2b-toggle-more:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Apply Filters Button */
.b2b-apply-filters {
    width: 100%;
    padding: 12px;
    background: rgba(var(--p6), 1);
    border: none;
    border-radius: 8px;
    color: var(--n1-color, #ffffff);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.b2b-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* ====================
   Results Area
   ==================== */

.b2b-results-area {
    flex: 1;
    min-width: 0;
}

/* Hide results header */
.b2b-results-header {
    display: none;
}

.b2b-results-count {
    color: var(--n1-color, #ffffff);
    font-size: 16px;
}

.b2b-results-count span {
    font-weight: 700;
    color: var(--b2b-accent, #ff8126);
}

/* Active Filters Tags */
.b2b-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.b2b-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 129, 38, 0.2);
    border-radius: 20px;
    color: var(--n1-color, #ffffff);
    font-size: 12px;
}

.b2b-filter-tag button {
    background: transparent;
    border: none;
    color: var(--n1-color, #ffffff);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ====================
   Business Cards Grid
   ==================== */

.b2b-business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.b2b-business-card {
    background: #ff8126;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.b2b-business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 129, 38, 0.4);
}

.b2b-card-avatar {
    height: 225px;
    background: rgba(255, 255, 255, 100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.b2b-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.b2b-card-avatar a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.b2b-card-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.b2b-card-title a {
    color: var(--n1-color, #000);
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.b2b-card-title a:hover {
    opacity: 0.85;
    color: var(--n1-color, #ffffff);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.b2b-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-bottom: 8px;
}

.b2b-meta-icon {
    color: var(--n1-color, #ffffff);
    font-size: 16px;
}

.b2b-card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.b2b-btn-view {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(var(--p6), 1);
    border: none;
    border-radius: 6px;
    color: var(--n1-color, #ffffff);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.b2b-btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* ====================
   Loading & No Results
   ==================== */

.b2b-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--n2-color, #000000);
}

.b2b-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 129, 38, 0.3);
    border-top-color: #ff8126;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: b2b-spin 0.8s linear infinite;
}

@keyframes b2b-spin {
    to {
        transform: rotate(360deg);
    }
}

.b2b-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--n4-color, #1a1a2e);
    border-radius: 12px;
    color: var(--n2-color, #000000);
}

.b2b-no-results p:first-child {
    font-size: 18px;
    color: var(--n1-color, #ffffff);
    margin-bottom: 8px;
}

/* ====================
   Pagination
   ==================== */

.b2b-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.b2b-pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--n4-color, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--n1-color, #ffffff);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2b-pagination button:hover:not(:disabled) {
    border-color: #ff8126;
    background: rgba(255, 129, 38, 0.2);
}

.b2b-pagination button.active {
    background: #ff8126;
    border-color: #ff8126;
}

.b2b-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================
   Group Meta Display
   ==================== */

.b2b-group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0;
}

.b2b-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--n2-color, #000000);
    font-size: 14px;
}

.b2b-meta-item i {
    color: #ff8126;
}

/* ====================
   Business Fields Form (Creation/Edit)
   ==================== */

.b2b-business-fields {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.b2b-business-fields h4 {
    color: var(--n1-color, #ffffff);
    font-size: 20px;
    margin: 0 0 8px;
}

.b2b-business-fields > p.description {
    color: var(--n2-color, #000000);
    margin-bottom: 24px;
}

.b2b-field-group {
    margin-bottom: 20px;
}

.b2b-field-group > label {
    display: block;
    color: var(--n1-color, #ffffff);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.b2b-field-group > label .required {
    color: var(--p2-color, #ff6b6b);
}

.b2b-field-group select,
.b2b-field-group input[type="text"],
.b2b-field-group input[type="url"],
.b2b-field-group input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--n1-color, #ffffff);
    font-size: 14px;
}

.b2b-field-group select:focus,
.b2b-field-group input:focus {
    outline: none;
    border-color: #ff8126;
}

.b2b-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.b2b-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--n2-color, #000000);
    font-size: 13px;
    cursor: pointer;
}

.b2b-checkbox-label:hover {
    color: var(--n1-color, #ffffff);
}

.b2b-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff8126;
}

/* ====================
   Responsive Design
   ==================== */

@media (max-width: 992px) {
    .b2b-directory-wrapper {
        flex-direction: column;
    }

    .b2b-filters-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .b2b-business-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 576px) {
    .b2b-filters-sidebar {
        padding: 16px;
    }

    .b2b-business-grid {
        grid-template-columns: 1fr;
    }

    .b2b-card-content {
        padding: 16px;
    }

    .b2b-checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.b2b-checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.b2b-checkbox-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.b2b-checkbox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.b2b-checkbox-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ====================
   Create Business Button (Profile)
   ==================== */

.b2b-create-business-btn {
    display: none;
    padding: 10px 20px;
    background: var(--p6-color, #6c5ce7);
    border: none;
    border-radius: 6px;
    color: var(--n1-color, #ffffff) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.b2b-create-business-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* ====================
   Profile Tab Styles
   ==================== */

.b2b-profile-tab-content {
    padding: 20px 0;
}

/* Business Profile Card */
.b2b-business-profile-card {
    background: #ff8126;
    border-radius: 12px;
    padding: 24px;
    color: var(--n1-color, #ffffff);
}

.b2b-profile-card-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.b2b-profile-avatar {
    flex: 0 0 120px;
}

.b2b-profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
}

.b2b-profile-info {
    flex: 1;
    min-width: 0;
}

.b2b-profile-business-name {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
}

.b2b-profile-business-name a {
    color: var(--n1-color, #ffffff);
    text-decoration: none;
}

.b2b-profile-business-name a:hover {
    opacity: 0.85;
}

.b2b-profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 8px;
}

.b2b-profile-meta i {
    font-size: 18px;
}

.b2b-profile-description {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
}

.b2b-profile-description p:last-child {
    margin-bottom: 0;
}

.b2b-profile-services {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.b2b-profile-services h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--n1-color, #ffffff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.b2b-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.b2b-service-tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--n1-color, #ffffff);
}

.b2b-profile-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 16px;
}

.b2b-btn-manage {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: var(--n1-color, #ffffff) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.b2b-btn-manage:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* No Business State */
.b2b-no-business {
    padding: 40px 20px;
}

.b2b-no-business-own {
    text-align: center;
    background: var(--n4-color, #1a1a2e);
    border-radius: 12px;
    padding: 40px;
}

.b2b-no-business-own i {
    font-size: 64px;
    color: #ff8126;
    margin-bottom: 16px;
    display: block;
}

.b2b-no-business-own h3 {
    margin: 0 0 12px;
    color: var(--n1-color, #ffffff);
    font-size: 20px;
}

.b2b-no-business-own p {
    color: var(--n2-color, #000000);
    margin: 0 0 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.b2b-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--p6-color, #6c5ce7);
    border: none;
    border-radius: 8px;
    color: var(--n1-color, #ffffff) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.b2b-btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.b2b-btn-create i {
    font-size: 18px;
}

.b2b-cannot-create {
    color: var(--p2-color, #ff6b6b) !important;
    font-style: italic;
}

.b2b-no-business-other {
    text-align: center;
    padding: 40px;
    color: var(--n2-color, #000000);
}

/* Business Limit Notice */
.b2b-limit-notice {
    background: rgba(255, 129, 38, 0.15);
    border: 1px solid rgba(255, 129, 38, 0.4);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.b2b-limit-notice p {
    margin: 0;
    color: var(--n1-color, #ffffff);
}

.b2b-limit-notice a {
    color: #ff8126;
    font-weight: 600;
}

/* Profile Tab Responsive */
@media (max-width: 576px) {
    .b2b-profile-card-header {
        flex-direction: column;
        text-align: center;
    }

    .b2b-profile-avatar {
        flex: none;
    }

    .b2b-profile-meta {
        justify-content: center;
    }

    .b2b-profile-actions {
        flex-direction: column;
    }

    .b2b-btn-view,
    .b2b-btn-manage {
        text-align: center;
    }

    .b2b-no-business-own {
        padding: 30px 20px;
    }
}
