/**
 * Content Shortcodes Styles
 *
 * Styles for: bf_compare, bf_chart, bf_prediction, bf_form
 */

/* ============================================================================
   VISUALLY HIDDEN (SEO/Accessibility)
   ============================================================================ */

.bf-compare__data-table,
.bf-prediction__seo-text,
.bf-form__seo-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================================
   COMPARISON BOX
   ============================================================================ */

.bf-compare {
    position: relative;
    margin: 1.5em 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bf-compare__header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.bf-compare__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

/* Semantic list for comparison items */
.bf-compare__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.bf-compare__item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 120px;
    gap: 12px;
    padding: 14px 20px;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.bf-compare__item:last-child {
    border-bottom: none;
}

.bf-compare__item:hover {
    background: #f9fafb;
}

.bf-compare__item--featured {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.bf-compare__item--featured:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.bf-compare__cell--name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bf-compare__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
}

.bf-compare__name {
    font-weight: 600;
    color: #1f2937;
}

.bf-compare__cell--rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bf-compare__stars {
    display: flex;
    gap: 2px;
}

.bf-star {
    width: 14px;
    height: 14px;
}

.bf-star--full {
    color: #f59e0b;
}

.bf-compare__rating-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

.bf-compare__odds {
    font-weight: 700;
    color: #10b981;
    font-size: 1rem;
}

.bf-compare__bonus {
    font-weight: 600;
    color: #3b82f6;
}

.bf-compare__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #10b981;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s, transform 0.2s;
}

.bf-compare__btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Comparison Mobile */
@media (max-width: 768px) {
    .bf-compare__item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
    }

    .bf-compare__cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .bf-compare__cell::before {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #6b7280;
    }

    .bf-compare__cell--rating::before { content: "Rating"; }
    .bf-compare__cell--odds::before { content: "Odds"; }
    .bf-compare__cell--bonus::before { content: "Bonus"; }

    .bf-compare__cell--name {
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 10px;
        margin-bottom: 4px;
    }

    .bf-compare__cell--action {
        margin-top: 8px;
    }

    .bf-compare__btn {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================================================
   CHARTS
   ============================================================================ */

.bf-chart {
    position: relative;
    margin: 1.5em auto;
    padding: 24px 32px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 700px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bf-chart__title {
    margin: 0 0 24px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

/* Hidden data table for accessibility and SEO */
.bf-chart__data-table {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Horizontal Bar Chart */
.bf-chart--horizontal .bf-chart__bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bf-chart--horizontal .bf-chart__bar-group {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    align-items: center;
}

.bf-chart--horizontal .bf-chart__bar-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    text-align: right;
}

.bf-chart--horizontal .bf-chart__bar-track {
    height: 32px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.bf-chart--horizontal .bf-chart__bar-fill {
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    min-width: 50px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.bf-chart--horizontal .bf-chart__bar-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Vertical Bar Chart */
.bf-chart--bar .bf-chart__bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    height: 220px;
    padding: 20px 10px 0;
}

.bf-chart--bar .bf-chart__bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 60px;
    max-width: 100px;
}

.bf-chart--bar .bf-chart__bar-track {
    width: 48px;
    height: 180px;
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.bf-chart--bar .bf-chart__bar-fill {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    min-height: 36px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.bf-chart--bar .bf-chart__bar-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bf-chart--bar .bf-chart__bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
}

/* Pie Chart */
.bf-chart__pie-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 10px 0;
}

.bf-chart__pie {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    overflow: visible;
}

/* SVG Pie Slice Hover Effects */
.bf-chart__slice {
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.25s ease,
                opacity 0.25s ease;
    cursor: pointer;
}

.bf-chart__slice:hover {
    transform: scale(1.08);
    filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Slice highlight states (via JavaScript) */
.bf-chart__slice.is-highlighted {
    transform: scale(1.08);
    filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.bf-chart__slice.is-dimmed {
    opacity: 0.5;
    transform: scale(0.98);
}

/* Semantic definition list for chart legend */
.bf-chart__legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.bf-chart__legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    margin: -6px -10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.bf-chart__legend-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

/* Highlight states for legend items */
.bf-chart__legend-item.is-highlighted {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(6px);
}

.bf-chart__legend-item.is-dimmed {
    opacity: 0.5;
}

.bf-chart__legend-term {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin: 0;
}

.bf-chart__legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bf-chart__legend-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.bf-chart__legend-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    min-width: 50px;
    text-align: right;
}

/* Chart Mobile */
@media (max-width: 640px) {
    .bf-chart {
        padding: 16px 20px;
        margin: 1em auto;
    }

    .bf-chart__title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .bf-chart--horizontal .bf-chart__bar-group {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bf-chart--horizontal .bf-chart__bar-label {
        text-align: left;
        font-size: 0.85rem;
    }

    .bf-chart--horizontal .bf-chart__bar-track {
        height: 28px;
    }

    .bf-chart--bar .bf-chart__bars {
        gap: 16px;
        height: 180px;
    }

    .bf-chart--bar .bf-chart__bar-track {
        width: 40px;
        height: 140px;
    }

    .bf-chart--bar .bf-chart__bar-group {
        min-width: 50px;
    }

    .bf-chart--bar .bf-chart__bar-label {
        font-size: 0.75rem;
    }

    .bf-chart__pie-container {
        flex-direction: column;
        gap: 24px;
    }

    .bf-chart__pie {
        width: 150px;
        height: 150px;
    }

    .bf-chart__legend {
        align-items: center;
    }

    .bf-chart__legend-item {
        width: 100%;
        max-width: 220px;
    }
}


/* ============================================================================
   PREDICTION CARD
   ============================================================================ */

.bf-prediction {
    position: relative;
    margin: 1.5em 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bf-prediction__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #fff;
}

/* Heading styled to look inline, not block */
.bf-prediction__match {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.bf-prediction__icon {
    opacity: 0.7;
}

.bf-prediction__date {
    font-size: 0.85rem;
    opacity: 0.8;
}

.bf-prediction__body {
    padding: 20px;
}

.bf-prediction__tip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.bf-prediction__tip-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.bf-prediction__tip-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
}

/* Semantic definition list for prediction metadata */
.bf-prediction__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
}

.bf-prediction__meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bf-prediction__meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin: 0;
}

.bf-prediction__meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.bf-prediction__odds {
    color: #10b981;
    font-size: 1.1rem;
}

.bf-prediction__confidence {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Semantic meter element for confidence */
.bf-prediction__confidence-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    border: none;
    appearance: none;
    -webkit-appearance: none;
}

/* Webkit (Chrome, Safari) meter styling */
.bf-prediction__confidence-bar::-webkit-meter-bar {
    background: #e5e7eb;
    border-radius: 4px;
    border: none;
}

.bf-prediction__confidence-bar::-webkit-meter-optimum-value {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
}

/* Firefox meter styling */
.bf-prediction__confidence-bar::-moz-meter-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
}

/* Fallback for browsers that don't support meter */
.bf-prediction__confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bf-prediction__confidence-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #10b981;
}

.bf-prediction__result {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Semantic mark element for result highlight */
.bf-prediction__result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
}

.bf-prediction__result-badge--won {
    background: #d1fae5;
    color: #065f46;
}

.bf-prediction__result-badge--lost {
    background: #fee2e2;
    color: #991b1b;
}

.bf-prediction__result-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

.bf-prediction__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #3b82f6 !important;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.bf-prediction__link:hover {
    background: #f3f4f6;
}

/* Result state styling */
.bf-prediction--won {
    border-color: #10b981;
}

.bf-prediction--won .bf-prediction__header {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

.bf-prediction--lost {
    border-color: #ef4444;
}

.bf-prediction--lost .bf-prediction__header {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
}

/* Prediction Mobile */
@media (max-width: 480px) {
    .bf-prediction__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bf-prediction__meta {
        grid-template-columns: 1fr 1fr;
    }
}


/* ============================================================================
   FORM/STREAK DISPLAY
   ============================================================================ */

/* Inline form display - works within text */
.bf-form {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0 2px;
    vertical-align: middle;
    line-height: 1;
}

.bf-form__team {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0;
}

/* Semantic ordered list for form results */
.bf-form__results {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bf-form__result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    color: #fff;
}

/* Abbreviation styling */
.bf-form__result abbr {
    text-decoration: none;
    cursor: help;
}

.bf-form__result--w {
    background: #10b981;
}

.bf-form__result--d {
    background: #6b7280;
}

.bf-form__result--l {
    background: #ef4444;
}

.bf-form__result--n {
    background: #d1d5db;
    color: #6b7280;
}

/* Form Mobile */
@media (max-width: 480px) {
    .bf-form {
        flex-wrap: wrap;
    }

    .bf-form__result {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}


/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .bf-compare,
    .bf-chart,
    .bf-prediction,
    .bf-form {
        background: #1f2937;
        border-color: #374151;
    }

    .bf-compare__header {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border-color: #4b5563;
    }

    .bf-compare__title,
    .bf-chart__title {
        color: #f9fafb;
    }

    .bf-compare__item {
        border-color: #374151;
    }

    .bf-compare__item:hover {
        background: #374151;
    }

    .bf-compare__item--featured {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    }

    .bf-compare__name {
        color: #f9fafb;
    }

    .bf-chart--horizontal .bf-chart__bar-track,
    .bf-chart--bar .bf-chart__bar-track {
        background: #374151;
    }

    .bf-chart--horizontal .bf-chart__bar-label,
    .bf-chart--bar .bf-chart__bar-label {
        color: #9ca3af;
    }

    .bf-chart__legend-label {
        color: #d1d5db;
    }

    .bf-chart__legend-value {
        color: #f9fafb;
    }

    .bf-prediction__body {
        background: #1f2937;
    }

    .bf-prediction__tip {
        border-color: #374151;
    }

    .bf-prediction__meta-value {
        color: #f9fafb;
    }

    .bf-prediction__result,
    .bf-prediction__link {
        background: #374151;
        border-color: #4b5563;
    }

    .bf-prediction__link {
        color: #60a5fa !important;
    }

    .bf-prediction__confidence-bar {
        background: #374151;
    }

    .bf-form {
        background: #374151;
        border-color: #4b5563;
    }

    .bf-form__team {
        color: #d1d5db;
    }
}
