/* =============================================================================
   BETFORMATICS PROMOTIONS - COMPACT LIGHT DESIGN

   Dependencies: betformatics-variables (loaded via PHP)
   ============================================================================= */

/* =============================================================================
   OUTER WRAPPER
   ============================================================================= */
.betformatics-promotions-outer-wrapper {
    width: 100%;
}

/* =============================================================================
   FILTER BUTTONS - Sliding Pill Toggle with Indicator
   Consolidated styles for both .bf-filter-toggle and .betformatics-promotions-filter
   ============================================================================= */

/* Base container styles */
.bf-filter-toggle,
.betformatics-promotions-filter {
    --bf-filter-bg: #1a2332;
    --bf-filter-indicator-start: #FFCC00;
    --bf-filter-indicator-end: #1848A0;
    --bf-filter-text: #FFCC00;
    --bf-filter-text-hover: #ffe066;
    --bf-filter-text-active: #ffffff;
    --bf-filter-padding: 5px;
    --bf-filter-btn-count: 3;

    position: relative;
    display: inline-flex;
    background: var(--bf-filter-bg);
    border-radius: 9999px;
    padding: var(--bf-filter-padding);
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Sliding indicator */
.bf-filter-toggle::before,
.betformatics-promotions-filter::before {
    content: '';
    position: absolute;
    top: var(--bf-filter-padding);
    bottom: var(--bf-filter-padding);
    left: var(--bf-filter-padding);
    width: calc((100% - (var(--bf-filter-padding) * 2)) / var(--bf-filter-btn-count));
    background: linear-gradient(135deg, var(--bf-filter-indicator-start), var(--bf-filter-indicator-end));
    border-radius: 9999px;
    box-shadow: 0 4px 15px rgba(0, 74, 173, 0.4);
    transition: transform 0.3s ease-out;
    z-index: 0;
    pointer-events: none;
}

/* Position indicator based on active button */
.bf-filter-toggle[data-active="1"]::before,
.betformatics-promotions-filter[data-active="1"]::before { transform: translateX(0); }

.bf-filter-toggle[data-active="2"]::before,
.betformatics-promotions-filter[data-active="2"]::before { transform: translateX(100%); }

.bf-filter-toggle[data-active="3"]::before,
.betformatics-promotions-filter[data-active="3"]::before { transform: translateX(200%); }

.bf-filter-toggle[data-active="4"]::before,
.betformatics-promotions-filter[data-active="4"]::before { transform: translateX(300%); }

/* Button count CSS variable */
.bf-filter-toggle[data-count="2"],
.betformatics-promotions-filter[data-count="2"] { --bf-filter-btn-count: 2; }

.bf-filter-toggle[data-count="3"],
.betformatics-promotions-filter[data-count="3"] { --bf-filter-btn-count: 3; }

.bf-filter-toggle[data-count="4"],
.betformatics-promotions-filter[data-count="4"] { --bf-filter-btn-count: 4; }

/* Button styles */
.bf-filter-toggle .bf-filter-btn,
.betformatics-promotions-filter .betformatics-filter-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bf-filter-text);
    background: transparent !important;
    border: none !important;
    border-radius: 9999px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    box-sizing: border-box;
    margin: 0;
    line-height: 1.4;
    text-decoration: none !important;
    box-shadow: none !important;
}

.bf-filter-toggle .bf-filter-btn:hover:not(.is-active),
.betformatics-promotions-filter .betformatics-filter-btn:hover:not(.is-active) {
    color: var(--bf-filter-text-hover);
    background: transparent !important;
}

.bf-filter-toggle .bf-filter-btn.is-active,
.betformatics-promotions-filter .betformatics-filter-btn.is-active {
    color: var(--bf-filter-text-active);
    background: transparent !important;
}

.bf-filter-toggle .bf-filter-btn:focus,
.betformatics-promotions-filter .betformatics-filter-btn:focus {
    outline: none;
}

.bf-filter-toggle .bf-filter-btn:focus-visible,
.betformatics-promotions-filter .betformatics-filter-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(40, 170, 226, 0.5) !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .bf-filter-toggle,
    .betformatics-promotions-filter {
        width: 100%;
        display: flex;
    }

    .bf-filter-toggle .bf-filter-btn,
    .betformatics-promotions-filter .betformatics-filter-btn {
        flex: 1;
        padding: 12px 8px;
        font-size: 12px;
        min-width: 0;
    }
}

/* =============================================================================
   WELCOME HEADING - "Ny spiller hos X?"
   ============================================================================= */
.betformatics-welcome-heading {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--bf-primary) !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    line-height: 1.4 !important;
}

.betformatics-promotions-wrapper,
.betformatics-promotions-wrapper * {
    box-sizing: border-box;
}

.betformatics-promotions-wrapper {
    width: 100%;
    margin: 15px 0;
    padding: 0;
    overflow-x: hidden;
}

.betformatics-promotions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* =============================================================================
   PROMOTION CARD
   ============================================================================= */
.betformatics-promotion-card {
    background: var(--bf-white, #ffffff);
    border: 1px solid var(--bf-border, #e5e7eb);
    border-radius: var(--bf-radius-base, 8px);
    overflow: hidden;
    transition: transform var(--bf-transition-base, 0.2s ease), box-shadow var(--bf-transition-base, 0.2s ease);
    box-shadow: var(--bf-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Welcome card needs position relative for oblique label */
.betformatics-welcome-card {
    position: relative;
}

/* =============================================================================
   OBLIQUE TYPE LABEL (CASINO / BETTING) - Welcome Bonus Shortcode Only
   ============================================================================= */
.betformatics-welcome-type-label {
    position: absolute;
    top: 12px;
    left: -32px;
    width: 120px;
    padding: 4px 0;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bf-white);
    background: var(--bf-primary);
    transform: rotate(-45deg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Casino label - purple/magenta color */
.betformatics-welcome-type-casino {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
}

/* Betting label - green color */
.betformatics-welcome-type-betting {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* =============================================================================
   RATING BADGE - Top Right Corner
   ============================================================================= */
.betformatics-welcome-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bf-warning-light);
    color: var(--bf-warning-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 10;
    box-shadow: var(--bf-shadow-sm);
}

.betformatics-welcome-rating-badge svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

/* =============================================================================
   OBLIQUE TYPE LABEL (CAMPAIGN TYPE) - cta_kampagner Shortcode
   ============================================================================= */
.betformatics-promotion-has-label {
    position: relative;
    overflow: hidden;
}

.betformatics-promotion-type-ribbon {
    position: absolute;
    top: 12px;
    left: -32px;
    width: 120px;
    padding: 4px 0;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bf-white);
    background: var(--bf-primary);
    transform: rotate(-45deg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Weekly - blue */
.betformatics-promotion-type-weekly {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Monthly - purple */
.betformatics-promotion-type-monthly {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Promotion/Kampagne - orange */
.betformatics-promotion-type-promotion {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* Welcome Offer/Velkomstbonus - green */
.betformatics-promotion-type-welcome {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Desktop: Reduce left margin - symmetric with button spacing on right */
.betformatics-welcome-card .betformatics-promotion-logo-section {
    margin-left: 0;
}

/* Mobile: Remove extra margin since layout is stacked */
@media (max-width: 600px) {
    .betformatics-welcome-card .betformatics-promotion-logo-section {
        margin-left: 0;
    }
}

/* =============================================================================
   WELCOME BONUS MOBILE HEADER - Full width brand color with centered logo
   ============================================================================= */
.betformatics-welcome-mobile-header {
    display: none; /* Hidden on desktop */
}

/* Mobile: Show full-width header with brand color */
@media (max-width: 600px) {
    .betformatics-welcome-mobile-header {
        display: flex;
        position: relative;
        width: 100%;
        min-height: 80px;
        align-items: center;
        justify-content: center;
        padding: 16px 20px;
        background: #f8f8f8;
    }

    .betformatics-welcome-mobile-rating {
        position: absolute;
        top: 10px;
        right: 10px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #fef3c7;
        color: #92400e;
        font-size: 12px;
        font-weight: 700;
        padding: 4px 8px;
        border-radius: 12px;
        z-index: 1;
    }

    .betformatics-welcome-mobile-rating svg {
        flex-shrink: 0;
    }

    .betformatics-welcome-mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: 140px;
        max-height: 60px;
    }

    .betformatics-welcome-mobile-logo img {
        max-width: 100%;
        max-height: 60px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    /* Hide desktop logo section on mobile */
    .betformatics-welcome-card .betformatics-promotion-logo-section {
        display: none;
    }

    /* Hide inline rating on mobile (shown in header instead) */
    .betformatics-welcome-card .betformatics-promotion-rating {
        display: none;
    }

    /* Larger name on mobile */
    .betformatics-welcome-provider-name {
        font-size: 16px !important;
        font-weight: 700 !important;
    }
}

/* =============================================================================
   CTA SPILUDBYDERE MOBILE HEADER - Full width brand color with centered logo
   Hidden on desktop (>600px), visible on mobile
   ============================================================================= */
.betformatics-cta-mobile-header {
    display: none; /* Hidden on desktop by default */
    position: relative;
    width: 100%;
    min-height: 80px;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: #f8f8f8;
    box-sizing: border-box;
    overflow: hidden;
}

/* Mobile: Show header */
@media (max-width: 600px) {
    .betformatics-cta-mobile-header {
        display: flex;
    }

    /* Hide desktop-only elements on mobile - high specificity to override Elementor */
    .betformatics-promotion-logo-section,
    .betformatics-promotion-provider-section,
    .betformatics-promotion-review-link,
    .betformatics-desktop-cta,
    .betformatics-promotion-card .betformatics-desktop-cta,
    .betformatics-promotion-action-section .betformatics-desktop-cta,
    a.betformatics-desktop-cta,
    .betformatics-promotion-card a.betformatics-desktop-cta {
        display: none !important;
    }

    /* Show mobile buttons row */
    .betformatics-promotion-buttons-row {
        display: flex !important;
    }
}

/* Desktop: Show desktop elements, hide mobile */
@media (min-width: 601px) {
    .betformatics-cta-mobile-header {
        display: none !important;
    }

    /* Hide mobile-only elements on desktop */
    .betformatics-promotion-buttons-row {
        display: none !important;
    }

    /* Show desktop elements */
    .betformatics-promotion-logo-section,
    .betformatics-promotion-provider-section,
    .betformatics-desktop-cta,
    .betformatics-promotion-review-link {
        display: flex;
    }
}

.betformatics-cta-mobile-name {
    position: absolute;
    top: 20px;
    left: -38px;
    width: 140px;
    padding: 5px 0;
    font-size: 8px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    transform: rotate(-45deg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.betformatics-cta-mobile-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 1;
}

.betformatics-cta-mobile-rating svg {
    flex-shrink: 0;
}

.betformatics-cta-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 60px;
    aspect-ratio: 7 / 3; /* 140:60 - Prevents CLS during lazy load */
}

.betformatics-cta-mobile-logo img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}


.betformatics-promotion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

/* =============================================================================
   CARD INNER - HORIZONTAL LAYOUT
   ============================================================================= */
.betformatics-promotion-card-inner {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

/* =============================================================================
   LOGO
   ============================================================================= */
.betformatics-promotion-logo-section {
    flex-shrink: 0;
}

.betformatics-promotion-logo {
    width: 100px;
    height: 40px;
    aspect-ratio: 5 / 2; /* Prevents CLS during lazy load */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bf-bg-light);
    border-radius: var(--bf-radius-base);
    padding: 6px;
    overflow: hidden;
}

.betformatics-promotion-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* =============================================================================
   PROVIDER
   ============================================================================= */
.betformatics-promotion-provider-section {
    flex-shrink: 0;
    text-align: center;
    min-width: 80px;
}

.betformatics-provider-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--bf-text-primary);
    margin: 0 0 4px 0;
    display: block;
}

.betformatics-promotion-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bf-warning-light);
    color: var(--bf-warning-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.betformatics-promotion-rating svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* =============================================================================
   CONTENT
   ============================================================================= */
.betformatics-promotion-content-section {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.betformatics-promotion-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--bf-primary);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.betformatics-promotion-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.betformatics-promotion-title-link:hover {
    color: var(--bf-primary-hover);
    text-decoration: underline;
}

.betformatics-promotion-subtitle {
    font-size: 13px;
    color: var(--bf-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Welcome cards: larger title/subtitle due to removed name/rating */
.betformatics-welcome-card .betformatics-promotion-title {
    font-size: 17px;
}

.betformatics-welcome-card .betformatics-promotion-subtitle {
    font-size: 14px;
}

/* =============================================================================
   WELCOME BONUS DESKTOP LAYOUT - Compact design for sidebar containers
   Logo header on top, content + button in row below, collapsible terms
   ============================================================================= */
@media (min-width: 601px) {
    /* Welcome bonus wrapper: use CSS Grid for compact layout */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-card-inner,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-card-inner {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto auto !important;
        grid-template-areas:
            "logo logo"
            "content button"
            "terms terms" !important;
        align-items: center !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    /* Logo section - compact header bar with brand color from inline style */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-logo-section,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-logo-section {
        grid-area: logo !important;
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 16px !important;
        border-bottom: 1px solid #e5e7eb !important;
        /* background-color comes from inline style (brandfarve) */
    }

    .betformatics-welcome-bonus-wrapper .betformatics-promotion-logo,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-logo {
        width: 110px !important;
        height: 42px !important;
        padding: 6px !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    /* Content section - left side */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-content-section,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-content-section {
        grid-area: content !important;
        padding: 12px 12px 12px 16px !important;
        text-align: left !important;
        min-width: 0 !important;
    }

    /* Title - compact, allow wrapping */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-title,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-title {
        font-size: 15px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        margin-bottom: 2px !important;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-promotion-subtitle,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-subtitle {
        font-size: 12px !important;
        line-height: 1.3 !important;
        color: #666 !important;
    }

    /* Action/button section - right side */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-action-section,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-action-section {
        grid-area: button !important;
        padding: 12px 16px 12px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    /* Smaller button for compact layout */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-cta-button,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-cta-button {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    /* Terms - full width at bottom, collapsible */
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-terms,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-terms {
        grid-area: terms !important;
        width: 100% !important;
        border-top: 1px solid #eee !important;
        padding: 8px 12px !important;
        margin: 0 !important;
    }

    /* Enable collapsible terms on desktop for welcome bonus (sidebar) */
    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible {
        position: relative;
        padding-right: 24px;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible .betformatics-terms-preview {
        display: block;
        text-align: left;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible .betformatics-terms-short {
        display: block !important;
        color: #888;
        font-size: 10px;
        line-height: 1.3;
        font-style: italic;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible .betformatics-terms-short a {
        color: var(--bf-primary);
        text-decoration: underline;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible .betformatics-terms-full {
        display: none !important;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible.is-expanded .betformatics-terms-short {
        display: none !important;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible.is-expanded .betformatics-terms-full {
        display: block !important;
        color: #888;
        font-size: 10px;
        line-height: 1.4;
        font-style: italic;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible.is-expanded .betformatics-terms-full p {
        margin: 0;
    }

    /* Toggle button for desktop */
    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible .betformatics-terms-toggle {
        position: absolute;
        top: 8px;
        right: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        padding: 2px;
        background: transparent !important;
        border: none !important;
        cursor: pointer;
        color: #999;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-toggle:hover {
        color: #666;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-toggle .betformatics-terms-arrow-up {
        display: none;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-toggle .betformatics-terms-arrow-down {
        display: block;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible.is-expanded .betformatics-terms-toggle .betformatics-terms-arrow-up {
        display: block;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible.is-expanded .betformatics-terms-toggle .betformatics-terms-arrow-down {
        display: none;
    }
}

/* =============================================================================
   ACTION SECTION
   ============================================================================= */
.betformatics-promotion-action-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

/* =============================================================================
   CTA BUTTON - with !important to override WP/Elementor
   ============================================================================= */
.betformatics-promotion-card a.betformatics-promotion-cta-button,
a.betformatics-promotion-cta-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    background-color: var(--bf-primary, #1848A0) !important;
    color: var(--bf-white, #ffffff) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 8px 16px !important;
    border-radius: var(--bf-radius-sm, 6px) !important;
    transition: background-color var(--bf-transition-base, 0.2s ease), transform var(--bf-transition-base, 0.2s ease) !important;
    white-space: nowrap !important;
    border: none !important;
    cursor: pointer !important;
}

.betformatics-promotion-card a.betformatics-promotion-cta-button:hover,
a.betformatics-promotion-cta-button:hover {
    background-color: var(--bf-primary-hover, #0f3470) !important;
    color: var(--bf-white, #ffffff) !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

.betformatics-promotion-card a.betformatics-promotion-cta-button:visited,
a.betformatics-promotion-cta-button:visited {
    color: var(--bf-white, #ffffff) !important;
}

.betformatics-promotion-card a.betformatics-promotion-cta-button:focus,
a.betformatics-promotion-cta-button:focus {
    color: var(--bf-white, #ffffff) !important;
    outline: 2px solid var(--bf-primary, #1848A0) !important;
    outline-offset: 2px !important;
}

.betformatics-promotion-card a.betformatics-promotion-cta-button:active,
a.betformatics-promotion-cta-button:active {
    transform: translateY(0) !important;
}

.betformatics-promotion-cta-button svg {
    width: 14px;
    height: 14px;
}

/* Desktop CTA: Show on desktop, hide on mobile (must come after base button rules) */
@media (max-width: 600px) {
    .betformatics-desktop-cta,
    a.betformatics-desktop-cta,
    .betformatics-promotion-card a.betformatics-desktop-cta,
    a.betformatics-promotion-cta-button.betformatics-desktop-cta {
        display: none !important;
    }
}

@media (min-width: 601px) {
    a.betformatics-desktop-cta,
    .betformatics-promotion-card a.betformatics-desktop-cta,
    a.betformatics-promotion-cta-button.betformatics-desktop-cta {
        display: inline-flex !important;
    }
}

/* =============================================================================
   REVIEW LINK - "Anmeldelse" link below button (Desktop)
   ============================================================================= */
.betformatics-promotion-review-link {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bf-primary) !important;
    text-decoration: none !important;
    text-align: center;
    transition: color var(--bf-transition-base);
}

.betformatics-promotion-review-link:hover {
    color: var(--bf-primary-hover) !important;
    text-decoration: underline !important;
}

.betformatics-promotion-review-link:visited {
    color: var(--bf-primary) !important;
}

/* =============================================================================
   BUTTONS ROW - Mobile horizontal layout
   ============================================================================= */
.betformatics-promotion-buttons-row {
    display: none; /* Hidden by default, shown on mobile via media query */
    gap: 8px;
    width: 100%;
}

/* Review button - outline style (mobile only, used in buttons-row) */
.betformatics-promotion-card a.betformatics-promotion-review-button,
a.betformatics-promotion-review-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    background-color: transparent !important;
    color: var(--bf-primary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 10px 16px !important;
    border-radius: var(--bf-radius-sm) !important;
    border: 2px solid var(--bf-primary) !important;
    transition: background-color var(--bf-transition-base), color var(--bf-transition-base) !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

.betformatics-promotion-card a.betformatics-promotion-review-button:hover,
a.betformatics-promotion-review-button:hover {
    background-color: var(--bf-primary) !important;
    color: var(--bf-white) !important;
    text-decoration: none !important;
}

.betformatics-promotion-card a.betformatics-promotion-review-button:visited,
a.betformatics-promotion-review-button:visited {
    color: var(--bf-primary) !important;
}

.betformatics-promotion-card a.betformatics-promotion-review-button:visited:hover,
a.betformatics-promotion-review-button:visited:hover {
    color: var(--bf-white) !important;
}

/* CTA button in buttons row should also flex */
.betformatics-promotion-buttons-row .betformatics-promotion-cta-button {
    flex: 1 !important;
}

/* =============================================================================
   TERMS - INLINE (Desktop: bottom of card, Mobile: below button)
   ============================================================================= */
.betformatics-promotion-terms {
    width: 100%;
    color: #888;
    font-size: 9px;
    line-height: 1.4;
    font-style: italic;
    margin: 0;
    padding: 0;
}

.betformatics-promotion-terms * {
    color: #888;
    font-size: 9px;
    line-height: 1.4;
    font-style: italic;
    margin: 0;
    padding: 0;
}

.betformatics-promotion-terms a {
    color: var(--bf-primary);
    text-decoration: underline;
}

/* Desktop: terms at bottom, full width */
.betformatics-promotion-card-inner > .betformatics-promotion-terms {
    flex-basis: 100%;
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 4px;
}

/* Mobile: terms below button, no border needed */
.betformatics-promotion-action-section .betformatics-promotion-terms {
    text-align: center;
    margin-top: 4px;
}

/* =============================================================================
   MOBILE TOP SECTION (logo + provider side by side)
   ============================================================================= */
.betformatics-promotion-top-section {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.betformatics-promotion-top-section .betformatics-promotion-logo-section {
    flex: 0 0 auto;
}

.betformatics-promotion-top-section .betformatics-promotion-provider-section {
    flex: 1;
    text-align: left;
}

.betformatics-promotion-top-section .betformatics-provider-name {
    font-size: 15px;
}

/* =============================================================================
   MOBILE SPECIFIC - Stack layout
   ============================================================================= */
@media (max-width: 600px) {
    .betformatics-promotion-card-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }

    .betformatics-promotion-content-section {
        text-align: center;
    }

    .betformatics-promotion-cta-button {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    .betformatics-promotion-action-section {
        width: 100%;
    }
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.betformatics-promotions-empty {
    padding: 30px 15px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    .betformatics-promotion-card,
    .betformatics-promotion-cta-button {
        transition: none;
    }
}

/* =============================================================================
   PAGE BUILDER COMPATIBILITY
   ============================================================================= */
.elementor-widget-container .betformatics-promotions-wrapper,
.elementor-element .betformatics-promotions-wrapper,
.wp-block .betformatics-promotions-wrapper {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

/* =============================================================================
   SKELETON LOADING STATES
   ============================================================================= */
.betformatics-promotions-ajax-wrapper {
    min-height: 100px;
}

.betformatics-promotions-loading .betformatics-skeleton-card {
    pointer-events: none;
}

.betformatics-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: betformatics-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.betformatics-skeleton-logo {
    width: 100px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 4px;
}

.betformatics-skeleton-text {
    height: 14px;
    background: #f0f0f0;
    border-radius: 3px;
}

.betformatics-skeleton-button {
    width: 100px;
    height: 36px;
    background: #e0e0e0;
    border-radius: 4px;
}

@keyframes betformatics-skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade in animation when content loads */
.betformatics-promotions-loaded .betformatics-promotions-wrapper {
    animation: betformatics-fade-in 0.3s ease-out;
}

@keyframes betformatics-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hide noscript content when JS is enabled */
.betformatics-promotions-ajax-wrapper + noscript {
    display: none;
}

/* =============================================================================
   COLLAPSIBLE TERMS (Mobile Only)
   ============================================================================= */

/* Desktop: Always show full terms, hide toggle and short text */
.betformatics-terms-collapsible .betformatics-terms-preview {
    display: block;
}

.betformatics-terms-collapsible .betformatics-terms-short {
    display: none;
}

.betformatics-terms-collapsible .betformatics-terms-full {
    display: block;
}

.betformatics-terms-collapsible .betformatics-terms-toggle {
    display: none;
}

/* Desktop: Override expanded state to always show full terms */
.betformatics-terms-collapsible.is-expanded .betformatics-terms-short {
    display: none;
}

.betformatics-terms-collapsible.is-expanded .betformatics-terms-full {
    display: block;
}

@media (max-width: 600px) {
    /* Add top border for separation on mobile */
    .betformatics-terms-collapsible {
        position: relative !important;
        margin-top: 8px;
        padding-top: 6px;
        padding-right: 30px; /* Space for toggle button */
        border-top: 1px solid #eee;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .betformatics-terms-collapsible .betformatics-terms-preview {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
        overflow: visible !important; /* Allow toggle button to show */
        position: relative !important; /* Ensure child absolute positioning works */
    }

    .betformatics-terms-collapsible .betformatics-terms-short {
        display: block;
        color: #888;
        font-size: 9px;
        line-height: 1.3;
        font-style: italic;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .betformatics-terms-collapsible .betformatics-terms-short a {
        color: var(--bf-primary);
        text-decoration: underline;
    }

    /* Full terms hidden by default */
    .betformatics-terms-collapsible .betformatics-terms-full {
        display: none;
    }

    /* When expanded, show full terms replacing short text */
    .betformatics-terms-collapsible.is-expanded .betformatics-terms-short {
        display: none;
    }

    .betformatics-terms-collapsible.is-expanded .betformatics-terms-full {
        display: block;
        color: #888;
        font-size: 9px;
        line-height: 1.4;
        font-style: italic;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .betformatics-terms-collapsible.is-expanded .betformatics-terms-full p {
        margin: 0;
    }

    /* Toggle button - positioned at right, aligned with terms text */
    .betformatics-terms-collapsible .betformatics-terms-toggle {
        position: absolute !important;
        top: 4px !important; /* Align with terms text */
        right: 0 !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important;
        height: 20px !important; /* Match text line height */
        min-width: 28px !important;
        min-height: 20px !important;
        padding: 4px !important;
        background: transparent !important;
        border: none !important;
        border-radius: 4px !important;
        outline: none !important;
        box-shadow: none !important;
        cursor: pointer !important;
        color: #888 !important;
        transition: color 0.2s ease;
        z-index: 100 !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        pointer-events: auto !important;
    }

    .betformatics-terms-toggle:hover,
    .betformatics-terms-toggle:focus,
    .betformatics-terms-toggle:active {
        background: rgba(0, 0, 0, 0.1) !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        color: #333 !important;
    }

    /* Arrow SVGs inside toggle button - use flex display for proper alignment */
    .betformatics-terms-toggle svg {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        min-height: 16px !important;
        fill: currentColor !important;
        flex-shrink: 0 !important;
        color: inherit !important;
        pointer-events: none !important; /* Let clicks pass through to button */
    }

    .betformatics-terms-toggle svg path {
        fill: currentColor !important;
        pointer-events: none !important; /* Let clicks pass through to button */
    }

    /* Default state: show down arrow, hide up arrow */
    .betformatics-terms-toggle .betformatics-terms-arrow-up {
        display: none !important;
        position: absolute !important;
        visibility: hidden !important;
    }

    .betformatics-terms-toggle .betformatics-terms-arrow-down {
        display: flex !important;
        position: static !important;
        visibility: visible !important;
    }

    /* Expanded state: show up arrow, hide down arrow */
    .betformatics-terms-collapsible.is-expanded .betformatics-terms-toggle .betformatics-terms-arrow-up {
        display: flex !important;
        position: static !important;
        visibility: visible !important;
    }

    .betformatics-terms-collapsible.is-expanded .betformatics-terms-toggle .betformatics-terms-arrow-down {
        display: none !important;
        position: absolute !important;
        visibility: hidden !important;
    }
}

/* =============================================================================
   WELCOME BONUS & ANMELDELSE KAMPAGNER - FIXED WIDTH (Elementor Compatible)

   These shortcodes render inside Elementor widgets. The cards must maintain
   consistent width regardless of content (collapsed vs expanded terms).
   Using highly specific selectors to avoid conflicts.
   ============================================================================= */

/* Force the wrapper to be a block-level element taking full width */
.betformatics-welcome-bonus-wrapper,
.betformatics-anmeldelse-kampagner {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Container must also be full width */
.betformatics-welcome-bonus-wrapper > .betformatics-promotions-container,
.betformatics-anmeldelse-kampagner > .betformatics-promotions-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Cards must take full container width - critical for fixed width */
.betformatics-welcome-bonus-wrapper .betformatics-promotion-card,
.betformatics-anmeldelse-kampagner .betformatics-promotion-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

/* Card inner must also respect full width */
.betformatics-welcome-bonus-wrapper .betformatics-promotion-card-inner,
.betformatics-anmeldelse-kampagner .betformatics-promotion-card-inner {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Content section must not push card wider */
.betformatics-welcome-bonus-wrapper .betformatics-promotion-content-section,
.betformatics-anmeldelse-kampagner .betformatics-promotion-content-section {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Terms section must not push card wider */
.betformatics-welcome-bonus-wrapper .betformatics-promotion-terms,
.betformatics-anmeldelse-kampagner .betformatics-promotion-terms {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Full terms text must wrap properly */
.betformatics-welcome-bonus-wrapper .betformatics-terms-full,
.betformatics-anmeldelse-kampagner .betformatics-terms-full {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

/* Elementor specific overrides - force parent containers to be full width */
.elementor-widget-container .betformatics-welcome-bonus-wrapper,
.elementor-widget-container .betformatics-anmeldelse-kampagner {
    display: block !important;
    width: 100% !important;
}

/* Force Elementor widget container to be full width when containing our shortcodes */
.elementor-widget:has(.betformatics-welcome-bonus-wrapper),
.elementor-widget:has(.betformatics-anmeldelse-kampagner) {
    width: 100% !important;
}

.elementor-widget:has(.betformatics-welcome-bonus-wrapper) > .elementor-widget-container,
.elementor-widget:has(.betformatics-anmeldelse-kampagner) > .elementor-widget-container {
    width: 100% !important;
    display: block !important;
}

/* Mobile specific for these wrappers */
@media (max-width: 600px) {
    .betformatics-welcome-bonus-wrapper .betformatics-promotion-card,
    .betformatics-anmeldelse-kampagner .betformatics-promotion-card {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .betformatics-welcome-bonus-wrapper .betformatics-terms-collapsible,
    .betformatics-anmeldelse-kampagner .betformatics-terms-collapsible {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Force Elementor parents to be full width on mobile */
    .elementor-widget:has(.betformatics-welcome-bonus-wrapper),
    .elementor-widget:has(.betformatics-anmeldelse-kampagner),
    .elementor-widget:has(.betformatics-welcome-bonus-wrapper) > .elementor-widget-container,
    .elementor-widget:has(.betformatics-anmeldelse-kampagner) > .elementor-widget-container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =============================================================================
   CENTERED LAYOUT WITH MAX WIDTH - Welcome Bonus Shortcode Only
   ============================================================================= */
.betformatics-welcome-bonus-wrapper {
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* =============================================================================
   AJAX LOADING SKELETON - Animated placeholder for fresh content loading
   ============================================================================= */
.bf-ajax-loader {
    min-height: 200px;
}

.bf-skeleton-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bf-skeleton-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.bf-skeleton-card .betformatics-promotion-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

/* Skeleton placeholder elements */
.bf-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bf-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.bf-skeleton-logo {
    width: 80px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 6px;
}

.bf-skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bf-skeleton-title {
    width: 60%;
    height: 18px;
}

.bf-skeleton-subtitle {
    width: 80%;
    height: 14px;
}

.bf-skeleton-button {
    width: 100px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 6px;
}

/* Shimmer animation */
@keyframes bf-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Hide skeleton when loaded */
.bf-ajax-loaded .bf-skeleton-grid {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .bf-skeleton-card .betformatics-promotion-card-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .bf-skeleton-logo {
        width: 100%;
        height: 60px;
    }

    .bf-skeleton-button {
        width: 100%;
    }
}
