/**
 * CSS стилі для ProgressPanel
 *
 * @package SPU
 */

/* Основні стилі модального вікна */
.spu-progress-modal {
    position: fixed;
    z-index: var(--spu-z-critical);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
}

.spu-progress-modal.spu-progress-modal-visible {
    opacity: 1;
    transform: scale(1);
}

/* Оверлей */
.spu-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

/* Контейнер вмісту */
.spu-progress-content {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 600px;
    width: auto;
    max-height: 80vh;
    overflow: hidden;
}

/* Анімація появи */
@keyframes spuModalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Заголовок */
.spu-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /*
    padding: 4px 4px 0 4px;
    */
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 8px;
    background: #007cba;
    color: white;
    border-radius: 6px 6px 0 0;
}

.spu-progress-title {
    margin: 4px;
    font-size: 12px;
    font-weight: 600;
}

.spu-progress-close {
    background: none;
    border: none;
    font-size: 10px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.spu-progress-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Тіло модального вікна */
.spu-progress-body {
    padding: 0 8px 8px 8px;
}

/* Крок прогресу */
.spu-progress-step {
    text-align: left;
}

.spu-progress-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 500;
    min-height: 20px;
    line-height: 1.4;
    display: none;
}

/* Контейнер прогрес-бару */
.spu-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    /*
    margin-bottom: 16px;
    */
}

/* Сам прогрес-бар */
.spu-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #005a87 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.spu-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: spuProgressShine 2s infinite;
}

/* Анімація блиску */
@keyframes spuProgressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Деталі процесу */
.spu-progress-details {
    margin-top: 8px;
    padding: 4px 4px 4px 0px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007cba;
}

.spu-progress-details ul {
    margin: 0;
    padding-left: 8px;
    list-style: none;
}

.spu-progress-details li {
    font-size: 13px;
    color: #666;
    margin-bottom: 1px;
    position: relative;
}

.spu-progress-details li::before {
    content: '○';
    color: #666;
    font-weight: bold;
    margin-right: 8px;
}

.spu-progress-details li.current {
    color: #007cba;
    font-weight: 500;
}

.spu-progress-details li.current::before {
    content: '֍';
    /*content: '⟳';*/
    color: #007cba;
    display: inline-block;
    animation: spuSpin 1s linear infinite;
}

.spu-progress-details li.completed::before {
    content: '✓';
    color: #28a745;
    animation: none;
}

/* Анімація обертання */
@keyframes spuSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стан помилки */
.spu-progress-modal.error .spu-progress-bar {
    background: #dc3545;
}

.spu-progress-modal.error .spu-progress-text {
    color: #dc3545;
}

/* Стан успіху */
.spu-progress-modal.success .spu-progress-bar {
    background: #28a745;
}

.spu-progress-modal.success .spu-progress-text {
    color: #28a745;
}

/* Кнопка */
.spu-progress-button-container {
    text-align: center;
    margin-top: 8px;   
}

.spu-progress-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 4px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.spu-progress-button:hover:not(:disabled) {
    background: #005a87;
}

.spu-progress-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Темна тема (якщо потрібно) */
@media (prefers-color-scheme: dark) {
    .spu-progress-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .spu-progress-header {
        border-bottom-color: #404040;
    }

    .spu-progress-close:hover {
        background: #404040;
    }

    .spu-progress-bar-container {
        background: #404040;
    }

    .spu-progress-details {
        background: #333;
        border-left-color: #007cba;
    }
}