/**
 * SlotsGamblers Bonus Codes Table - Frontend Styles
 *
 * @package SlotsGamblersBonusCodesTable
 * @version 3.0.1
 */

/* ========================================
   CSS Custom Properties (Variables)
   ======================================== */

:root {
    --sgbct-spacing-md: clamp(0.75rem, 0.9vw, 1rem);
    --sgbct-spacing-lg: clamp(1rem, 1.2vw, 1.5rem);
    --sgbct-spacing-xl: clamp(1.25rem, 1.5vw, 2rem);
    --sgbct-spacing-2xl: clamp(1.75rem, 2vw, 2.5rem);
    --sgbct-radius-xl: clamp(1rem, 1.2vw, 1.5rem);
    --sgbct-purple-primary: #8B5CF6;
    --sgbct-purple-dark: #6D28D9;
    --sgbct-purple-darker: #5B21B6;
    --sgbct-purple-light: #EDE9FE;
    --sgbct-purple-lighter: #DDD6FE;
    --sgbct-green: #10B981;
    --sgbct-orange: #F59E0B;
    --sgbct-gray-50: #F9FAFB;
    --sgbct-gray-200: #E5E7EB;
    --sgbct-gray-500: #6B7280;
    --sgbct-gray-600: #4B5563;
    --sgbct-gray-800: #1F2937;
}

/* ========================================
   Main Container
   ======================================== */

.sgbct-bonus-codes-section {
    background: #ffffff;
    border: 0.0625rem solid var(--sgbct-gray-200);
    border-radius: var(--sgbct-radius-xl);
    padding: 0;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100% !important;
    max-width: 100% !important;
}

/* Full width on large displays (32") */
.elementor-widget-slotsgamblersbonuscodestable {
    width: 100% !important;
    max-width: 100% !important;
}

.elementor-widget-slotsgamblersbonuscodestable .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* ========================================
   Header Section
   ======================================== */

.sgbct-bonus-codes-title {
    font-size: clamp(1.5rem, 1.8vw + 0.5rem, 2rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--sgbct-purple-primary) 0%, var(--sgbct-purple-dark) 50%, var(--sgbct-purple-darker) 100%);
    color: #ffffff;
    margin: 0;
    padding: 2rem var(--sgbct-spacing-2xl) 1rem var(--sgbct-spacing-2xl);
    line-height: 1.3;
    text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
    border-radius: var(--sgbct-radius-xl) var(--sgbct-radius-xl) 0 0;
}

.sgbct-bonus-codes-intro {
    font-size: 0.9375rem;
    background: linear-gradient(135deg, var(--sgbct-purple-primary) 0%, var(--sgbct-purple-dark) 50%, var(--sgbct-purple-darker) 100%);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin: 0;
    padding: 0 var(--sgbct-spacing-2xl) 2rem var(--sgbct-spacing-2xl);
    border-radius: 0 0 var(--sgbct-radius-xl) var(--sgbct-radius-xl);
}

/* ========================================
   Table Wrapper
   ======================================== */

.sgbct-bonus-table-wrapper {
    overflow: hidden;
    border-radius: var(--sgbct-radius-xl);
    border: 0.0625rem solid var(--sgbct-gray-200);
    position: relative;
    margin: var(--sgbct-spacing-2xl);
}

.sgbct-table-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    /* Always show scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--sgbct-purple-primary) var(--sgbct-gray-200);
}

.sgbct-table-scroll-container:active {
    cursor: grabbing;
}

.sgbct-table-scroll-container.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Webkit scrollbar styling - ALWAYS VISIBLE */
.sgbct-table-scroll-container::-webkit-scrollbar {
    height: 14px;
    -webkit-appearance: none;
}

.sgbct-table-scroll-container::-webkit-scrollbar-track {
    background: var(--sgbct-gray-200);
    border-radius: 7px;
    margin: 0 10px;
}

.sgbct-table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--sgbct-purple-primary);
    border-radius: 7px;
    border: 2px solid var(--sgbct-gray-200);
    transition: background 0.3s ease;
    min-width: 50px;
}

.sgbct-table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--sgbct-purple-dark);
}

.sgbct-table-scroll-container::-webkit-scrollbar-thumb:active {
    background: var(--sgbct-purple-darker);
}


/* Scroll hint indicator with hand emoji */
.sgbct-scroll-hint {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.sgbct-scroll-hint.hidden {
    opacity: 0;
    visibility: hidden;
}

.sgbct-scroll-hint-icon {
    font-size: 2rem;
    color: var(--sgbct-purple-primary);
    animation: sgbctScrollHint 2s infinite;
}

@keyframes sgbctScrollHint {
    0%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-10px);
        opacity: 0.6;
    }
}

/* ========================================
   Table Styles
   ======================================== */

.sgbct-bonus-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    table-layout: auto;
}

.sgbct-bonus-table thead {
    background: linear-gradient(135deg, var(--sgbct-purple-light) 0%, var(--sgbct-purple-lighter) 100%);
}

.sgbct-bonus-table th {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--sgbct-gray-800);
    border-bottom: 0.125rem solid var(--sgbct-purple-primary);
    white-space: nowrap;
}

/* First column header centered */
.sgbct-bonus-table th:first-child {
    text-align: center;
    padding-left: 1rem;
}

.sgbct-bonus-table tbody tr {
    border-bottom: 0.0625rem solid var(--sgbct-gray-200);
    transition: background-color 0.3s ease;
}

.sgbct-bonus-table tbody tr:last-child {
    border-bottom: none;
}

.sgbct-bonus-table tbody tr:hover {
    background: var(--sgbct-gray-50);
}

.sgbct-bonus-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--sgbct-gray-600);
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
}

/* First column centered */
.sgbct-bonus-table td:first-child {
    text-align: center;
    padding-left: 1rem;
}

/* ========================================
   Casino Cell
   ======================================== */

.sgbct-casino-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sgbct-casino-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sgbct-casino-icon svg {
    width: 100%;
    height: 100%;
    color: var(--sgbct-purple-primary);
}

.sgbct-casino-name {
    font-weight: 700;
    color: var(--sgbct-gray-800);
    white-space: nowrap;
    overflow: visible;
}

/* ========================================
   Rating Cell
   ======================================== */

.sgbct-rating-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sgbct-rating-stars {
    font-size: 0.875rem;
    line-height: 1;
    display: flex;
    gap: 0.125rem;
}

.sgbct-star {
    width: 0.875rem;
    height: 0.875rem;
    color: #FDB022;
}

.sgbct-star-empty {
    color: #D1D5DB;
}

.sgbct-rating-number {
    font-weight: 700;
    color: var(--sgbct-purple-primary);
    font-size: 0.9375rem;
    line-height: 1;
}

/* ========================================
   Bonus Code
   ======================================== */

.sgbct-bonus-code {
    font-weight: 600;
}

.sgbct-code-badge {
    background: linear-gradient(135deg, var(--sgbct-purple-primary) 0%, var(--sgbct-purple-dark) 100%);
    color: #ffffff;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* ========================================
   Bonus Offer
   ======================================== */

.sgbct-bonus-offer {
    color: var(--sgbct-gray-800);
    font-weight: 600;
    line-height: 1.4;
}

/* ========================================
   Game Type Badges
   ======================================== */

.sgbct-game-badge {
    background: var(--sgbct-green);
    color: #ffffff;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.sgbct-game-badge.sgbct-badge-table {
    background: var(--sgbct-orange);
}

.sgbct-game-badge.sgbct-badge-all {
    background: var(--sgbct-purple-primary);
}

/* ========================================
   Wagering Cell
   ======================================== */

.sgbct-wagering-cell {
    font-weight: 700;
    color: var(--sgbct-gray-500);
}

.sgbct-no-wagering {
    background: var(--sgbct-green);
    color: #ffffff;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

/* ========================================
   Play Button
   ======================================== */

.sgbct-play-cell {
    text-align: center;
}

.sgbct-table-play-button {
    background: linear-gradient(135deg, var(--sgbct-purple-primary) 0%, var(--sgbct-purple-dark) 100%);
    color: #ffffff;
    padding: 0.625rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.75rem rgba(139, 92, 246, 0.3);
}

.sgbct-table-play-button:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #7C3AED 0%, var(--sgbct-purple-darker) 100%);
}

/* ========================================
   Footer Section
   ======================================== */

.sgbct-bonus-table-footer {
    margin: 0 var(--sgbct-spacing-2xl);
    padding-top: var(--sgbct-spacing-lg);
    padding-bottom: var(--sgbct-spacing-2xl);
    border-top: 0.125rem solid var(--sgbct-gray-200);
}

.sgbct-footer-text {
    font-size: 0.875rem;
    color: var(--sgbct-gray-600);
    line-height: 1.6;
    margin-bottom: var(--sgbct-spacing-md);
}

.sgbct-footer-text:last-child {
    margin-bottom: 0;
}

.sgbct-footer-text strong {
    color: var(--sgbct-purple-primary);
    font-weight: 700;
}

/* ========================================
   RESPONSIVE DESIGN - TABLET
   ======================================== */

@media (max-width: 1024px) {
    .sgbct-bonus-codes-title {
        font-size: 1.75rem;
        padding: 1.75rem var(--sgbct-spacing-xl) 0.875rem var(--sgbct-spacing-xl);
    }
    
    .sgbct-bonus-codes-intro {
        font-size: 0.875rem;
        padding: 0 var(--sgbct-spacing-xl) 1.75rem var(--sgbct-spacing-xl);
    }
    
    .sgbct-bonus-table-wrapper {
        margin: var(--sgbct-spacing-xl);
    }
    
    .sgbct-bonus-table-footer {
        margin: 0 var(--sgbct-spacing-xl);
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE (FULL WIDTH)
   ======================================== */


@media (max-width: 768px) {
    /* Mobile - Flexible width, scroll if needed */
    .sgbct-bonus-table {
        width: auto;
        min-width: 0;
        table-layout: auto;
    }
    
    .sgbct-bonus-table th,
    .sgbct-bonus-table td {
        padding: 0.375rem 0.375rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
    
    .sgbct-bonus-table th:first-child,
    .sgbct-bonus-table td:first-child {
        padding-left: 0.5rem;
    }
    
    .sgbct-bonus-table th:last-child,
    .sgbct-bonus-table td:last-child {
        padding-right: 0.5rem;
    }
    
    .sgbct-casino-icon {
        width: 1rem;
        height: 1rem;
    }
    
    .sgbct-casino-cell {
        gap: 0.375rem;
    }
    
    .sgbct-rating-stars {
        font-size: 0.75rem;
    }
    
    .sgbct-rating-number {
        font-size: 0.8125rem;
    }
    
    .sgbct-table-play-button {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .sgbct-code-badge,
    .sgbct-game-badge {
        padding: 0.25rem 0.375rem;
        font-size: 0.6875rem;
        white-space: nowrap;
    }
    
    /* Scroll hint visible */
    .sgbct-scroll-hint {
        width: 60px;
    }
    
    .sgbct-scroll-hint-icon {
        font-size: 1.5rem;
    }
    
    /* Full-width mobile layout - prevent horizontal scroll */
    .elementor-widget-slotsgamblersbonuscodestable {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        left: 0 !important;
        overflow-x: hidden !important;
    }
    
    .elementor-widget-slotsgamblersbonuscodestable .elementor-widget-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    .sgbct-bonus-codes-section {
        border-radius: 0.75rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* Header - compact padding on mobile with equal sides */
    .sgbct-bonus-codes-title {
        font-size: 1.5rem;
        padding: 1.25rem 1rem 0.75rem 1rem;
        border-radius: 0.75rem 0.75rem 0 0;
    }
    
    .sgbct-bonus-codes-intro {
        font-size: 0.875rem;
        padding: 0 1rem 1.25rem 1rem;
        border-radius: 0 0 0.75rem 0.75rem;
    }
    
    /* Table wrapper padding on mobile */
    .sgbct-bonus-table-wrapper {
        margin: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        max-width: calc(100vw - 2rem);
    }
    
    /* Footer padding on mobile */
    .sgbct-bonus-table-footer {
        margin: 0 1rem;
        padding-bottom: 1rem;
    }
    
    /* Activate fade-out gradient - indicates scrollable */
    .sgbct-bonus-table-wrapper::after {
        opacity: 1;
    }
    
    /* Activate scroll hint icon on mobile */
    .sgbct-bonus-table-wrapper::before {
        opacity: 0.7;
    }
    
    /* Hide hint after user scrolled */
    .sgbct-bonus-table-wrapper.sgbct-scrolled::before {
        opacity: 0;
        animation: none;
    }
    
    .sgbct-bonus-table-wrapper.sgbct-scrolled::after {
        opacity: 0.5;
    }
    
    /* Table uses full container width on mobile */
    /* For 2-column tables: full width, columns share space proportionally */
    /* For 3+ columns: full width, scroll if needed */
    .sgbct-bonus-table {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        table-layout: auto;
    }

    .sgbct-bonus-table th,
    .sgbct-bonus-table td {
        padding: 0.75rem 0.375rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
    
    /* First column - takes proportional space, ensures visibility */
    .sgbct-bonus-table th:nth-child(1),
    .sgbct-bonus-table td:nth-child(1) {
        padding-right: 0.25rem;
        width: 40%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Second column - takes remaining space, ensures visibility */
    .sgbct-bonus-table th:nth-child(2),
    .sgbct-bonus-table td:nth-child(2) {
        padding-left: 0.375rem;
        padding-right: 0.25rem;
        width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Bonus code column - compact */
    .sgbct-bonus-table th:nth-child(3),
    .sgbct-bonus-table td:nth-child(3) {
        padding-left: 0.375rem;
        padding-right: 0.25rem;
    }
    
    /* Bonus offer column - close spacing */
    .sgbct-bonus-table th:nth-child(4),
    .sgbct-bonus-table td:nth-child(4) {
        padding-left: 0.375rem;
    }
    
    /* Casino name compact */
    .sgbct-casino-cell {
        gap: 0.5rem;
    }

    .sgbct-table-play-button {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .sgbct-footer-text {
        font-size: 0.8125rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - TABLET SIZE
   ======================================== */

/* Note: Column visibility removed - with dynamic columns from Excel import,
   hardcoded nth-child selectors don't work. Users can control column visibility
   via Elementor widget settings or by importing fewer columns. */

/* ========================================
   RESPONSIVE DESIGN - SMALL MOBILE
   ======================================== */

@media (max-width: 640px) {
    .sgbct-bonus-codes-section {
        margin: 0;
        border-radius: 0.625rem;
    }
    
    .sgbct-bonus-table th,
    .sgbct-bonus-table td {
        padding: 0.625rem 0.375rem;
        font-size: 0.75rem;
    }

    /* All columns visible - user can scroll horizontally */

    .sgbct-code-badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }

    .sgbct-game-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .sgbct-bonus-codes-title {
        font-size: 1.375rem;
        padding: 1rem 0.875rem 0.625rem 0.875rem;
        border-radius: 0.625rem 0.625rem 0 0;
    }
    
    .sgbct-bonus-codes-intro {
        font-size: 0.8125rem;
        padding: 0 0.875rem 1rem 0.875rem;
        border-radius: 0 0 0.625rem 0.625rem;
    }
    
    .sgbct-bonus-table-wrapper {
        margin: 0.875rem;
        max-width: calc(100vw - 1.75rem);
    }
    
    .sgbct-bonus-table-footer {
        margin: 0 0.875rem;
        padding-bottom: 0.875rem;
    }
}

/* ========================================
   ELEMENTOR EDITOR VISIBILITY FIX
   ======================================== */

.elementor-editor-active .elementor-widget-slotsgamblersbonuscodestable {
    min-height: 500px !important;
    display: block !important;
    visibility: visible !important;
}

.elementor-editor-active .elementor-widget-slotsgamblersbonuscodestable .elementor-widget-container {
    min-height: 500px !important;
    display: block !important;
    visibility: visible !important;
}

.elementor-editor-active .sgbct-bonus-codes-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 400px !important;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .sgbct-bonus-table-wrapper::before,
    .sgbct-bonus-table-wrapper::after {
        display: none;
    }
    
    .sgbct-bonus-table {
        min-width: auto;
    }
    
    .sgbct-table-play-button {
        background: var(--sgbct-purple-primary);
    }
}


