/**
 * Sparkles Showcase - Module-Specific Styles
 * Sparkles Design Library Component
 *
 * This file contains layout patterns and styles specific to the Sparkles Showcase
 * module that demonstrate design library components and don't fit into generic
 * component categories.
 *
 * Dependencies:
 * - sparkles-tokens.css (CSS variables)
 * - sparkles-utilities.css (base utilities)
 * - buttons.css (extends button components)
 * - cards.css (extends card components)
 *
 * Used by: CustomHyva_HyvaSparklesShowcase module
 */

/* ========== SHOWCASE CONTAINER LAYOUTS ========== */

/**
 * Primary showcase container with responsive behavior
 * Provides consistent spacing and maximum width constraints
 */
.sparkles-design-showcase {
    max-width: 7xl;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Container query anchors for showcase layouts */
:where(.sparkles-design-showcase, .showcase-section) {
    container-type: inline-size;
}

/* ========== SHOWCASE SECTION PATTERNS ========== */

/**
 * Individual showcase sections with visual separation
 * Each section demonstrates different component groups
 */
.showcase-section {
    margin-top: 4rem;
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.sparkles-pattern-background {
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23C69F32" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/**
 * Showcase section titles with consistent typography
 * Provides clear hierarchy for component categories
 */
.showcase-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--color-gray-900);
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 1rem;
}

/**
 * Showcase subtitles for component subcategories
 * Secondary hierarchy for organizing related components
 */
.showcase-subtitle,
.sparkles-review-form-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.showcase-subtitle {
    color: var(--color-gray-800);
}

/* ========== SHOWCASE GRID LAYOUTS ========== */

/**
 * Responsive grid for showcasing multiple components
 * Adapts from single column to multi-column based on screen size
 */
.showcase-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .showcase-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/**
 * Individual showcase items with hover effects
 * Containers for demonstrating single components
 */
.showcase-item {
    padding: 1.5rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.showcase-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* ========== FONT SIZE PREFERENCE SYSTEM ========== */

/**
 * Dynamic font sizing system for accessibility
 * Allows users to adjust content readability
 */
[data-font-size="small"] {
    font-size: 0.875rem;
}

[data-font-size="small"] h1 {
    font-size: 1.5rem;
}

[data-font-size="small"] h2 {
    font-size: 1.25rem;
}

[data-font-size="small"] h3 {
    font-size: 1.125rem;
}

[data-font-size="large"] {
    font-size: 1.125rem;
}

[data-font-size="large"] h1 {
    font-size: 2.25rem;
}

[data-font-size="large"] h2 {
    font-size: 2rem;
}

[data-font-size="large"] h3 {
    font-size: 1.75rem;
}

/* ========== SIDEBAR AND LAYOUT TRANSITIONS ========== */

/**
 * Smooth sidebar width transitions for responsive layouts
 * Provides fluid navigation experience
 */
aside {
    transition: width 0.3s ease-in-out;
}

/* ========== COMPONENT DEMONSTRATION PATTERNS ========== */

/**
 * Button showcase variations
 * Demonstrates different button states and types
 */
.showcase-button-group,
.sparkles-wishlist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.showcase-button-group .showcase-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-600);
    min-width: 80px;
}

/**
 * Card showcase variations
 * Demonstrates different card types and layouts
 */
.showcase-card-grid,
.showcase-color-palette {
    display: grid;
    margin-bottom: 2rem;
}

.showcase-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/**
 * Form showcase patterns
 * Demonstrates form components and validation states
 */
.showcase-form-section {
    background: var(--color-gray-50);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.showcase-form-section .showcase-form-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-800);
    margin-bottom: 1rem;
}

/* ========== COLOR PALETTE DEMONSTRATION ========== */

/**
 * Color swatch display for design tokens
 * Shows brand colors and their variations
 */
.showcase-color-palette {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.showcase-color-swatch {
    text-align: center;
}

.showcase-color-swatch .color-sample {
    width: 100%;
    height: 60px;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--color-gray-300);
}

.showcase-color-swatch .color-name,
.showcase-code-example .code-title {
    font-size: 0.75rem;
    font-weight: 500;
}

.showcase-color-swatch .color-name {
    color: var(--color-gray-700);
}

.showcase-color-swatch .color-value {
    font-size: 0.625rem;
    color: var(--color-gray-500);
    font-family: monospace;
}

/* ========== TYPOGRAPHY DEMONSTRATION ========== */

/**
 * Typography showcase for font families and sizes
 * Demonstrates heading hierarchy and text styles
 */
.showcase-typography {
    margin-bottom: 2rem;
}

.showcase-typography h1,
.showcase-typography h2,
.showcase-typography h3,
.showcase-typography h4,
.showcase-typography h5,
.showcase-typography h6 {
    margin-bottom: 0.5rem;
    color: var(--color-gray-800);
}

.showcase-typography p {
    margin-bottom: 1rem;
    color: var(--color-gray-700);
    line-height: 1.6;
}

/* ========== ANIMATION SHOWCASE ========== */

/**
 * Animation demonstration container
 * Shows various Sparkles animations and transitions
 */
.showcase-animation-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-gray-50);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.showcase-animation-item {
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* ========== CODE EXAMPLE DISPLAY ========== */

/**
 * Code example container for showing implementation
 * Displays HTML/CSS code with syntax highlighting
 */
.showcase-code-example {
    background: var(--color-gray-900);
    color: var(--color-gray-100);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.showcase-code-example .code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-700);
}

.showcase-code-example .code-title {
    color: var(--color-gray-400);
}

.showcase-code-example .copy-button {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-gray-700);
    color: var(--color-gray-300);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.showcase-code-example .copy-button:hover {
    background: var(--color-gray-600);
}

/* ========== RESPONSIVE SHOWCASE PATTERNS ========== */

/**
 * Mobile-optimized showcase layouts
 * Ensures proper display on small screens
 */
@container (max-width: 640px) {
    .sparkles-design-showcase {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .showcase-section {
        margin-top: 2rem;
        margin-bottom: 2rem;
        padding: 1rem;
    }

    .showcase-title {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .showcase-subtitle {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .showcase-button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .showcase-color-palette {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/**
 * Dark mode variations for showcase components
 * Maintains visibility in dark themes
 */
@media (prefers-color-scheme: dark) {
    .showcase-section {
        background-color: var(--color-gray-800);
        color: var(--color-gray-100);
    }

    .showcase-title,
    .showcase-subtitle {
        color: var(--color-gray-100);
    }

    .showcase-title {
        border-bottom-color: var(--color-gray-600);
    }

    .showcase-item {
        background-color: var(--color-gray-700);
        border-color: var(--color-gray-600);
        color: var(--color-gray-100);
    }

    .showcase-form-section {
        background: var(--color-gray-700);
    }

    .showcase-animation-demo {
        background: var(--color-gray-700);
    }
}

/* ========== PRINT OPTIMIZATION ========== */

/**
 * Print-friendly showcase styling
 * Optimizes layout for printing documentation
 */
@media print {
    .sparkles-design-showcase {
        max-width: none;
        padding: 0;
    }

    .showcase-section {
        margin-bottom: 1rem;
    }

    .showcase-grid {
        display: block;
    }

    .showcase-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }

    .showcase-animation-demo,
    .showcase-code-example .copy-button {
        display: none;
    }
}

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

/**
 * High contrast mode support for showcases
 * Ensures proper visibility in accessibility modes
 */
@media (prefers-contrast: high) {
    .showcase-section {
        border: 2px solid;
    }

    .showcase-item {
        border-width: 2px;
    }

    .showcase-color-swatch .color-sample {
        border-width: 2px;
    }
}

/**
 * Focus management for showcase interactive elements
 * Ensures proper keyboard navigation
 */
.showcase-item:focus-within,
.showcase-animation-item:focus,
.showcase-code-example .copy-button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

/**
 * Shared utility classes for showcase demos and common UI patterns
 */
.showcase-center,
.sparkles-icon-center,
.sparkles-form-step-indicator,
.sparkles-flex-center,
.sparkles-breadcrumb-item,
.sparkles-media-nav-btn,
.sparkles-media-zoom-btn,
.sparkles-media-play-btn,
[data-content-type='slide'] .pagebuilder-slide-wrapper.jarallax [id*='jarallax-container'] > div .pagebuilder-overlay.pagebuilder-poster-overlay,
[data-content-type='slide'] .pagebuilder-slide-wrapper.jarallax [id*='jarallax-container'] > img .pagebuilder-overlay.pagebuilder-poster-overlay,
[data-content-type='slide'] .pagebuilder-slide-wrapper.jarallax [id*='jarallax-container'] > video .pagebuilder-overlay.pagebuilder-poster-overlay,
[data-content-type='slide'] .pagebuilder-slide-wrapper.jarallax [id*='jarallax-container'] > iframe .pagebuilder-overlay.pagebuilder-poster-overlay,
[data-content-type='banner'] .pagebuilder-banner-wrapper .pagebuilder-overlay.pagebuilder-poster-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-space-between,
.sparkles-flex-between,
.sparkles-cart-item-actions,
.sparkles-progress-header,
.sparkles-rule-list .rule-header,
.sparkles-review-header,
.sparkles-product-carousel-header,
.sparkles-rule-manager .rule-manager-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.showcase-full-width {
    width: 100%;
}

.showcase-half-width {
    width: 50%;
}

@container (max-width: 640px) {
    .showcase-half-width {
        width: 100%;
    }
}
