/* 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 to accommodate company name */
    grid-template-columns: 30px 150px 1fr 130px 100px 110px;
    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;
    /* Updated column layout to match header */
    grid-template-columns: 30px 150px 1fr 130px 100px 110px;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    align-items: center;
}

/* 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;
}

/* 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;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.bonus-company-logo {
    max-width: 60px !important;
    max-height: 40px !important;
    object-fit: contain;
    margin-right: 10px;
}

.company-name {
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

/* 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:10px;
}

.btn-disclaimer {
    display: block;
    font-size: 10px;
    color: #444444;
    margin-top: 5px;
    text-align: center;
}

/* 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;
}

/* 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 {
        justify-content: flex-end;
    }
    
    .bonus-company-logo {
        max-width: 40px !important;
        margin-right: 5px;
    }
    
    .company-name {
        font-size: 12px;
    }
    
    .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;
    }
    
    /* 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);
    }
}

/* Pagination Container */
.bonuses-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

/* Pagination Info */
.pagination-info {
    font-size: 14px;
    color: #666;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Pagination Button */
.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
}

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

.pagination-btn.active {
    background-color: #2fb682;
    color: #fff;
    border-color: #2fb682;
    cursor: default;
}

.pagination-btn.active:hover {
    background-color: #2fb682;
}

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

/* Pagination Dots */
.pagination-dots {
    padding: 0 8px;
    color: #999;
    font-size: 14px;
}

/* Mobile Pagination Styles */
@media (max-width: 767px) {
    .bonuses-pagination {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .pagination-info {
        font-size: 12px;
        text-align: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
    }
    
    .pagination-btn {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 0 6px;
    }
    
    .pagination-dots {
        padding: 0 4px;
        font-size: 12px;
    }
}