/* 
 * Progress Bar Widget Styles
 * 
 * @package DinoPack
 * @since 1.0.0
 */

/* Common Styles */
.dinopack-progress-bar {
    margin-bottom: 30px;
    position: relative;
}

.dinopack-progress-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dinopack-progress-bar-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.dinopack-progress-bar-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.dinopack-progress-bar-label-prefix,
.dinopack-progress-bar-label-text,
.dinopack-progress-bar-label-suffix {
    display: inline-block;
}

/* Line Progress Bar */
.dinopack-progress-bar-line .dinopack-progress-bar-container {
    position: relative;
    width: 100%;
}

.dinopack-progress-bar-line .dinopack-progress-bar-track {
    width: 100%;
    height: 20px;
    background-color: #E8F5E8;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.dinopack-progress-bar-line .dinopack-progress-bar-progress {
    width: 0;
    height: 100%;
    background-color: #6F9C50;
    border-radius: 10px;
    transition: width var(--progress-transition-duration, 1500ms) ease-in-out;
    position: relative;
    overflow: hidden;
}

.dinopack-progress-bar-line .dinopack-progress-bar-header-inside {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 15px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.dinopack-progress-bar-line .dinopack-progress-bar-header-inside .dinopack-progress-bar-title,
.dinopack-progress-bar-line .dinopack-progress-bar-header-inside .dinopack-progress-bar-label {
    color: #fff;
    margin: 0;
}

/* Circle Progress Bar */
.dinopack-progress-bar-circle {
    text-align: center;
}

.dinopack-progress-bar-circle-container {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.dinopack-progress-bar-circle svg {
    display: block;
    margin: 0 auto;
}

.dinopack-progress-bar-circle svg circle {
    stroke-linecap: round;
    transition: stroke-dashoffset var(--progress-transition-duration, 1500ms) ease-in-out;
}

.dinopack-progress-bar-circle svg .track {
    stroke: #E8F5E8;
    fill: none;
    stroke-width: 20;
}

.dinopack-progress-bar-circle svg .path {
    stroke: #6F9C50;
    fill: none;
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
    stroke-width: 20;
    stroke-linecap: round;
}

.dinopack-progress-bar-circle-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.dinopack-progress-bar-circle svg {
    transform: rotate(-90deg);
}

/* Circle title positioning */
.dinopack-progress-bar-circle .dinopack-progress-bar-header {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animation States */
.dinopack-progress-bar-animated .dinopack-progress-bar-progress {
    animation: dinopack-progress-bar-fill var(--progress-transition-duration, 1500ms) ease-in-out forwards;
}

.dinopack-progress-bar-animated svg .path {
    animation: dinopack-progress-bar-stroke var(--progress-transition-duration, 1500ms) ease-in-out forwards;
}

/* Keyframe Animations */
@keyframes dinopack-progress-bar-fill {
    from {
        width: 0;
    }
    to {
        width: var(--progress-percentage, 75%);
    }
}

@keyframes dinopack-progress-bar-stroke {
    from {
        stroke-dashoffset: var(--circumference, 0);
    }
    to {
        stroke-dashoffset: var(--progress-offset, 0);
    }
}

/* Progress Bar Loading State */
.dinopack-progress-bar-loading .dinopack-progress-bar-progress {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: dinopack-progress-bar-shimmer 1.5s infinite;
}

@keyframes dinopack-progress-bar-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}


/* Responsive Styles */
@media (max-width: 767px) {
    .dinopack-progress-bar-title {
        font-size: 14px;
    }
    
    .dinopack-progress-bar-label {
        font-size: 12px;
    }
    
    .dinopack-progress-bar-circle-label {
        font-size: 18px;
    }
    
    .dinopack-progress-bar-line .dinopack-progress-bar-header-inside {
        padding: 0 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .dinopack-progress-bar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .dinopack-progress-bar-circle-label {
        font-size: 16px;
    }
}

/* Accessibility */
.dinopack-progress-bar[role="progressbar"] {
    position: relative;
}

.dinopack-progress-bar[role="progressbar"]::after {
    content: attr(aria-label);
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Print Styles */
@media print {
    .dinopack-progress-bar {
        break-inside: avoid;
    }
    
    .dinopack-progress-bar-progress {
        transition: none !important;
        animation: none !important;
    }
    
    .dinopack-progress-bar-circle svg .path,
    .dinopack-progress-bar-half-circle svg .path {
        transition: none !important;
        animation: none !important;
    }
}