/* =============================================================================
   BETFORMATICS - FEATURED BOOKMAKER CARDS
   Two-column layout for "Nyeste bookmaker" and "Månedens bookmaker"

   Dependencies: betformatics-variables (loaded via PHP)
   ============================================================================= */

/* =============================================================================
   CONTAINER
   ============================================================================= */
.bf-featured-bookmakers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bf-gap-base);
    width: 100%;
    margin: var(--bf-spacing-lg) 0;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .bf-featured-bookmakers {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   CARD - Horizontal layout with logo left, content right
   ============================================================================= */
.bf-featured-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    border-radius: var(--bf-radius-lg);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--bf-white);
    overflow: visible;
    box-shadow: var(--bf-shadow-lg);
}

/* =============================================================================
   RIBBON LABEL - Wraps around corner
   ============================================================================= */
.bf-featured-label {
    position: absolute;
    top: var(--bf-spacing-base);
    left: -8px;
    display: inline-block;
    padding: var(--bf-spacing-sm) var(--bf-spacing-base) var(--bf-spacing-sm) var(--bf-spacing-md);
    font-size: var(--bf-font-size-sm);
    font-weight: var(--bf-font-weight-bold);
    text-transform: none;
    letter-spacing: 0.3px;
    color: #1a1a2e;
    background: var(--bf-success);
    z-index: 3;
    /* Right side angled cut */
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

/* Shadow/fold effect behind the ribbon - positioned on card */
.bf-featured-card::before {
    content: '';
    position: absolute;
    top: 46px; /* top: 16px + label height (~30px) */
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 0;
    border-color: var(--bf-success-dark) transparent transparent transparent;
    z-index: 2;
}

/* =============================================================================
   BACKGROUND IMAGE - Full card coverage
   ============================================================================= */
.bf-featured-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--bf-radius-lg);
}

/* Nyeste bookmaker - Soccer field image */
.bf-featured-card--nyeste::after {
    background-image: url('../images/soccer-field.png');
}

/* Nyeste bookmaker - Yellow brand color for label, title, button */
/* Higher specificity to override contrast variants */
.bf-featured-card.bf-featured-card--nyeste .bf-featured-label {
    background: #FFCC00;
    color: #1a1a2e;
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-bonus-title {
    color: #FFCC00;
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-bonus-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-cta {
    background: #FFCC00;
    color: #1a1a2e !important;
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-cta:hover {
    background: #e6b800;
    color: #1a1a2e !important;
}

/* Nyeste - ribbon fold darker yellow */
.bf-featured-card.bf-featured-card--nyeste::before {
    border-color: #b38f00 transparent transparent transparent;
}

/* Nyeste - ensure terms/benefits match dark theme */
.bf-featured-card.bf-featured-card--nyeste .bf-featured-benefits li {
    color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-benefits li svg {
    color: #4ade80;
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-terms,
.bf-featured-card.bf-featured-card--nyeste .bf-featured-terms * {
    color: rgba(255, 255, 255, 0.5);
}

.bf-featured-card.bf-featured-card--nyeste .bf-featured-terms a {
    color: rgba(255, 255, 255, 0.7);
}

/* Månedens bookmaker - Trophy image */
.bf-featured-card--maanedens::after {
    background-image: url('../images/trophy.png');
}

/* Månedens bookmaker - Turquoise color for title */
/* Higher specificity to override contrast variants */
.bf-featured-card.bf-featured-card--maanedens .bf-featured-bonus-title {
    color: #4ade80;
}

/* =============================================================================
   LEFT SIDE - Logo Area (fixed position below label)
   ============================================================================= */
.bf-featured-logo-area {
    position: absolute;
    top: 71px; /* Label top (16px) + label height (~30px) + 25px gap */
    left: 0;
    width: 140px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 20px;
    z-index: 1;
}

/* =============================================================================
   RIGHT SIDE - Content Area
   ============================================================================= */
.bf-featured-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-evenly;
    padding: 20px 20px 20px 166px; /* 140px logo area + 26px gap */
    z-index: 1;
}

/* =============================================================================
   LOGO (in left area)
   ============================================================================= */
.bf-featured-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 120px;
    width: 100%;
}

.bf-featured-logo img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* =============================================================================
   BONUS INFO
   ============================================================================= */
.bf-featured-bonus {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: var(--bf-spacing-sm);
    margin-bottom: var(--bf-spacing-sm);
}

.bf-featured-bonus-title {
    font-size: var(--bf-font-size-lg);
    font-weight: var(--bf-font-weight-bold);
    color: var(--bf-star);
    line-height: var(--bf-line-height-tight);
    margin-bottom: var(--bf-spacing-sm);
}

.bf-featured-bonus-subtitle {
    font-size: var(--bf-font-size-sm);
    font-weight: var(--bf-font-weight-normal);
    color: rgba(255, 255, 255, 0.8);
    line-height: var(--bf-line-height-tight);
}

/* =============================================================================
   CTA BUTTON
   ============================================================================= */
.bf-featured-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bf-gap-sm);
    padding: var(--bf-btn-padding-y) var(--bf-btn-padding-x);
    font-size: var(--bf-font-size-base);
    font-weight: var(--bf-font-weight-semibold);
    color: var(--bf-white) !important;
    background: var(--bf-success);
    border: none;
    border-radius: var(--bf-radius-md);
    text-decoration: none !important;
    cursor: pointer;
    transition: all var(--bf-transition-base);
    margin-right: var(--bf-spacing-sm);
}

.bf-featured-cta:hover {
    background: var(--bf-success-dark);
    transform: translateY(-2px);
    color: var(--bf-white) !important;
    text-decoration: none !important;
}

.bf-featured-cta:visited {
    color: var(--bf-white) !important;
}

.bf-featured-cta svg {
    flex-shrink: 0;
}

/* =============================================================================
   BENEFITS LIST
   ============================================================================= */
.bf-featured-benefits {
    list-style: none;
    margin: 0 0 var(--bf-spacing-md) 0;
    padding: 0;
    text-align: left;
    width: 100%;
}

.bf-featured-benefits li {
    display: flex;
    align-items: center;
    gap: var(--bf-gap-sm);
    padding: var(--bf-spacing-xs) 0;
    font-size: var(--bf-font-size-sm);
    font-weight: var(--bf-font-weight-medium);
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bf-featured-benefits li:last-child {
    border-bottom: none;
}

.bf-featured-benefits li svg {
    flex-shrink: 0;
    color: var(--bf-success);
    width: 12px;
    height: 12px;
}

/* =============================================================================
   TERMS - Full width at bottom
   ============================================================================= */
.bf-featured-terms {
    width: 100%;
    font-size: var(--bf-font-size-xs);
    line-height: var(--bf-line-height-normal);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: italic;
    padding: var(--bf-spacing-sm) var(--bf-spacing-base);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.bf-featured-terms * {
    font-size: var(--bf-font-size-xs);
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    padding: 0;
}

.bf-featured-terms a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
}

/* =============================================================================
   RESPONSIVE - Tablet
   ============================================================================= */
@media (max-width: 900px) {
    .bf-featured-logo-area {
        width: 120px;
        padding: 0 16px;
        top: 71px;
    }

    .bf-featured-content {
        padding-left: 146px; /* 120px logo + 26px gap */
    }

    .bf-featured-logo {
        max-width: 100px;
    }

    .bf-featured-logo img {
        max-height: 70px;
    }
}

/* =============================================================================
   RESPONSIVE - Mobile
   ============================================================================= */
@media (max-width: 480px) {
    .bf-featured-card {
        min-height: 200px;
    }

    /* On mobile, no wrap-around effect - simple badge style */
    .bf-featured-card::before {
        display: none;
    }

    /* Label positioned below title on mobile */
    .bf-featured-label {
        top: 38px; /* Below the title */
        left: 0;
        padding: 5px 10px;
        font-size: 10px;
        clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
        border-radius: 0 0 4px 0;
    }

    /* Logo positioned next to button on mobile */
    .bf-featured-logo-area {
        width: 88px; /* Match button margin-left minus content padding */
        padding: 0;
        top: 100px; /* Vertically aligned with button */
        left: 12px; /* Match content padding */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bf-featured-logo {
        max-width: 70px;
    }

    .bf-featured-logo img {
        max-height: 50px;
    }

    /* Content area restructured for mobile */
    .bf-featured-content {
        padding: 12px 12px 16px 12px; /* Reset padding for new layout */
        align-items: stretch;
    }

    /* Title at top, full width, above the label */
    .bf-featured-bonus {
        margin-bottom: 12px;
    }

    .bf-featured-bonus-title {
        font-size: 15px;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    /* Subtitle positioned above button on mobile */
    .bf-featured-bonus-subtitle {
        position: absolute;
        top: 67px; /* Below label + 5px top margin */
        left: 110px; /* Aligned with button area */
        right: 12px;
        font-size: 11px;
        padding-left: 0;
        margin-bottom: 5px;
    }

    /* CTA and benefits need left margin to avoid logo */
    .bf-featured-cta {
        padding: 8px 16px;
        font-size: 12px;
        margin-left: 100px; /* Clear logo area */
        margin-right: 0;
        margin-top: 40px; /* Space for subtitle above + 5px top margin + 5px bottom margin */
    }

    .bf-featured-benefits {
        margin-left: 100px; /* Clear logo area */
    }

    .bf-featured-benefits li {
        font-size: 11px;
        padding: 3px 0;
    }
}

/* =============================================================================
   LIGHT BACKGROUND VARIANT - For brands with light/white backgrounds
   Ensures WCAG AA contrast compliance
   ============================================================================= */
.bf-featured-card--light {
    /* Keep brand color background, don't force white */
}

.bf-featured-card--light .bf-featured-label {
    background: #1d4ed8;
    color: #ffffff;
}

.bf-featured-card--light::before {
    border-color: #1e40af transparent transparent transparent;
}

.bf-featured-card--light .bf-featured-bonus-title {
    color: #1a1a2e; /* Dark text for light backgrounds */
}

.bf-featured-card--light .bf-featured-bonus-subtitle {
    color: rgba(26, 26, 46, 0.7);
}

.bf-featured-card--light .bf-featured-cta {
    background: #1d4ed8;
    color: #ffffff !important;
}

.bf-featured-card--light .bf-featured-cta:hover {
    background: #1e40af;
    color: #ffffff !important;
}

.bf-featured-card--light .bf-featured-benefits li {
    color: rgba(26, 26, 46, 0.9);
    border-bottom-color: rgba(26, 26, 46, 0.1);
}

.bf-featured-card--light .bf-featured-benefits li svg {
    color: #16a34a;
}

.bf-featured-card--light .bf-featured-terms,
.bf-featured-card--light .bf-featured-terms * {
    color: rgba(26, 26, 46, 0.6);
}

.bf-featured-card--light .bf-featured-terms a {
    color: #1d4ed8;
}

/* =============================================================================
   BRIGHT/COLORED BACKGROUND VARIANT - For brands with bright colored backgrounds
   Ensures WCAG AA contrast compliance
   ============================================================================= */
.bf-featured-card--bright .bf-featured-bonus-title {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bf-featured-card--bright .bf-featured-bonus-subtitle {
    color: rgba(255, 255, 255, 0.95);
}

.bf-featured-card--bright .bf-featured-cta {
    background: #1a1a2e;
    color: #ffffff !important;
}

.bf-featured-card--bright .bf-featured-cta:hover {
    background: #0f0f1a;
    color: #ffffff !important;
}

.bf-featured-card--bright .bf-featured-benefits li {
    color: rgba(255, 255, 255, 0.95);
}

.bf-featured-card--bright .bf-featured-terms,
.bf-featured-card--bright .bf-featured-terms *,
.bf-featured-card--bright .bf-featured-terms a {
    color: rgba(255, 255, 255, 0.8);
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    .bf-featured-cta {
        transition: none;
    }
}
