/* General Widget Container */
.cag-widget-list {
    background-color: #f0f2f5; /* Light grey background, common in modern UIs */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); /* Soft, subtle shadow */
    font-family: 'Montserrat', sans-serif;
    color: #333333;
    padding: 10px; /* Padding around the list of items */
    border: 1px solid #e0e0e0; /* Light border for definition */
}

.cag-main-widget-container {
    margin-left: 1rem;
    margin-right: 1rem;
}
/* Widget Title (e.g., "EXCLUSIVE OFFERS") */
.widget-title {
    /* Existing styles */
    background: linear-gradient(90deg, #e74c3c, #c0392b); /* Strong red gradient for title background */
    color: #ffffff; /* White text for contrast */
    padding: 15px 20px; /* Increased padding */
    font-size: 1.6em; /* Larger font size */
    font-weight: 700; /* Bolder font */
    text-transform: uppercase;
    letter-spacing: 1px; /* More spacing between letters */
    border-bottom: none; /* No border */
    margin-bottom: 15px; /* More space before first card */
    text-align: center; /* Center the title */
    border-radius: 10px 10px 0 0; /* Rounded top corners */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); /* Subtle text shadow */
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4); /* Shadow to lift the title */
}

.widget-title::after {
    content: none; /* Remove "Ver Todo" for this design */
}

/* Individual Bookmaker Item (Card) */
.cag-widget-item {
    background-color: #ffffff; /* White card background */
    border-radius: 8px;
    margin: 10px 0; /* Vertical spacing between cards */
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Soft shadow for cards */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8e8e8; /* Very light border */
}

.cag-widget-item:hover {
    transform: translateY(-3px); /* Gentle lift on hover */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12); /* Slightly stronger shadow */
}

/* Header Section of the Card (Logo background) */
.cag-widget-header {
    background-color: #1a7a40; /* Default dark green for header, like Bet365 */
    height: 70px; /* Fixed height for header */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Subtle separator */
}

/* Specific header colors based on cag_header_color meta field */
.cag-widget-header.dark-green {
    background-color: #1a7a40; /* Bet365 green */
}
.cag-widget-header.dark-grey {
    background-color: #222222; /* BetMGM dark grey */
}
/* You can add more classes here if you define more header colors in PHP */


/* Logo inside the header */
.cag-widget-header-logo {
    max-width: 150px; /* Max width for logos */
    max-height: 100%;
    overflow: hidden;
    display: flex; /* For centering image */
    justify-content: center;
    align-items: center;
}

.cag-widget-header-logo img {
    width: 100%; /* Make image fill container */
    height: auto;
    display: block;
    object-fit: contain;
}

/* Main Body Section of the Card */
.cag-widget-body {
    padding: 15px 20px; /* Padding inside the card body */
    text-align: center; /* Center content horizontally */
}

/* Badge (TRENDING, LIMITED-TIME) */
.cag-widget-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px; /* Pill shape */
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cag-badge-trending {
    background-color: #e74c3c; /* Red for Trending */
    color: #ffffff;
}

.cag-badge-limited-time {
    background-color: #95a5a6; /* Grey for Limited-Time */
    color: #ffffff;
}

/* Offer Text (e.g., "Bet $5 Get $150...") */
.cag-widget-offer-text {
    font-size: 1.15em;
    font-weight: 600;
    color: #333333;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Brief Terms and Conditions */
.cag-widget-terms-brief {
    font-size: 0.85em;
    color: #666666;
    margin-bottom: 15px;
}

/* Claim Now Button */
.cag-widget-button {
    background: linear-gradient(90deg, #e74c3c, #c0392b); /* Strong red gradient for CTA */
    color: #fff;
    padding: 12px 25px;
    border-radius: 25px; /* Pill-shaped button */
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
    transition: all 0.3s ease-out;
    border: none;
    cursor: pointer;
    width: 90%; /* Almost full width of card body */
    max-width: 250px; /* Limit max width for elegance */
    margin: 0 auto 15px; /* Center button and add bottom margin */
    display: block;
}

.cag-widget-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.6);
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

/* Expandable Section Links (Read review, How to claim) */
.cag-widget-expandable-links {
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eeeeee; /* Separator line */
    padding-top: 15px;
    margin-top: 10px; /* Space from button */
    font-size: 0.9em;
    font-weight: 500;
}

.cag-widget-expandable-links a.cag-read-review-link { /* Specific style for Read review link */
    color: #333333; /* Dark text for read review link */
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.cag-widget-expandable-links a.cag-read-review-link:hover {
    color: #e74c3c; /* Red on hover for Read review */
    background-color: #f0f0f0;
}

/* How to claim toggle label (acting as a button) */
.cag-how-to-claim-checkbox {
    /* Ensure the checkbox is completely hidden from view and interaction */
    position: absolute;
    opacity: 0;
    pointer-events: none; /* Prevents interaction if somehow visible */
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    margin: -1px;
    padding: 0;
    border: 0;
}

.cag-how-to-claim-label {
    color: #e74c3c; /* Red color for How to claim text */
    text-decoration: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
    display: flex; /* To align text and arrow */
    align-items: center;
}

.cag-how-to-claim-label:hover {
    color: #c0392b; /* Darker red on hover */
    background-color: #f0f0f0;
}

.cag-arrow {
    margin-left: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* When the checkbox is checked, rotate the arrow */
.cag-how-to-claim-checkbox:checked + .cag-how-to-claim-label .cag-arrow {
    transform: rotate(180deg);
}

/* Expandable Content (How to claim steps) */
.cag-widget-content-expandable {
    /* Initially hidden by setting max-height to 0 and overflow hidden */
    max-height: 0;
    overflow: hidden; /* Important for hiding content cleanly */
    overflow-y: auto; /* Add scroll if content exceeds max-height */
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, border-top 0.4s ease-in-out; /* Smooth transition */
    padding: 0 20px; /* Initial padding is 0 for vertical, 20px for horizontal */
    background-color: #fdfdfd; /* Slightly different background for expanded content */
    border-top: 1px solid transparent; /* Transparent border initially, shows on expand */
    margin-top: 10px; /* Space from toggle link */
    text-align: left;
    font-size: 0.9em;
    color: #555555;
    line-height: 1.6;
}

/* When the checkbox is checked, show the content by increasing max-height */
.cag-how-to-claim-checkbox:checked ~ .cag-widget-content-expandable {
    max-height: 500px; /* A value large enough to contain all content. Adjust if your steps are much longer. */
    padding-top: 15px; /* Add vertical padding when expanded */
    padding-bottom: 15px; /* Add vertical padding when expanded */
    border-top: 1px solid #f0f0f0; /* Show border when expanded */
}


/* Title for the dynamic "How to claim" section when expanded */
.cag-static-how-to-claim-title {
    font-size: 1em;
    font-weight: 600;
    color: #333333;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cag-claim-steps-list {
    list-style: none; /* Remove default bullet points */
    padding: 0;
    margin: 0;
}

.cag-claim-steps-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cag-claim-steps-list li .cag-step-number {
    background-color: #27ae60; /* Green number background */
    color: #ffffff;
    font-weight: bold;
    border-radius: 50%; /* Circular number */
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    flex-shrink: 0; /* Prevent shrinking */
    margin-right: 10px;
    margin-top: 2px; /* Align with text baseline */
}

/* Common problem and hotline text */
.cag-common-problem-text,
.cag-gambling-hotline {
    font-size: 0.75em;
    color: #888888;
    line-height: 1.4;
    margin-top: 10px;
    padding: 0; /* Remove padding here, controlled by parent .cag-widget-content-expandable */
}

/* "No Casas" Message */
.cag-no-casas {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cag-widget-list {
        border-radius: 8px;
        padding: 5px;
    }

    .widget-title {
        padding: 12px 15px;
        font-size: 1em;
    }

    .cag-widget-header {
        height: 60px;
    }

    .cag-widget-header-logo {
        max-width: 120px;
    }

    .cag-widget-body {
        padding: 10px 15px;
    }

    .cag-widget-badge {
        padding: 3px 10px;
        font-size: 0.7em;
        margin-bottom: 8px;
    }

    .cag-widget-offer-text {
        font-size: 1em;
    }

    .cag-widget-terms-brief {
        font-size: 0.8em;
    }

    .cag-widget-button {
        padding: 10px 20px;
        font-size: 0.9em;
        width: 100%;
        max-width: none; /* Remove max-width on mobile */
    }

    .cag-widget-expandable-links {
        flex-direction: column;
        align-items: center;
        padding-top: 10px;
        margin-top: 5px;
    }

    .cag-widget-expandable-links a,
    .cag-how-to-claim-label {
        padding: 5px;
        margin-bottom: 5px;
    }

    .cag-widget-content-expandable {
        padding: 10px 15px; /* Adjusted padding */
        font-size: 0.85em;
    }

    .cag-static-how-to-claim-title {
        font-size: 0.9em;
    }

    .cag-claim-steps-list li .cag-step-number {
        width: 18px;
        height: 18px;
        font-size: 0.7em;
        margin-right: 8px;
    }

    .cag-common-problem-text,
    .cag-gambling-hotline {
        font-size: 0.7em;
    }
}
