/**
 * Reading Progress Bar Widget Styles
 * Modern and responsive design with smooth animations
 */

.reading-progress-widget {
    position: relative;
    width: 100%;
}

/* Progress Bar Container */
.reading-progress-bar {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 10000;
    overflow: visible;
    transition: all 0.3s ease;
}

.reading-progress-bar.position-top {
    top: 0;
    bottom: auto;
}

.reading-progress-bar.position-bottom {
    bottom: 0;
    top: auto;
}

/* Progress Fill */
.reading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007cba 0%, #005a87 100%);
    transition: width 0.3s ease-out;
    border-radius: inherit;
}

/* Animation Styles */
.reading-progress-bar.animation-smooth .reading-progress-fill {
    transition: width 0.3s ease-out;
}

.reading-progress-bar.animation-stepped .reading-progress-fill {
    transition: width 0.1s steps(10, end);
}

.reading-progress-bar.animation-bounce .reading-progress-fill {
    transition: width 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.reading-progress-bar.animation-elastic .reading-progress-fill {
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Percentage Text */
.reading-progress-percentage {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    z-index: 10001;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 40px;
    text-align: center;
}

.reading-progress-percentage.position-left {
    left: 10px;
}

.reading-progress-percentage.position-center {
    right: 0;
    transform: translate(-50%, -50%);
    top: 95%;
    position: fixed;
    bottom: 0px;
    height: 22px;
}

.reading-progress-percentage.position-right {
    right: 10px;
}

/* Hover Effects */
.reading-progress-bar:hover {
    opacity: 0.9;
}

.reading-progress-bar:hover .reading-progress-percentage {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.reading-progress-percentage.position-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .reading-progress-percentage {
        font-size: 12px;
        padding: 5px 8px;
        min-width: 35px;
    }
    
    .reading-progress-percentage.position-left {
        left: 8px;
    }
    
    .reading-progress-percentage.position-right {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .reading-progress-percentage {
        font-size: 11px;
        padding: 4px 7px;
        min-width: 32px;
    }
    
    .reading-progress-percentage.position-left {
        left: 5px;
    }
    
    .reading-progress-percentage.position-right {
        right: 5px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .reading-progress-bar {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .reading-progress-percentage {
        background-color: rgba(255, 255, 255, 0.95);
        color: #000000;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .reading-progress-bar {
        background-color: #000000;
        border: 1px solid #ffffff;
    }
    
    .reading-progress-fill {
        background: #ffffff;
    }
    
    .reading-progress-percentage {
        background-color: #000000;
        color: #ffffff;
        border: 1px solid #ffffff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .reading-progress-fill,
    .reading-progress-percentage {
        transition: none;
    }
    
    .reading-progress-bar.animation-bounce .reading-progress-fill,
    .reading-progress-bar.animation-elastic .reading-progress-fill {
        transition: width 0.1s linear;
    }
}

/* Print Styles */
@media print {
    .reading-progress-bar {
        display: none;
    }
}

/* Focus States for Accessibility */
.reading-progress-bar:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Loading State */
.reading-progress-widget.loading .reading-progress-fill {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 124, 186, 0.3) 50%, 
        transparent 100%);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Pulse Animation for Percentage */
.reading-progress-percentage.pulse {
    animation: percentage-pulse 0.3s ease-in-out;
}

@keyframes percentage-pulse {
    0% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

.reading-progress-percentage.position-center.pulse {
    animation: percentage-pulse-center 0.3s ease-in-out;
}

@keyframes percentage-pulse-center {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Gradient Animations */
.reading-progress-fill.gradient-animate {
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Elementor Editor Specific Styles */
.elementor-editor-active .reading-progress-bar {
    position: relative;
    margin: 20px 0;
}

.elementor-editor-active .reading-progress-percentage {
    opacity: 1;
}

/* Widget Container in Editor */
.elementor-editor-active .reading-progress-widget {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.elementor-editor-active .reading-progress-widget::before {
    content: "Reading Progress Bar Preview";
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}
