/**
 * Ticker Tape Component Styles
 */

:root {
    --ticker-height: 44px;
}

@media (max-width: 768px) {
    :root {
        --ticker-height: 56px;
    }
}

/* Placeholder for responsive mode (used for IntersectionObserver) */
.ticker-placeholder {
    height: 1px;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

/* Sticky ticker container */
.ticker-container.ticker-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    width: 100%;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    height: var(--ticker-height);
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Inline ticker (for responsive mode when visible in viewport) */
.ticker-container:not(.ticker-sticky) {
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    z-index: 10;
    height: var(--ticker-height);
    display: flex;
    align-items: center;
}

/* Close button */
.ticker-close {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 10000;
    flex-shrink: 0;
}

.ticker-container[dir="rtl"] .ticker-close {
    right: auto;
    left: 12px;
}

.ticker-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.ticker-close:focus {
    outline: 2px solid rgba(240, 98, 146, 0.8);
    outline-offset: 2px;
}

.ticker-close:active {
    transform: translateY(-50%) scale(0.95);
}

.ticker-close span {
    display: block;
    font-weight: bold;
    line-height: 1;
}

.ticker-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-right: 50px; /* Space for close button */
}

.ticker-container[dir="rtl"] .ticker-wrapper,
.ticker-container.ticker-rtl .ticker-wrapper {
    padding-right: 0;
    padding-left: 50px;
}

.ticker-content,
.ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 0;
    will-change: transform;
}

/* LTR ticker: scrolls left-to-right (content moves left, appears from right) */
.ticker-container.ticker-ltr .ticker-track,
.ticker-container[dir="ltr"] .ticker-track {
    animation: ticker-ltr var(--ticker-duration, 60s) linear infinite;
    transform-origin: left center;
}

/* RTL ticker: scrolls right-to-left (content moves right, appears from left) */
.ticker-container.ticker-rtl .ticker-track,
.ticker-container[dir="rtl"] .ticker-track {
    animation: ticker-rtl var(--ticker-duration, 60s) linear infinite;
    transform-origin: right center;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.ticker-item-callcenter {
    background: rgba(240, 98, 146, 0.2);
    padding: 0 24px;
    font-weight: 600;
}

.ticker-icon {
    font-size: 16px;
    display: inline-block;
}

.ticker-text {
    display: inline-block;
}

.ticker-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.ticker-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.ticker-link:hover {
    opacity: 0.8;
}

.ticker-separator {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: inline-block;
    margin: 0 12px;
    flex-shrink: 0;
}

/* LTR animation: content moves left (negative translateX) = left-to-right scrolling */
@keyframes ticker-ltr {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* RTL animation: content moves right (positive translateX) = right-to-left scrolling */
@keyframes ticker-rtl {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(50%, 0, 0);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ticker-track,
    .ticker-content {
        animation: none !important;
    }
    
    .ticker-track,
    .ticker-content {
        overflow-x: auto;
        scroll-behavior: smooth;
    }
}

/* Body padding when ticker is visible */
body.ticker-visible {
    padding-bottom: var(--ticker-height) !important;
}

/* "Show ticker" floating button */
#omx-show-ticker-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    background: var(--primary-color, #f06292);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-family: inherit;
}

[dir="rtl"] #omx-show-ticker-btn {
    right: auto;
    left: 20px;
}

#omx-show-ticker-btn:hover {
    background: var(--primary-dark, #ec407a);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#omx-show-ticker-btn:focus {
    outline: 2px solid rgba(240, 98, 146, 0.8);
    outline-offset: 2px;
}

#omx-show-ticker-btn:active {
    transform: translateY(0);
}

#omx-show-ticker-btn .btn-icon {
    font-size: 16px;
    line-height: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ticker-container.ticker-sticky {
        height: 56px;
    }
    
    .ticker-item {
        font-size: 13px;
        padding: 0 16px;
    }
    
    .ticker-item-callcenter {
        padding: 0 18px;
    }
    
    .ticker-image {
        width: 20px;
        height: 20px;
    }
    
    .ticker-separator {
        margin: 0 8px;
    }
    
    .ticker-icon {
        font-size: 14px;
    }
    
    .ticker-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
        right: 10px;
    }
    
    .ticker-container[dir="rtl"] .ticker-close {
        left: 10px;
    }
    
    .ticker-wrapper {
        padding-right: 45px;
    }
    
    .ticker-container[dir="rtl"] .ticker-wrapper {
        padding-left: 45px;
    }
    
    /* Show ticker button mobile */
    #omx-show-ticker-btn {
        bottom: 15px;
        right: 15px;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    [dir="rtl"] #omx-show-ticker-btn {
        right: auto;
        left: 15px;
    }
}

/* Phone number LTR fix */
.phone-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    white-space: nowrap;
}
