/**
 * 2012 - 2025 HiPresta.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0).
 * It is also available through the world-wide-web at this URL: https://opensource.org/licenses/AFL-3.0
 *
 * @author    HiPresta <support@hipresta.com>
 * @copyright HiPresta 2025
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 *
 * @website   https://hipresta.com
 */

/* Wrapper around download block */
.hipdfcatalog-download-button {
    margin: 20px 0;
}

/* Card-style block */
.hipdfcatalog-download-card {
    border-radius: 8px;
    border: 1px solid #e3e5ef;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hipdfcatalog-download-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.hipdfcatalog-download-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hipdfcatalog-download-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.hipdfcatalog-download-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hipdfcatalog-download-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.hipdfcatalog-download-card-subtitle {
    font-size: 12px;
    color: #6b7280;
}

/* CTA button inside card */
.hipdfcatalog-btn {
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}

.hipdfcatalog-btn:hover {
    opacity: 0.96;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.hipdfcatalog-btn i {
    margin-right: 2px;
    font-size: 13px;
}

.hipdfcatalog-download-card-meta {
    margin-top: 2px;
    font-size: 11px;
    color: #9ca3af;
}

/* Inline batched-generation progress (replaces card-main + card-meta while a job is running). */
.hipdfcatalog-download-card-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: hipdfcatalogInlineFadeIn 0.2s ease-out;
}

@keyframes hipdfcatalogInlineFadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hipdfcatalog-download-card-progress-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hipdfcatalog-download-card-progress-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 6px rgba(118, 75, 162, 0.25);
}

.hipdfcatalog-download-card-progress-icon::before,
.hipdfcatalog-download-card-progress-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(118, 75, 162, 0.5);
    opacity: 0;
    transform: scale(0.85);
    animation: hipdfcatalogPulseRing 1.6s ease-out infinite;
}

.hipdfcatalog-download-card-progress-icon::after {
    animation-delay: 0.8s;
}

@keyframes hipdfcatalogPulseRing {
    0%   { opacity: 0.55; transform: scale(0.85); }
    80%  { opacity: 0;    transform: scale(1.45); }
    100% { opacity: 0;    transform: scale(1.45); }
}

.hipdfcatalog-download-card-progress-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.hipdfcatalog-download-card-progress-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    line-height: 1.2;
}

.hipdfcatalog-download-card-progress-status {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hipdfcatalog-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #eef0f5;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.hipdfcatalog-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease-out;
}

.hipdfcatalog-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.hipdfcatalog-progress-percent {
    font-weight: 600;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.hipdfcatalog-progress-cancel {
    color: #6b7280;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    transition: color 0.15s ease;
}

.hipdfcatalog-progress-cancel:hover,
.hipdfcatalog-progress-cancel:focus {
    color: #ef4444;
    text-decoration: none;
}

/* Inline alert (popup-blocked fallback link / error / cancellation). */
.hipdfcatalog-download-card-alert {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid transparent;
    animation: hipdfcatalogInlineFadeIn 0.2s ease-out;
}

.hipdfcatalog-download-card-alert--info {
    background: #eef2ff;
    border-color: #d8dfff;
    color: #3a3f80;
}

.hipdfcatalog-download-card-alert--error {
    background: #fdecec;
    border-color: #f5c2c2;
    color: #a8332a;
}

.hipdfcatalog-download-card-alert--success {
    background: #e9f8ef;
    border-color: #b8e2c5;
    color: #1f7a45;
}

.hipdfcatalog-download-card-alert-text {
    flex: 1;
    min-width: 0;
}

.hipdfcatalog-download-card-alert-action {
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
}

.hipdfcatalog-download-card-alert-action:hover,
.hipdfcatalog-download-card-alert-action:focus {
    text-decoration: none;
    color: inherit;
}

/* Mobile: keep the percent + cancel row legible on narrow viewports. */
@media (max-width: 480px) {
    .hipdfcatalog-download-card-progress-head {
        gap: 10px;
    }

    .hipdfcatalog-download-card-progress-icon {
        width: 28px;
        height: 28px;
    }
}

