/*
 * Slot Review Features Component
 * Mobile-First Responsive Design
 * Follows strict design token compliance
 */

/* Import design tokens - loaded globally via functions.php */

/* Import utilities for common patterns */
@import url('../../../assets/css/utilities.css');

/* ===========================
   BASE STYLES (MOBILE FIRST)
   No media query - these are the default
   =========================== */

.slot-features-container {
    /* Layout - Flexbox for flexible container */
    display: flex;
    flex-direction: column;
    align-items: stretch;

    /* Box model */
    width: calc(100% - var(--spacing-3) * 2);
    min-width: 0; /* Prevent overflow */
    padding: var(--spacing-6) var(--spacing-4);
    margin: var(--spacing-3) auto;
    box-sizing: border-box;

    /* Visual design */
    background-color: var(--color-base-light-gray);
    border-radius: var(--radius-2xl);

    /* Typography */
    font-family: var(--font-family-paragraph);
    font-size: var(--font-size-p2-base);
    line-height: var(--line-height-p2-base);
    color: var(--color-base-dark);
}

/* Content wrapper using CSS Grid for better control */
.slot-features-content {
    display: grid;
    /* Two column layout with divider on mobile (same as tablet) */
    grid-template-columns: 1fr var(--border-width-thin) 1fr;
    gap: var(--spacing-4);
    align-items: center;
    width: 100%;
    padding: var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-3);
}

/* Feature columns */
.features-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    min-width: 0; /* Prevent overflow */
}

/* Divider - vertical on all breakpoints */
.features-divider {
    /* Vertical divider */
    display: block;
    width: var(--border-width-thin);
    height: 100%;
    min-height: var(--spacing-20); /* Minimum height */
    background-color: var(--color-base-mid-gray);
    margin: 0;
    border: none;
    justify-self: center;
    align-self: stretch;
}

/* Feature items with proper flexbox */
.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    min-width: 0; /* Allow shrinking */

    /* Typography */
    font-family: var(--font-family-paragraph);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-p1-large);
    line-height: var(--line-height-p1-large);
    color: var(--color-base-dark);

    /* Interaction */
    transition: opacity 0.2s ease;
}

.feature-item:hover {
    opacity: 0.8;
}

/* Feature icon */
.feature-icon {
    /* Fixed size for consistency */
    flex-shrink: 0;
    width: var(--spacing-5); /* 20px */
    height: var(--spacing-5); /* 20px */

    /* Center content */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Feature text */
.feature-text {
    /* Allow text to wrap on mobile */
    flex: 1;
    min-width: 0; /* Enable text truncation if needed */
    margin: 0;
    word-wrap: break-word;
}

/* Icon styles using CSS masks for color control */
.check-icon,
.feature-item.enabled .feature-icon {
    background-color: var(--color-semantic-success);
    mask: url('../svg/check-icon.svg') no-repeat center;
    mask-size: contain;
    -webkit-mask: url('../svg/check-icon.svg') no-repeat center;
    -webkit-mask-size: contain;
}

.x-icon,
.feature-item.disabled .feature-icon {
    background-color: var(--color-semantic-error);
    mask: url('../svg/x-icon.svg') no-repeat center;
    mask-size: contain;
    -webkit-mask: url('../svg/x-icon.svg') no-repeat center;
    -webkit-mask-size: contain;
}

/* ===========================
   TABLET STYLES (768px+)
   Progressive enhancement
   =========================== */

@media (min-width: 768px) {
    .slot-features-container {
        /* Increase padding on tablet */
        padding: var(--spacing-8) var(--spacing-10);
        margin: var(--spacing-6) auto;

        /* Larger corner radius */
        border-radius: var(--radius-3xl);

        /* Constrain width on tablet */
        max-width: 698px;

        /* Match desktop image height - maintains height when resizing from desktop to tablet */
        min-height: 289px;
        box-sizing: border-box;
    }

    .slot-features-content {
        /* Two column layout on tablet */
        grid-template-columns: 1fr var(--border-width-thin) 1fr;
        gap: var(--spacing-8);
        align-items: center;
        padding: var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-3);
    }

    /* Divider inherits from base styles - no changes needed */

    .features-column {
        gap: var(--spacing-4);
    }

    .feature-item {
        /* Slightly larger text on tablet */
        font-size: var(--font-size-p2-base);
        line-height: var(--line-height-p2-base);
    }

    .feature-icon {
        /* Slightly larger icons */
        width: calc(var(--spacing-5) + var(--spacing-1)); /* 24px */
        height: calc(var(--spacing-5) + var(--spacing-1)); /* 24px */
    }
}

/* ===========================
   DESKTOP STYLES (1280px+)
   Further enhancement
   =========================== */

@media (min-width: 1280px) {
    .slot-features-container {
        /* Desktop padding and sizing */
        padding: var(--spacing-12) var(--spacing-16);
        margin: var(--spacing-8) auto;

        /* Constrain to reasonable width */
        max-width: 1018px;

        /* Adjust to content width */
        width: fit-content;

        /* Match adjacent Brizy image height */
        min-height: 289px;
    }

    .slot-features-content {
        /* Maintain two-column with divider */
        gap: var(--spacing-12);
        padding: var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-3);
    }

    .features-column {
        /* More spacing between items */
        gap: var(--spacing-4);

        /* Ensure minimum width for readability */
        min-width: calc(var(--spacing-20) * 2); /* 160px minimum */
    }

    .feature-item {
        /* Desktop font sizes */
        font-size: var(--font-size-p2-base);
        line-height: var(--line-height-p2-base);
        gap: var(--spacing-4);
    }

    .feature-text {
        /* Prevent wrapping on desktop if space allows */
        white-space: nowrap;
    }
}

/* ===========================
   ACCESSIBILITY ENHANCEMENTS
   =========================== */

/* Focus styles for keyboard navigation */
.feature-item:focus-visible {
    outline: var(--border-width-medium) solid var(--color-primary);
    outline-offset: var(--spacing-1);
    border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .slot-features-container {
        background-color: var(--color-base-ghost-white);
        border: var(--border-width-medium) solid var(--color-base-dark);
    }

    .features-divider {
        background-color: var(--color-base-dark);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .feature-item {
        transition: none;
    }
}

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

@media print {
    .slot-features-container {
        background-color: transparent;
        border: var(--border-width-thin) solid var(--color-base-dark);
        margin: var(--spacing-2) 0;
        page-break-inside: avoid;
    }

    /* Show check/x marks in print */
    .feature-item.enabled .feature-icon::after {
        content: "✓";
        color: var(--color-base-dark);
    }

    .feature-item.disabled .feature-icon::after {
        content: "✗";
        color: var(--color-base-dark);
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */

/* For constrained containers */
.slot-features-container.compact {
    padding: var(--spacing-4) var(--spacing-3);
}

.slot-features-container.compact .feature-item {
    font-size: var(--font-size-p3-caption);
    line-height: var(--line-height-p3-caption);
}

/* Wide variant for more features */
.slot-features-container.wide .slot-features-content {
    grid-template-columns: repeat(auto-fit, minmax(calc(var(--spacing-20) * 2), 1fr));
}

/* ===========================
   HTML STRUCTURE EXAMPLE
   =========================== */

/*
<div class="slot-features-container">
    <div class="slot-features-content">
        <div class="features-column">
            <div class="feature-item enabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Wild Symbol</span>
            </div>
            <div class="feature-item enabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Free Spins</span>
            </div>
            <div class="feature-item disabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Progressive Jackpot</span>
            </div>
        </div>
        <div class="features-divider"></div>
        <div class="features-column">
            <div class="feature-item enabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Bonus Game</span>
            </div>
            <div class="feature-item disabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Multiplier</span>
            </div>
            <div class="feature-item enabled">
                <span class="feature-icon"></span>
                <span class="feature-text">Scatter Symbol</span>
            </div>
        </div>
    </div>
</div>
*/