/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Shared styling for the AI Infographic generator card used on Admixture,
 * Shared Modern Origins, and Shared Roots ancestry pages. Targets the existing
 * .adx-result-card framework and inherits its theme variables (--adx-gold,
 * --adx-bg-parchment, --adx-text-dark, etc.).
 */

/* =============================================
   Header meta chips
   ============================================= */

.adx-infographic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.adx-infographic-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--adx-text-dark, #2a2520);
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.adx-infographic-chip i {
    color: var(--adx-gold, #c9a430);
    font-size: 0.75rem;
}

.adx-infographic-chip-credits {
    color: var(--adx-gold-dark, #8a6f1f);
    background-color: rgba(201, 164, 48, 0.08);
    border-color: rgba(201, 164, 48, 0.25);
}

/* =============================================
   Body layout zones
   ============================================= */

.adx-infographic-primary {
    margin-bottom: 1rem;
}

.adx-infographic-description {
    color: #5d5750;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.adx-infographic-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.adx-infographic-actions .infographic-language-selector {
    margin: 0;
    min-width: 200px;
    flex: 0 1 240px;
}

.adx-infographic-generate {
    flex: 0 0 auto;
    min-width: 200px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(201, 164, 48, 0.2);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.adx-infographic-generate:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(201, 164, 48, 0.28);
}

.adx-infographic-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   Secondary toolbar (credits + utility buttons)
   ============================================= */

.adx-infographic-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.adx-infographic-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.adx-infographic-toolbar-actions .btn {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
}

/* =============================================
   Credits pill
   ============================================= */

.adx-credits-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    background-color: rgba(201, 164, 48, 0.08);
    border: 1px solid rgba(201, 164, 48, 0.25);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--adx-text-dark, #2a2520);
}

.adx-credits-pill > i {
    color: var(--adx-gold, #c9a430);
    font-size: 0.85rem;
}

.adx-credits-pill-label {
    color: #6b6055;
    font-weight: 500;
}

.adx-credits-pill-value {
    font-weight: 700;
    color: var(--adx-text-dark, #2a2520);
}

.adx-credits-pill-value i {
    color: var(--adx-gold, #c9a430);
}

/* =============================================
   Status shell (progress UI wrapper)
   ============================================= */

.adx-infographic-status-shell {
    margin-top: 1rem;
}

.adx-infographic-status-shell .alert {
    position: relative;
    padding: 0.85rem 1rem 0.85rem 2.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
    border-left-width: 4px;
    margin-bottom: 0;
    overflow: hidden;
}

.adx-infographic-status-shell .alert::before {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adx-infographic-status-shell .alert-info {
    background-color: rgba(201, 164, 48, 0.06);
    border-color: rgba(201, 164, 48, 0.3);
    border-left-color: var(--adx-gold, #c9a430);
    color: #5a4a1f;
}

.adx-infographic-status-shell .alert-info::before {
    content: "\f0d0";
    color: var(--adx-gold, #c9a430);
    animation: adxInfographicPulse 1.4s ease-in-out infinite;
}

.adx-infographic-status-shell .alert-info::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 35%;
    background: linear-gradient(90deg,
        rgba(201, 164, 48, 0) 0%,
        rgba(201, 164, 48, 0.9) 50%,
        rgba(201, 164, 48, 0) 100%);
    animation: adxInfographicProgress 1.6s ease-in-out infinite;
}

.adx-infographic-status-shell .alert-success {
    background-color: rgba(40, 167, 69, 0.08);
    border-color: rgba(40, 167, 69, 0.3);
    border-left-color: #28a745;
    color: #1e6b34;
}

.adx-infographic-status-shell .alert-success::before {
    content: "\f00c";
    color: #28a745;
}

.adx-infographic-status-shell .alert-success a {
    color: #1e6b34;
    font-weight: 600;
    text-decoration: underline;
}

.adx-infographic-status-shell .alert-danger {
    background-color: rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.3);
    border-left-color: #dc3545;
    color: #842029;
}

.adx-infographic-status-shell .alert-danger::before {
    content: "\f071";
    color: #dc3545;
}

@keyframes adxInfographicProgress {
    0% { left: -35%; }
    100% { left: 100%; }
}

@keyframes adxInfographicPulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.55; transform: translateY(-50%) scale(0.92); }
}

/* =============================================
   Locked / unlicensed state
   ============================================= */

.adx-infographic-locked {
    text-align: center;
    padding: 1.25rem 1rem 0.5rem;
}

.adx-infographic-locked-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(201, 164, 48, 0.12);
    border: 1px solid rgba(201, 164, 48, 0.3);
    color: var(--adx-gold, #c9a430);
    font-size: 1.4rem;
}

.adx-infographic-locked-title {
    font-family: var(--adx-font-display, inherit);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--adx-text-dark, #2a2520);
    margin-bottom: 0.4rem;
}

.adx-infographic-locked-description {
    font-size: 0.875rem;
    color: #6b6055;
    max-width: 460px;
    margin: 0 auto 1rem;
    line-height: 1.55;
}

.adx-infographic-locked-cta {
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
}

.adx-infographic-locked-cta i {
    margin-right: 0.4rem;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 575.98px) {
    .adx-infographic-chips {
        margin-left: 0;
        flex-basis: 100%;
        margin-top: 0.5rem;
    }

    .adx-infographic-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .adx-infographic-actions .infographic-language-selector {
        width: 100%;
        flex: 1 1 auto;
    }

    .adx-infographic-generate {
        width: 100%;
    }

    .adx-infographic-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .adx-infographic-toolbar-actions {
        justify-content: stretch;
    }

    .adx-infographic-toolbar-actions .btn {
        flex: 1 1 auto;
    }

    .adx-credits-pill {
        justify-content: center;
    }
}

/* =============================================
   Print
   ============================================= */

@media print {
    .adx-infographic-actions,
    .adx-infographic-toolbar,
    .adx-infographic-status-shell,
    .adx-infographic-locked-cta {
        display: none !important;
    }
}
