.container {
    max-width: 1170px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1a202c;
}

header p {
    font-size: 1.2rem;
    color: #718096;
}
/* bbfl style*/
.bbfl-header {
    color: #eb003b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    width: 100%;
}

/* Filter Section Styles */
.filter-container {
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    background: #f0f9ff;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
}

.filter-group select, .filter-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}
.filter-group select:focus, .filter-group input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}
.provider-logo {
    max-height: 60px; /* Adjust as needed */
    max-width: 150px; /* Adjust as needed */
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 5px; /* Centers the logo and adds space below */
}

#search-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color:#3f79ab;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#search-btn:hover {
    background-color:#3f79ab;
;
}

/* Listings Table Styles */
#listings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    /*min-height: 500px;*/ /* Prevent layout shift during filtering */
}

.listing-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.listing-header {
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.listing-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.service-icons { display: flex; gap: 10px; }
.service-icons svg { width: 24px; height: 24px; color: #888; }

.listing-body {
    display: grid;
    grid-template-columns: 200px 1fr 1fr 240px;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
}

.provider-info { text-align: center; }
.provider-logo-placeholder {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}
.provider-retailer { font-size: 0.8rem; color: #777; }

.offer-details ul, .offer-features ul {
    list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px;
}

.offer-details li, .offer-features li { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.offer-details svg { width: 20px; height: 20px; color: #555; }
.offer-features svg { width: 16px; height: 16px; color: #28a745; }

.offer-pricing { text-align: center; border-left: 1px solid #eee; padding-left: 20px; }
.price-container {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.price { font-size: 1.6rem; font-weight: bold; color: #1a202c; }
.regular-price {
    font-size: 1rem;
    color: #718096;
}
.price-disclaimer {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 5px;
    margin-bottom: 5px;
    line-height: 1.4;
}
.price-container { justify-content: center; }.price-term { font-size: 0.85rem; color: #718096; margin-bottom: 15px; }
.cta-button {
    display: inline-block; background-color: #8dc654; color: white; padding: 12px 20px;
    border-radius: 6px; text-decoration: none; font-weight: bold; text-align: center;
    border: none; cursor: pointer; width: 100%;
}
.cta-button:hover { background-color: #8dc654; }

.listing-footer {
    background-color: #f9f9f9; padding: 10px 25px;
    border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; font-weight: bold; color: #777;
    border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
}
.toggle-terms { cursor: pointer; user-select: none; }
.bbfl-frame { cursor: pointer; user-select: none;}
.terms-content {
    max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    padding: 0 25px; background-color: #fdfdfd; font-size: 0.9rem;
}
.terms-content.expanded {
    max-height: 980px; /* Arbitrary large value */
    padding: 20px 25px; 
    border-top: 1px solid #eee;
    overflow-y: auto;
}
.terms-content ul { padding-left: 20px; margin: 0; }
.terms-content li { margin-bottom: 8px; }

/* Pagination Styles */
#pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 10px;
}
.pagination-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #007bff;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.pagination-btn:hover { background-color: #f0f0f0; }
.pagination-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}
.pagination-btn:disabled {
    color: #aaa;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    color: #555;
    user-select: none;
}


/* --- Responsive Styles --- */
@media (max-width: 820px) {
    .listing-body {
        grid-template-columns: 150px 1fr 1fr;
        grid-template-areas: 
            "provider details features"
            "provider pricing pricing";
        gap: 15px;
    }
    .provider-info { grid-area: provider; }
    .offer-details { grid-area: details; }
    .offer-features { grid-area: features; }
    .offer-pricing {
        grid-area: pricing;
        border-left: none;
        padding-left: 0;
        text-align: center;
        border-top: 1px solid #eee;
        padding-top: 20px;
        margin-top: 10px;
    }
    .price-term { margin-bottom: 20px; }
    .cta-button { max-width: 300px; margin: 0 auto; }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
    }
    header h1 {
        font-size: 1.8rem;
    }
    header p {
        font-size: 1rem;
    }
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .listing-header h3 {
        font-size: 1rem;
    }

    .listing-body {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .offer-details ul, .offer-features ul {
        align-items: flex-start;
    }
    
    .offer-pricing {
        padding-top: 20px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
    }
    .pagination-ellipsis {
        padding: 8px 3px;
    }
}