/* Business Preview Slider Styles */
.business-preview-section {
    height: calc(50vh + 100px); /* Half screen height plus 100px for better spacing */
    max-height: calc(50vh + 100px); /* Prevent it from growing beyond this height */
    overflow: hidden; /* Ensure content doesn't overflow */
}

.business-slider-container {
    position: relative;
    width: 100%;
    max-width: 1600px; /* Prevent excessive stretching on very large screens */
    padding: 0 60px; /* Increased padding to prevent arrows from being cut off */
    margin: 0 auto;
    overflow: visible; /* Changed to visible to ensure buttons are accessible */
    height: 100%; /* Take full height of the parent section */
    max-height: 100%; /* Ensure it doesn't exceed parent height */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
}

.business-slider-track {
    display: flex;
    overflow-x: hidden; /* Changed from auto to hidden to prevent scrolling */
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 10px 0; /* Further reduced padding to save vertical space */
    gap: 20px;
    margin: 0 auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    transition: transform 0.5s ease-out; /* Smoother transitions for slider movement */
    width: 100%; /* Ensure full width */
    flex-shrink: 0; /* Prevent shrinking */
    align-items: center; /* Center cards vertically */
}

.business-slider-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.business-card {
    flex: 0 0 auto;
    width: 340px; /* Fixed width for desktop */
    height: 160px; /* Further reduced height to fit better in 50vh */
    scroll-snap-align: start;
    background: rgba(30, 30, 42, 0.75); /* Lighter background for better contrast */
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(49, 111, 212, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Enhanced drop shadow for better elevation */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    cursor: pointer; /* Make it clear cards are clickable */
    display: flex;
    flex-direction: column;
}

.business-card.animate-card {
    opacity: 1;
    transform: translateY(0);
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(49, 111, 212, 0.3);
}

.business-card-header {
    position: relative;
    padding: 12px 18px 8px; /* Reduced padding for more compact header */
    background: linear-gradient(135deg, rgba(49, 111, 212, 0.1) 0%, rgba(49, 111, 212, 0.05) 100%);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(49, 111, 212, 0.1);
    flex-shrink: 0;
}

.business-card-overlay {
    position: relative;
}

.business-card-category {
    display: inline-block;
    background: rgba(49, 111, 212, 0.1);
    border: 1px solid rgba(49, 111, 212, 0.2);
    color: rgba(255, 255, 255, 0.7); /* De-emphasized with lighter color */
    font-size: 0.65rem; /* Smaller font size */
    padding: 2px 8px;
    border-radius: 30px;
    margin-bottom: 6px;
    font-weight: 400; /* Normal weight to de-emphasize */
}

.business-card-title {
    font-size: 1.25rem; /* Increased from 1.1rem to 18-20px equivalent */
    font-weight: 700; /* Increased weight for better hierarchy */
    color: #fff;
    margin-bottom: 4px; /* Reduced margin for tighter spacing */
    line-height: 1.3; /* Increased line-height for better readability */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.business-card-location {
    font-size: 0.75rem; /* Slightly smaller */
    color: rgba(255, 255, 255, 0.6); /* More de-emphasized */
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400; /* Normal weight */
}

.business-card-body {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.business-metrics {
    display: flex;
    justify-content: space-between;
    gap: 6px; /* Reduced gap for better spacing */
    background: rgba(49, 111, 212, 0.03); /* Subtle unified background */
    border-radius: 8px;
    padding: 8px 6px 24px; /* Increased bottom padding from 8px to 24px */
    margin-top: 8px; /* Space from content above */
}

.metric-item {
    text-align: center;
    padding: 6px 4px; /* Reduced padding since we have container padding */
    background: transparent; /* Remove individual backgrounds */
    border-radius: 0; /* Remove individual border radius */
    transition: all 0.3s ease;
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.1); /* Subtle dividers */
}

.metric-item:last-child {
    border-right: none; /* Remove border from last item */
}

.metric-item:hover {
    background: rgba(49, 111, 212, 0.08);
    border-radius: 4px; /* Add border radius on hover */
}

.metric-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
    text-transform: uppercase; /* All-caps for labels */
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-value {
    font-size: 1rem; /* Increased from 0.9rem for larger numbers */
    font-weight: 700; /* Bolder for emphasis */
    color: #fff;
    line-height: 1.2;
}

/* Color coding for different metrics */
.metric-item[data-type="price"] .metric-value {
    color: #60a5fa; /* Blue for asking price */
}

.metric-item[data-type="price"] .metric-label {
    color: rgba(96, 165, 250, 0.7); /* Blue tint for price label */
}

.metric-item[data-type="revenue"] .metric-value {
    color: #d1d5db; /* Neutral grey for revenue */
}

.metric-item[data-type="revenue"] .metric-label {
    color: rgba(209, 213, 219, 0.7); /* Grey tint for revenue label */
}

.metric-item[data-type="profit"] .metric-value {
    color: #34d399; /* Soft green for profit */
}

.metric-item[data-type="profit"] .metric-label {
    color: rgba(52, 211, 153, 0.7); /* Green tint for profit label */
}

/* Color-coded divider lines */
.metric-item[data-type="price"] {
    border-right-color: rgba(96, 165, 250, 0.15); /* Blue tinted divider */
}

.metric-item[data-type="revenue"] {
    border-right-color: rgba(209, 213, 219, 0.15); /* Grey tinted divider */
}

.metric-item[data-type="profit"] {
    border-right-color: rgba(52, 211, 153, 0.15); /* Green tinted divider */
}

.business-card-footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.875rem 1.75rem;
    background: #064fa3;
    color: white;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(6, 79, 163, 0.25);
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    margin: 8px auto 5px; /* Keep the existing margin adjustments for the business section layout */
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(6, 79, 163, 0.35);
    background: #053e85;
}

.view-all-btn svg {
    transition: transform 0.3s ease;
}

.view-all-btn:hover svg {
    transform: translateX(3px);
}

.slider-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(49, 111, 212, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30; /* Increased z-index to ensure buttons are above slider */
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
    margin: 0 10px; /* Added margin to ensure buttons aren't cut off */
    /* Make sure buttons are always above other content */
    will-change: transform, opacity;
}

.slider-nav-button:hover {
    background: rgba(49, 111, 212, 0.3);
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
}

.slider-nav-button svg {
    fill: none;
    stroke: white;
    stroke-width: 2px;
    transition: transform 0.3s ease;
}

.slider-nav-button:hover svg {
    transform: scale(1.1);
}

#slideLeft {
    left: 0;
}

#slideRight {
    right: 0;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px; /* Reduced margin to save vertical space */
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.slider-dot.active {
    background: var(--primary-blue, #316FD4);
    transform: scale(1.3);
}

.slider-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-blue, #316FD4);
    opacity: 0.3;
    transition: all 0.5s ease;
}

.slider-dot.active::after {
    width: 24px;
    height: 24px;
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.5;
    }
    70% {
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Loading state */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    text-align: center;
    color: #a0aec0;
}

.loader-circle {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide/show loading state */
.loading-state.hidden {
    display: none;
}

/* Ensure proper opacity transition */
.business-slider-track.opacity-0 {
    opacity: 0;
}

/* Responsive Design for Mobile */
@media (max-width: 640px) {
    .business-preview-section {
        min-height: 40vh; /* Smaller on mobile */
    }
    
    .business-slider-container {
        padding: 0 40px; /* Increased padding for mobile to prevent arrows from being cut off */
        overflow: hidden; /* Keep consistent with desktop */
    }
    
    .business-card {
        width: 280px; /* Smaller width for mobile */
        height: 180px; /* Proportionally smaller height */
        margin-right: 15px;
    }
    
    .business-card-header {
        padding: 12px 15px 8px;
    }
    
    .business-card-body {
        padding: 12px 15px;
    }
    
    .business-card-title {
        font-size: 1rem;
    }
    
    .business-card-category {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    
    .business-card-location {
        font-size: 0.75rem;
    }
    
    .metric-item {
        padding: 6px 4px;
    }
    
    .metric-label {
        font-size: 0.6rem;
    }
    
    .metric-value {
        font-size: 0.8rem;
    }
    
    .slider-nav-button {
        width: 40px;
        height: 40px;
        margin: 0 5px; /* Added margin for mobile */
        /* Position buttons closer to edge of cards rather than container */
        background: rgba(49, 111, 212, 0.3); /* Make more visible on mobile */
        z-index: 30; /* Ensure buttons are above the slider content */
    }
    
    #slideLeft {
        left: 5px;
    }
    
    #slideRight {
        right: 5px;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    .business-card {
        width: 320px;
        height: 190px;
    }
    
    .business-slider-container {
        padding: 0 50px; /* Adjusted padding for tablet */
    }
    
    #slideLeft {
        left: 10px;
    }

    #slideRight {
        right: 10px;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .business-slider-container {
        padding: 0 70px; /* Increased padding for large screens */
    }
    
    #slideLeft {
        left: 20px;
    }

    #slideRight {
        right: 20px;
    }
    
    /* Ensure buttons are more visible on hover */
    .slider-nav-button:hover {
        background: rgba(49, 111, 212, 0.4);
        transform: translateY(-50%) scale(1.1);
        opacity: 1;
    }
}

/* Extra large screens */
@media (min-width: 1280px) {
    .business-card {
        width: 360px;
        height: 210px;
    }
}