/**
 * WC Mundial Lite - Ticker Styles
 * Based on horizontal scrolling ticker technique
 *
 * @package WC_Worldcup_Lite
 */

/* ============================================
   TICKER WRAPPER (Outer Container)
   ============================================ */
.wc26-ticker-wrapper {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    position: relative;
}

/* ============================================
   PRELOADER (Shown until JS initializes)
   ============================================ */
.wc26-ticker-preloader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.wc26-preloader-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.25);
    border-top-color: currentColor;
    animation: wc26-spin 0.7s linear infinite;
}

@keyframes wc26-spin {
    to { transform: rotate(360deg); }
}

/* While loading: hide ticker content and show preloader */
.wc26-ticker-wrapper.is-loading .wc26-ticker-wrap {
    visibility: hidden;
}
.wc26-ticker-wrapper.is-loading .wc26-ticker-preloader {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   TICKER WRAP (Middle Container)
   Push content to right side, then animate left
   ============================================ */
.wc26-ticker-wrap {
    width: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    will-change: transform;
    user-select: none;
}

.wc26-ticker-wrapper.is-dragging .wc26-ticker-wrap {
    cursor: grabbing;
}

.wc26-ticker-wrapper.is-user-paused .wc26-ticker-move {
    animation-play-state: paused !important;
}

/* ============================================
   TICKER MOVE (Inner Container with Animation)
   Content is tripled (3x), animate to -33.33% for seamless loop
   ============================================ */
@keyframes wc26-ticker-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.wc26-ticker-move {
    display: flex;
    width: max-content;
    white-space: nowrap;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-name: wc26-ticker-scroll;
    animation-duration: var(--ticker-speed, 30s);
    line-height: 1.5;
    vertical-align: middle;
    padding-top: 15px;
    padding-bottom: 15px;
    will-change: transform;
}

.wc26-ticker-segment {
    display: inline-flex;
    align-items: center;
}

.wc26-ticker-move:hover {
	animation-play-state: paused;
}

/* Don't pause if pause_on_hover is disabled */
.wc26-ticker-wrapper[data-pause-on-hover="0"] .wc26-ticker-move:hover {
	animation-play-state: running;
}

/* ============================================
   TICKER ITEMS
   ============================================ */
.wc26-ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-weight: 500;
}

.wc26-ticker-item a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.wc26-ticker-item a:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.wc26-ticker-separator {
	display: inline-block;
	opacity: 0.6;
	margin: 0 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
	.wc26-ticker-wrapper {
		margin: 15px 0;
	}

	.wc26-ticker-item {
		padding: 0 1.5rem;
	}
}

@media (max-width: 480px) {
	.wc26-ticker-wrapper {
		margin: 10px 0;
	}

	.wc26-ticker-item {
		padding: 0 1rem;
	}
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.wc26-ticker-wrapper:focus-within {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.wc26-ticker-move {
		animation: none !important;
	}
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .wc26-ticker-wrapper {
        box-shadow: none;
    }

	.wc26-ticker-move {
		animation: none !important;
		padding-right: 0;
	}

	.wc26-ticker-wrap {
		padding-left: 0;
	}
}

/* ============================================
   ADMIN QUICK EDIT BUTTON (frontend, admins only)
   ============================================ */
.wc26-ticker-admin-edit {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #ffeb3b; /* amarillo visible */
    color: #000; /* contraste */
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
    opacity: 0.95;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    z-index: 5;
}
.wc26-ticker-admin-edit .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}
.wc26-ticker-admin-edit:hover,
.wc26-ticker-admin-edit:focus {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.wc26-ticker-admin-edit--matches {
    right: 42px;
}
