/**
 * Betformatics Table Shortcode Styles
 *
 * Styled, responsive HTML table component.
 *
 * Dependencies: betformatics-variables (loaded via PHP)
 *
 * @package Betformatics
 */

/* =============================================================================
   RESET - Prevent theme interference
   ============================================================================= */
.bf-table-wrapper,
.bf-table-wrapper *,
.bf-table,
.bf-table * {
    box-sizing: border-box;
}

/* =============================================================================
   WRAPPER - Enables horizontal scroll on mobile
   ============================================================================= */
.bf-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
}

/* =============================================================================
   BASE TABLE
   ============================================================================= */
.bf-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--bf-white, #ffffff);
    border: 1px solid var(--bf-border, #e5e7eb);
    border-radius: var(--bf-radius-lg, 12px);
    overflow: hidden;
    font-family: var(--bf-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 0.95rem;
}

/* =============================================================================
   CELLS
   ============================================================================= */
.bf-table th,
.bf-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--bf-border, #e5e7eb);
    background-clip: padding-box;
}

/* Header cells */
.bf-table th {
    background: var(--bf-primary, #1a1a2e) !important;
    color: var(--bf-white, #ffffff) !important;
    font-weight: var(--bf-font-weight-semibold, 600);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Body cells */
.bf-table td {
    color: var(--bf-text-primary, #1f2937);
}

/* Remove border from last row */
.bf-table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================================================
   STRIPED ROWS
   ============================================================================= */
.bf-table--striped tbody tr:nth-child(even) {
    background: var(--bf-gray-50, #f9fafb);
}

/* =============================================================================
   HOVER EFFECT
   ============================================================================= */
.bf-table--hover tbody tr {
    transition: background var(--bf-transition-fast, 0.15s ease);
}

.bf-table--hover tbody tr:hover {
    background: #f0f4ff;
}

/* =============================================================================
   BORDERED CELLS
   ============================================================================= */
.bf-table--bordered th,
.bf-table--bordered td {
    border: 1px solid var(--bf-border, #e5e7eb);
}

/* =============================================================================
   COMPACT MODE
   ============================================================================= */
.bf-table--compact th,
.bf-table--compact td {
    padding: 10px 12px;
    font-size: 0.9rem;
}

/* =============================================================================
   HIGHLIGHT ROW
   ============================================================================= */
.bf-table__row--highlight {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%) !important;
    border-left: 3px solid var(--bf-warning, #f59e0b);
}

.bf-table__row--highlight td {
    font-weight: var(--bf-font-weight-medium, 500);
}

/* =============================================================================
   LINKS IN TABLE
   ============================================================================= */
.bf-table a {
    color: #3b82f6;
    text-decoration: none;
    transition: color var(--bf-transition-fast, 0.15s ease);
}

.bf-table a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* =============================================================================
   MOBILE RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
    .bf-table {
        font-size: 0.875rem;
    }

    .bf-table th,
    .bf-table td {
        padding: 10px 12px;
    }

    .bf-table--compact th,
    .bf-table--compact td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .bf-table th {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .bf-table th,
    .bf-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .bf-table--compact th,
    .bf-table--compact td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

/* =============================================================================
   PAGE BUILDER COMPATIBILITY
   ============================================================================= */
.elementor-widget-container .bf-table-wrapper,
.elementor-element .bf-table-wrapper,
.wp-block .bf-table-wrapper {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    .bf-table--hover tbody tr,
    .bf-table a {
        transition: none !important;
    }
}
