/* Bonus Type Container - holds both tabs and disclaimer */
.bonus-type-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 5;
}

/* Tabs Disclaimer */
.tabs-disclaimer {
    font-size: 11px;
    color: #666;
    text-align: right;
    white-space: nowrap;
    padding-right: 10px;
}

.tabs-disclaimer a {
    color: #2fb682;
    text-decoration: none;
}

.tabs-disclaimer a:hover {
    text-decoration: underline;
    color: #138157;
}

/* Bonus Type Tabs */
.bonus-type-tabs {
    display: flex;
    justify-content: start;
    margin-bottom: -1px;
    position: relative;
    z-index: 5;
}

.type-tab {
    padding: 4px 20px;
    background-color: #17213e;
    margin: 0px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    color: #fff;
    transition: all 0.2s ease;
}

.type-tab:hover {
    background-color: #138157;
}

.type-tab.active {
    background-color: #2fb682;
    position: relative;
    color: white;
}

.type-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #f8f8f8;
}

/* Grid Container */
.bonuses-grid-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 6px;
    color: #212529;
}

/* Grid Header */
.grid-header {
    display: grid;
    /* Updated column layout with better proportions */
    grid-template-columns: 30px 140px 1fr 1fr 250px 140px;
    gap: 10px;
    font-weight: bold;
    background-color: #f8f8f8;
    padding: 10px 15px 10px 15px;
    border-radius: 4px;
    align-items: center;
    background-color: #17213e;
    color: white;
}

/* Make each header cell align with content below */
.grid-header > div {
    display: flex;
    justify-content: flex-start; /* Left alignment */
    padding: 0 5px;
}

/* Center alignment for rank header */
.grid-header > div:first-child {
    justify-content: center;
}

/* Grid Row */
.grid-row {
    display: grid;
    /* Match the header columns */
    grid-template-columns:30px 140px 1fr 1fr 250px 140px;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    align-items: center;
	margin-bottom: 10px;
}

/* Promoted bonuses */
.promoted-bonus {
    background-color: #f8fff8;
    border: 1px solid #c8e6c9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Grid Cell */
.grid-cell {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 0 8px;
    font-weight:600;
}

/* Pros and cons - Updated for better layout */
.perks-list, .cons-list {
    list-style: none;
    padding-left: 0px !important;
    margin-bottom: 0;
    width: 100%;
}

.perks-list li, .cons-list li {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    line-height: 1.3;
}

.perks-list li:last-child, .cons-list li:last-child {
    margin-bottom: 0;
}

.perks-list i, .cons-list i {
    margin-right: 6px;
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 2px;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

/* Make sure the wagering and odds cells handle the lists properly */
.wagering-cell, .odds-cell {
    padding: 8px;
    align-items: flex-start;
    font-weight: normal;
}

/* Specific cell styles */
.rank-cell {
    justify-content: center;
    font-weight: bold;
}

/* Company cell specific styling */
.company-cell {
    justify-content: flex-start;
}

.company-cell a {
    display: flex;
    flex-direction: column; /* Changed from row to column */
    align-items: center; /* Center items horizontally */
    text-decoration: none;
    color: inherit;
    width: 100%; /* Take full width */
}

.bonus-company-logo {
    max-width: 70px !important; /* Slightly larger logo */
    max-height: 70px !important;
    object-fit: contain;
    margin-right: 0; /* Remove right margin */
    margin-bottom: 8px; /* Add bottom margin instead */
}

.company-name {
    font-size: 12px;
    font-weight: 800;
    text-align: center; /* Center text */
    width: 100%; /* Full width */
}

.button-cell {
    justify-content: center;
}

/* Bonus Description */
.bonus-description {
    margin: 0;
    font-size: 12px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

/* Get Bonus Button */
.get-bonus-btn {
    white-space: nowrap;
    padding: 6px 12px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.get-bonus-btn:hover {
    background-color: #218838;
}

.bonus-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 5px;
    padding-left: 5px;
    width: 100%;
}

.btn-disclaimer {
    display: block;
    font-size: 10px;
    color: #444444;
    margin-top: 5px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

/* Filter Container */
#bonuses-filter-container {
    
}

.filter-content {
    max-width: 100%;
    display: block;
    border: 1px solid #e9e9e9;
    border-radius: 4px;
    background-color: #f8f8f8;
    margin: 0px 0px 16px 0px;
}

.filter-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0px;
    justify-content: center;
    margin: 20px 0px 20px 0px;
}

.filter-btn {
    padding: 4px 8px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    outline: none;
}

.filter-btn:hover {
    background-color: #138157;
    color: #fff;
}

.filter-btn:focus {
    outline: none;
    background-color: #fff;
    color: #fff;
    border: 1px solid #ddd;
}

.filter-btn.active {
    background-color: #2fb682;
    color: #fff;
    border-color: #2fb682;
}

.filter-btn.active:focus {
    background-color: #2fb682;
    color: #fff;
    border-color: #2fb682;
}

/* Medium screen size adjustments - for screens between mobile and desktop */
@media (max-width: 1024px) and (min-width: 768px) {
    .grid-header, .grid-row {
        grid-template-columns: 30px 120px 0.8fr 0.8fr 160px 110px;
        gap: 8px;
    }
    
    .bonus-company-logo {
        max-width: 50px !important;
        max-height: 35px !important;
    }
    
    .company-name {
        font-size: 11px;
    }
    
    .grid-cell {
        font-size: 11px;
        padding: 0 5px;
    }
    
    .bonus-description {
        font-size: 11px;
    }
    
    .perks-list li, .cons-list li {
        margin-bottom: 4px;
        font-size: 11px;
    }
    
    .get-bonus-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Small desktop/tablet adjustments - enhance readability */
@media (max-width: 900px) and (min-width: 768px) {
    .grid-header, .grid-row {
        grid-template-columns: 30px 100px 0.7fr 0.7fr 140px 100px;
        gap: 5px;
    }
    
    .bonus-company-logo {
        max-width: 40px !important;
        max-height: 30px !important;
        margin-right: 5px;
    }
    
    .company-name {
        font-size: 10px;
    }
    
    .grid-cell {
        font-size: 10px;
        padding: 0 4px;
    }
    
    .perks-list i, .cons-list i {
        font-size: 12px;
    }
    
    .get-bonus-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .btn-disclaimer {
        font-size: 9px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .bonus-type-container {
        flex-direction: column;
        padding: 0 5px;
    }
    
    .tabs-disclaimer {
        font-size: 10px;
        margin-bottom: 6px;
        text-align: center;
        width: 100%;
        padding-right: 0;
        margin-top: 6px;
    }
    
    .type-tab {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    .grid-header {
        display: none; /* Hide header on mobile */
    }
    
    .grid-row {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 5px; /* Reduce gap between cells */
    }
    
    .grid-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px;
        border-bottom: 1px solid #eee;
        font-size: 10px;
    }
    
    .grid-cell::before {
        content: attr(data-label); /* Use data-label for mobile headers */
        font-weight: 800;
        text-transform: uppercase;
        margin-right: 10px;
        flex: 1;
    }
    
    .grid-cell:last-child {
        border-bottom: none;
    }
    
    .rank-cell:empty,
    .rank-cell[data-label="Rank"] {
        display: none; /* Hide rank cell on mobile */
    }
    
    .company-cell a {
        flex-direction: row; /* Keep as row on mobile */
        justify-content: flex-end; /* Right align on mobile */
        align-items: center;
    }
    
    .bonus-company-logo {
        max-width: 40px !important;
        max-height: 30px !important;
        margin-right: 5px; /* Add right margin back for mobile */
        margin-bottom: 0; /* Remove bottom margin on mobile */
    }
    
    .company-name {
        text-align: right; /* Right align text on mobile */
        width: auto; /* Auto width on mobile */
    }
    
    .bonus-description {
        font-size: 12px;
        white-space: normal; /* Allow text to wrap */
        word-wrap: break-word; /* Allow text to wrap */
    }
    
    .get-bonus-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
	
    .bonus-btn {
        padding-top: 10px;
    }
    
    .btn-disclaimer {
        font-size: 9px;
        margin-top: 3px;
    }
    
    /* Updated styles for perks and cons on mobile */
    .wagering-cell, .odds-cell {
        flex-direction: row; /* Keep as row on mobile */
    }
    
    .perks-list, .cons-list {
        align-self: flex-end; /* Align to the right */
        text-align: right; /* Right-align text */
    }
    
    .perks-list li, .cons-list li {
        justify-content: flex-end; /* Align list items to the right */
    }
    
    .perks-list i, .cons-list i {
        order: 2; /* Move icons to the right side of text */
        margin-right: 0;
        margin-left: 6px; /* Add margin to left instead of right */
    }
    
    /* Filter container with 3 buttons per row */
    .filter-items-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px; /* Smaller gap for 3 per row */
        justify-content: flex-start;
        margin: 15px 15px;
        padding: 0px;
    }
    
    /* Default is 3 buttons per row */
    .filter-btn {
        width: calc(33.333% - 4px); /* One third width minus spacing */
        text-align: center;
        font-size: 11px;
        padding: 7px 3px;
        margin-bottom: 4px;
        white-space: normal; /* Allow text to wrap within button */
        height: auto;
        min-height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Long text buttons (added by JS) take half width - 2 per row */
    .filter-btn.long-text {
        width: calc(50% - 3px);
    }
}