/**
 * Spoton Review Showcase Widget Styles
 * 
 * @package Avifauna_Elementor_Extended
 * @since 1.0.0
 */


/* ==========================================================================
   WIREFRAME BASE STYLES
   ========================================================================== */

.widget-wrapper.widget-spoton-review-showcase {
    /* Wireframe baseline */
    --container-width: var(--elementor-container-width, 100%);
    --container-padding: var(--elementor-container-padding, 20px);
    --showcase-width: var(--elementor-showcase-width, 100%);
    --background-color: var(--elementor-background-color, #f3f4f6);
    --text-color: var(--elementor-text-color, #374151);
    --border-color: var(--elementor-border-color, #d1d5db);
    --focus-color: var(--elementor-focus-color, #005fcc);
    /* Custom overrides */
    padding: var(--custom-padding, var(--container-padding));
    width: var(--custom-width, var(--container-width));
    background: var(--custom-background, var(--background-color));
    color: var(--custom-text-color, var(--text-color));
    /* Wireframe appearance */
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--custom-gap, 1rem);
    position: relative;
    /* Transitions for smooth interactions */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}


/* Container states */

.widget-wrapper.widget-spoton-review-showcase[data-loading="true"] {
    border-style: solid;
    border-color: var(--focus-color);
}

.widget-wrapper.widget-spoton-review-showcase.spoton-error {
    border-color: #dc2626;
    background-color: #fef2f2;
}


/* ==========================================================================
   HEADER STYLES
   ========================================================================== */

.widget-wrapper__header {
    margin-bottom: 1rem;
}

.widget-wrapper__header-title {
    margin: 0 0 0.5rem 0;
    font-family: var(--elementor-heading-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: var(--elementor-heading-font-size, 1.5rem);
    font-weight: var(--elementor-heading-font-weight, 600);
    line-height: var(--elementor-heading-line-height, 1.2);
    color: var(--elementor-heading-color, var(--text-color));
}


/* ==========================================================================
   CONTENT STYLES
   ========================================================================== */

.widget-wrapper__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* ==========================================================================
   SPOTON SHOWCASE STYLES
   ========================================================================== */

.spoton-review-showcase {
    width: var(--custom-showcase-width, var(--showcase-width));
    min-height: var(--custom-min-height, 200px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: var(--custom-text-align, center);
    padding: var(--custom-showcase-padding, 10px);
    /* Ensure external content fits properly */
    overflow: hidden;
    word-wrap: break-word;
}


/* Loading state */

.spoton-review-showcase[data-loading="true"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite ease-in-out;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* Fallback content */

.spoton-fallback-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 1rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
}

.spoton-review-showcase[data-loading="false"] .spoton-fallback-content {
    display: none;
}


/* ==========================================================================
   ERROR STATES
   ========================================================================== */

.spoton-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 1rem;
    color: #dc2626;
    text-align: center;
}

.spoton-error-message p {
    margin: 0;
}

.spoton-error-message strong {
    font-weight: 600;
}


/* ==========================================================================
   ACCESSIBILITY STYLES
   ========================================================================== */


/* Focus management */

.widget-wrapper.widget-spoton-review-showcase:focus-within {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
    border-style: solid;
}

.spoton-review-showcase:focus-within {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}


/* Skip links */

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    background: var(--custom-skip-bg, #000) !important;
    color: var(--custom-skip-color, #fff) !important;
    border: 2px solid var(--focus-color) !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    z-index: 9999 !important;
}


/* High contrast mode support */

@media (prefers-contrast: high) {
    .widget-wrapper.widget-spoton-review-showcase {
        border-width: 2px;
        border-style: solid;
    }
    .spoton-review-showcase {
        border: 1px solid;
    }
    .spoton-error-message {
        border-width: 2px;
    }
}


/* Reduced motion support */

@media (prefers-reduced-motion: reduce) {
    .widget-wrapper.widget-spoton-review-showcase,
    .spoton-review-showcase,
    .spoton-review-showcase * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .spoton-review-showcase[data-loading="true"] {
        animation: none;
        background: #f0f0f0;
    }
}


/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */


/* Mobile-first approach */

@media (max-width: 767px) {
    .widget-wrapper.widget-spoton-review-showcase {
        padding: var(--custom-mobile-padding, 15px);
        gap: var(--custom-mobile-gap, 0.75rem);
    }
    .widget-wrapper__header-title {
        font-size: var(--elementor-mobile-heading-size, 1.25rem);
    }
    .spoton-review-showcase {
        min-height: var(--custom-mobile-min-height, 150px);
        padding: var(--custom-mobile-showcase-padding, 8px);
    }
    .spoton-fallback-content {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}


/* Tablet styles */

@media (min-width: 768px) and (max-width: 1024px) {
    .widget-wrapper.widget-spoton-review-showcase {
        padding: var(--custom-tablet-padding, 18px);
    }
    .spoton-review-showcase {
        min-height: var(--custom-tablet-min-height, 175px);
    }
}


/* Desktop styles */

@media (min-width: 1025px) {
    .widget-wrapper.widget-spoton-review-showcase {
        padding: var(--custom-desktop-padding, var(--container-padding));
    }
    .spoton-review-showcase {
        min-height: var(--custom-desktop-min-height, 200px);
    }
}


/* ==========================================================================
   SPOTON CONTENT INTEGRATION
   ========================================================================== */


/* Ensure Spoton content integrates well */

.spoton-review-showcase>div:not(.spoton-fallback-content) {
    width: 100%;
    max-width: 100%;
}


/* Common Spoton content styling overrides */

.spoton-review-showcase iframe {
    max-width: 100%;
    height: auto;
    border: none;
}

.spoton-review-showcase [class*="spoton"] {
    font-family: inherit;
    color: inherit;
}


/* Ensure external content respects container boundaries */

.spoton-review-showcase * {
    max-width: 100%;
    box-sizing: border-box;
}


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

@media print {
    .widget-wrapper.widget-spoton-review-showcase {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    .sr-only {
        position: static !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        clip: auto !important;
    }
    .spoton-review-showcase[data-loading="true"] {
        animation: none;
        background: #f9f9f9;
    }
    .spoton-fallback-content::after {
        content: " (External content not available in print)";
        font-style: italic;
        color: #666;
    }
}