/* ============================================
   ECHO24X7 YouTube Shorts — shorts.css v1.0.10
   Prefix : eys-
   ============================================ */

/* ---- CSS Variables ---- */
.eys-wrapper {
    --eys-accent:      #ef8200;
    --eys-bg:          #111111;
    --eys-surface:     rgba(255, 255, 255, 0.10);
    --eys-border:      rgba(255, 255, 255, 0.14);
    --eys-text:        #f1f5f9;
    --eys-muted:       rgba(255, 255, 255, 0.60);
    --eys-radius:      14px;
    --eys-sheet-h:     52%;   /* max height of expanded sheet relative to player */
    --eys-handle-h:    56px;
    --eys-transition:  0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Wrapper ---- */
.eys-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    background: transparent;
    /*
     * Explicitly declare a min-height so the Elementor flex-item chain
     * can measure it. aspect-ratio on the inner container alone does not
     * propagate upward through nested flex/block parents in Elementor's
     * e-con layout, leaving the widget at 0px and the player overflowing
     * invisibly. min() clamps to 88vh on short screens.
     */
    min-height: min(calc(100vw * 16 / 9), 88vh);
}

/* ---- Portrait Player Container ---- */
.eys-player-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9 / 16;
    max-height: 88vh;
    background: var(--eys-bg);
    border-radius: var(--eys-radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y; /* allow vertical swipe passthrough */
}

/* YouTube IFrame API target div + its iframe */
#eys-player,
#eys-player iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

/* Touch/wheel interceptor — sits above the iframe (z-index 2) so swipe and wheel
   events are captured by the page instead of being swallowed by the iframe context.
   z-index kept below the spinner (5), arrows (10), sheet-scrim (19) and sheet (20)
   so all UI controls remain fully interactive. */
#eys-touch-zone {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    touch-action: pan-y;
}

/* ---- Spinner ---- */
.eys-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 5;
}

.eys-spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--eys-accent);
    border-radius: 50%;
    animation: eys-spin 0.8s linear infinite;
}

@keyframes eys-spin {
    to { transform: rotate(360deg); }
}

/* ---- Empty State ---- */
.eys-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--eys-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    z-index: 6;
    background: var(--eys-bg);
}

.eys-empty-state i {
    font-size: 36px;
    opacity: 0.5;
}

/* ---- Top Bar (counter only) ---- */
.eys-top-bar {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 14px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.eys-mute-btn {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.eys-mute-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ---- Shorts Share Button ---- */

.eys-share-btn {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.eys-share-btn:hover,
.eys-share-btn:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

/* ---- Toast ---- */

.eys-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);

    background: #ef8200;
    color: #fff;

    padding: 5px;
    border-radius: 999px;

    font-size: 15px;
    font-weight: 600;
    text-align: center;

    z-index: 99999;

    opacity: 0;

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.eys-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- Autoplay Toggle ---- */
.eys-autoplay-toggle {
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.eys-autoplay-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.eys-autoplay-track {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: rgba(255,255,255,0.25);
    border-radius: 9px;
    transition: background 0.22s;
    flex-shrink: 0;
}

.eys-autoplay-toggle input:checked + .eys-autoplay-track {
    background: var(--eys-accent);
}

.eys-autoplay-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.22s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.eys-autoplay-toggle input:checked + .eys-autoplay-track .eys-autoplay-thumb {
    transform: translateX(14px);
}

.eys-autoplay-label-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    letter-spacing: 0.3px;
}

.eys-counter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    letter-spacing: 0.5px;
}

/* ---- Title Overlay (bottom-left, above sheet handle) ---- */
.eys-title-overlay {
    position: absolute;
    left: 14px;
    right: 70px; /* keep clear of nav arrows */
    bottom: calc(var(--eys-handle-h) + 10px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    z-index: 10;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ---- Swipe Arrow Hints (right edge, vertical pair) ---- */
.eys-nav-arrows {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.eys-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.eys-arrow:hover {
    background: rgba(0, 0, 0, 0.60);
    color: #fff;
}

.eys-arrow.disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

/* Pulse hint on first load */
.eys-arrow.eys-hint {
    animation: eys-pulse-hint 0.7s ease-in-out 3;
}

@keyframes eys-pulse-hint {
    0%, 100% { transform: scale(1);    color: rgba(255,255,255,0.65); }
    50%       { transform: scale(1.25); color: #fff; }
}

/* ---- Sheet Scrim (backdrop dim when sheet is open) ---- */
.eys-sheet-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 19;
    pointer-events: none;
    transition: background var(--eys-transition);
}

.eys-sheet-scrim.open {
    background: rgba(0, 0, 0, 0.40);
    pointer-events: all;
}

/* ---- Bottom Sheet ---- */
.eys-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    /* Gradient scrim behind whole sheet — blends with any video color */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.60) 55%,
        transparent 100%
    );
    transform: translateY(calc(100% - var(--eys-handle-h)));
    transition: transform var(--eys-transition);
    will-change: transform;
    max-height: var(--eys-sheet-h);
    overflow: hidden;
    border-radius: 0; /* contained inside player radius */
}

.eys-sheet.open {
    transform: translateY(0);
    overflow-y: auto;
}

/* Hide scrollbar inside sheet */
.eys-sheet::-webkit-scrollbar { display: none; }
.eys-sheet { scrollbar-width: none; }

/* ---- Handle Wrap (always-visible trigger) ---- */
.eys-handle-wrap {
    flex-shrink: 0;
    height: var(--eys-handle-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    /* Frosted glass handle bar */
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 6px 12px 8px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Row inside handle: label (left) + controls (right) */
.eys-handle-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Controls group on the right side of the handle */
.eys-handle-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
}

.eys-handle-pip {
    width: 32px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.40);
    flex-shrink: 0;
}

.eys-handle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.eys-handle-chevron {
    transition: transform var(--eys-transition);
    font-size: 10px;
}

.eys-sheet.open .eys-handle-chevron {
    transform: rotate(180deg);
}

/* ---- Channel Grid (inside expanded sheet) ---- */
.eys-channel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 10px;
    padding: 14px 12px 18px;
    overflow-y: auto;
}

.eys-channel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 10px;
    padding: 8px 4px;
    transition: background 0.15s;
    touch-action: manipulation;
}

.eys-channel-item:hover,
.eys-channel-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.eys-ch-logo-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.eys-ch-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

/* Active channel: accent ring */
.eys-channel-item.active .eys-ch-logo {
    border-color: var(--eys-accent);
}

/* Initials fallback */
.eys-ch-initials {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--eys-accent);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Shown when img fails */
.eys-ch-logo.eys-logo-error + .eys-ch-initials,
.eys-ch-logo-wrap.no-logo .eys-ch-initials {
    opacity: 1;
}

/* Checkmark overlay for active channel */
.eys-ch-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eys-accent);
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.15s, transform 0.15s;
}

.eys-channel-item.active .eys-ch-check {
    opacity: 1;
    transform: scale(1);
}

.eys-ch-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.80);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 72px;
}

.eys-channel-item.active .eys-ch-name {
    color: var(--eys-accent);
}

/* ---- Replay Overlay (shown when autoplay=off and video ended) ---- */
.eys-replay-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9; /* above touch-zone (2) and pp-overlay (8) */
    background: rgba(0, 0, 0, 0.30);
}

.eys-replay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.80);
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s;
    pointer-events: all;
}

.eys-replay-btn:hover,
.eys-replay-btn:focus-visible {
    background: rgba(0, 0, 0, 0.70);
    transform: scale(1.08);
    outline: none;
}

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ---- Play/Pause Feedback Overlay ---- */
.eys-pp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8;
    pointer-events: none;
}

.eys-pp-overlay i {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.75));
    opacity: 0;
}

.eys-pp-overlay.eys-pp-animate i {
    animation: eys-pp-flash 0.58s ease-out forwards;
}

@keyframes eys-pp-flash {
    0%   { opacity: 0.95; transform: scale(1); }
    50%  { opacity: 0.80; transform: scale(1.18); }
    100% { opacity: 0;    transform: scale(0.88); }
}

/* ---- All Channels grid item ---- */
.eys-channel-item.eys-all-channels .eys-all-icon {
    opacity: 1;
    font-size: 20px;
    background: linear-gradient(135deg, var(--eys-accent) 0%, #c96a00 100%);
}

/* ---- Elementor Integration Fix ---- */
/*
 * The Elementor section wrapping the shortcode commonly has a large padding-bottom
 * (e.g. 140px) set via Elementor editor, which adds blank white space below the
 * player. Remove it and reset height to auto so the section sizes to its content.
 */
/* Elementor uses intermediate wrappers (.e-con-inner, .elementor-widget-container)
   so we use a descendant selector rather than strict child (>) combinators. */
.e-con:has(.eys-wrapper) {
    padding-bottom: 0 !important;
    height: auto !important;
}

.elementor-widget:has(.eys-wrapper) {
    padding: 0 !important;
}
