/**
 * Frontend Styles - Topbar Rotating Banner
 */

.trb-banner-slider {
    position: relative;
    overflow: hidden;
    z-index: 1000;
}

.trb-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slides Container */
.trb-banner-slides {
    position: relative;
    flex: 1;
    height: 20px;
    overflow: hidden;
    margin: 0 70px; /* Space for absolute positioned controls */
}

.trb-banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.trb-banner-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.trb-slide-content {
    text-align: center;
    line-height: 1.4;
}

.trb-slide-content p {
    margin: 0;
}

.trb-slide-content a {
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.trb-slide-content a:hover {
    opacity: 0.8;
}

/* Pagination Left */
.trb-banner-pagination {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    z-index: 10;
}

.trb-pagination-text {
    font-weight: 500;
    opacity: 0.9;
}

/* Controls Right */
.trb-banner-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

/* Progress Ring */
.trb-progress-ring {
    transform: rotate(-90deg);
}

.trb-progress-bg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    opacity: 0.3;
}

.trb-progress-fg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-dasharray: 31.4159;
    stroke-dashoffset: 31.4159;
    transition: stroke-dashoffset 0.05s linear;
}

.trb-banner-slider.playing .trb-progress-fg {
    /* Animation handled by JavaScript for smooth progress */
}

/* Play/Pause Button */
.trb-pause-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.trb-pause-btn:hover {
    opacity: 0.7;
}

.trb-pause-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

.trb-play-pause-icon {
    width: 16px;
    height: 16px;
}

.trb-banner-slider.paused .trb-pause-icon {
    display: none;
}

.trb-banner-slider.paused .trb-play-icon {
    display: block !important;
}

.trb-banner-slider.playing .trb-pause-icon {
    display: block;
}

.trb-banner-slider.playing .trb-play-icon {
    display: none;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .trb-banner-slides {
        margin: 0 55px; /* Space for controls on mobile */
    }
    
    .trb-slide-content {
        font-size: 13px;
    }
    
    .trb-banner-pagination {
        gap: 4px;
    }
    
    .trb-banner-controls {
        gap: 8px;
    }
}

@media screen and (max-width: 480px) {
    .trb-banner-slides {
        margin: 0 50px; /* Even more compact */
    }
    
    .trb-slide-content {
        font-size: 12px;
    }
    
    .trb-pagination-text {
        font-size: 11px;
    }
    
    .trb-progress-ring {
        width: 10px;
        height: 10px;
    }
    
    .trb-play-pause-icon {
        width: 14px;
        height: 14px;
    }
}

/* Accessibility */
.trb-banner-slider:focus-within .trb-pause-btn {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .trb-banner-slide {
        transition: opacity 0.3s ease;
        transform: none !important;
    }
    
    .trb-progress-fg {
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .trb-banner-slider {
        display: none;
    }
}
