/* EPIA Agenda Sorting - Loading Spinner Styles */
/* Uses Astra theme's spinner style for consistency */

.epia-sorting-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 200px;
}

.epia-spinner-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    animation: epia-spin 1.1s linear infinite;
    border-top: 4px solid rgba(0, 0, 0, 0.2);
    border-right: 4px solid rgba(0, 0, 0, 0.2);
    border-bottom: 4px solid rgba(0, 0, 0, 0.2);
    border-left: 4px solid #2271b1;
    /* WordPress blue - matches Astra theme */
}

@keyframes epia-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.epia-spinner-text {
    margin-top: 15px;
    color: #2271b1;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Hide loop containers initially to prevent flash of unsorted content */
.elementor-loop-container {
    opacity: 0 !important;
    transition: opacity 0.3s ease-in-out;
}

/* Show containers after sorting (JavaScript will add this class) */
.elementor-loop-container.epia-sorted {
    opacity: 1 !important;
}

/* Favourite Button Styles */
.epia-favourite-btn {
    cursor: pointer;
    font-size: 24px;
    color: #ccc;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    line-height: 1;
    user-select: none;
}

.epia-favourite-btn:hover {
    color: #f39c12;
    filter: drop-shadow(0 0 8px rgba(243, 156, 18, 0.6));
    transform: translateY(-1px);
}

.epia-favourite-btn.active {
    color: #f39c12 !important;
}

/* Ensure child elements (icons, SVGs) also inherit the color */
.epia-favourite-btn.active *,
.epia-favourite-btn.active i,
.epia-favourite-btn.active svg {
    color: #f39c12 !important;
    fill: #f39c12 !important;
}

.epia-favourite-btn.active:hover {
    color: #e67e22;
    filter: drop-shadow(0 0 10px rgba(230, 126, 34, 0.7));
    transform: translateY(-1px);
}

/* Optional: Add a subtle animation when favourited */
@keyframes epia-favourite-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}


/* Fix: Ensure header stays above content (like the star icon) on scroll */
/* Increase z-index to be absolute highest */
.site-header,
.ast-mobile-header-wrap,
.elementor-location-header {
    z-index: 999999 !important;
    position: relative;
}

/* ==========================================================================
   MOBILE STYLING (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {

    /* 1. Generic Layout Container (Days + Tracks) */
    .e-n-tabs-heading {
        flex-wrap: wrap !important;
        overflow: visible !important;
        gap: 8px !important;
        margin-bottom: 20px !important;
    }

    /* 2. Top-Level Layout (Days): Center Content */
    /* Target headings that are NOT inside another content area */
    .e-n-tabs-heading:not(.e-n-tabs-content .e-n-tabs-heading) {
        justify-content: center !important;
    }

    /* 3. Nested Layout (Tracks): Left Align */
    .e-n-tabs-content .e-n-tabs-heading {
        justify-content: flex-start !important;
    }

    /* 4. BASE BUTTON STYLE (Applies to all) */
    .e-n-tab-title {
        background-color: #f8f9fa !important;
        color: #0080C0 !important;
        border: 1px solid #ddd !important;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    /* 5. PARENT BUTTON STYLE (Days) - Bigger, bolder */
    .e-n-tabs-heading:not(.e-n-tabs-content .e-n-tabs-heading) .e-n-tab-title {
        font-weight: 700 !important;
        text-transform: uppercase !important;
        padding: 10px 20px !important;
        /* Larger touch target */
        border-radius: 4px !important;
        /* Square-ish */
        font-size: 14px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    /* 6. CHILD BUTTON STYLE (Tracks) - Smaller, tag-like */
    .e-n-tabs-content .e-n-tabs-heading .e-n-tab-title {
        font-size: 13px !important;
        font-weight: 500 !important;
        padding: 6px 14px !important;
        /* Compact */
        border-radius: 20px !important;
        /* Pill shape */
        border-color: #e0e0e0 !important;
    }

    /* 7. ACTIVE STATE (Shared) */
    .e-n-tab-title[aria-selected="true"],
    .e-n-tab-title.e-active {
        background-color: #0080C0 !important;
        color: #ffffff !important;
        border-color: #0080C0 !important;
        box-shadow: 0 4px 6px rgba(0, 128, 192, 0.2);
    }
}

/* ==========================================================================
   DESKTOP & TABLET SPECIFIC STYLING (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {

    /* TARGET: Track Tabs (Nested inside Day Content) */
    /* Selector Strategy: Target .elementor-tab-title ONLY if it is inside .elementor-tab-content */
    /* This prevents affecting the main "Day Tabs" if they are also using the same widget type */

    .elementor-tab-content .elementor-tab-title {
        border-radius: 50px !important;
        padding: 10px 24px !important;
        margin-right: 12px !important;
        font-weight: 600 !important;
        font-size: 15px !important;
        border: none !important;
        /* Clean look */
        color: #ffffff !important;
        /* All tracks have white text */
        transition: transform 0.2s ease, filter 0.2s ease !important;
    }

    /* Hover Effect */
    .elementor-tab-content .elementor-tab-title:hover {
        transform: translateY(-2px);
        filter: brightness(1.1);
    }

    /* 1. All Sessions (First Tab) - Option: Orange */
    .elementor-tab-content .elementor-tab-title:nth-child(1) {
        background-color: #f59e0b !important;
        /* Orange */
    }

    /* 2. Track 1 (Second Tab) - Option: Dark Blue */
    .elementor-tab-content .elementor-tab-title:nth-child(2) {
        background-color: #1e3965 !important;
        /* Dark Blue */
    }

    /* 3. Track 2 (Third Tab) - Option: Pink */
    .elementor-tab-content .elementor-tab-title:nth-child(3) {
        background-color: #f3bafd !important;
        /* Pink */
        color: #1e3965 !important;
        /* Dark text for light background? Image showed white maybe? Safe to use dark for contrast if light pink */
    }

    /* 4. Track 3 (Fourth Tab) - Option: Green */
    .elementor-tab-content .elementor-tab-title:nth-child(4) {
        background-color: #0a875a !important;
        /* Green */
    }

    /* Active State Handling */
    /* Ensure Active tab keeps its color but adds maybe a shadow or border */
    .elementor-tab-content .elementor-tab-title.elementor-active {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
        transform: scale(1.1);
        /* Slight pop */
    }
}