/*
 * Upgrade CTA Components
 *
 * Styles for subscription upgrade prompts: horizontal warning banners and
 * full-width locked feature cards. Complements Bootstrap utility classes used
 * in the upgrade_cta.html.twig macro library.
 *
 * Components:
 *   .upgrade-cta-banner        — Horizontal at-limit warning banner
 *   .upgrade-cta-locked        — Full-width locked feature placeholder card
 *   .upgrade-cta-icon-circle   — Premium gradient icon circle
 *   .upgrade-cta-btn           — Green pill upgrade button
 */

/* -------------------------------------------------------------------------
 * Banner — horizontal at-limit warning
 * Extends .alert.alert-warning with a stronger left border accent and
 * flex layout to push the upgrade button to the right.
 * ------------------------------------------------------------------------- */
.upgrade-cta-banner {
    border-left: 4px solid var(--color-warning);
    background-color: rgba(230, 123, 9, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    /* Override Bootstrap's default alert bottom-border from alerts.css */
    border-top: none;
    border-right: none;
    border-bottom: none;
}

/* Dismissible variant needs extra right padding to not overlap the close button */
.upgrade-cta-banner.alert-dismissible {
    padding-right: 3rem;
}

.upgrade-cta-banner__icon {
    color: var(--color-warning);
    font-size: 1rem;
    flex-shrink: 0;
}

.upgrade-cta-banner__message {
    font-size: 0.9rem;
    color: var(--color-dark);
    line-height: 1.4;
}

/* -------------------------------------------------------------------------
 * Locked card — full-width placeholder for inaccessible features
 * ------------------------------------------------------------------------- */
.upgrade-cta-locked {
    background-color: var(--color-light);
    border: 2px dashed var(--color-green);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    min-height: 200px;
}

.upgrade-cta-locked__title {
    font-family: 'Poppins', 'Mulish', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-navy);
    margin: 0;
}

.upgrade-cta-locked__description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    max-width: 460px;
    line-height: 1.6;
    margin: 0;
}

/* -------------------------------------------------------------------------
 * Premium icon circle — gradient background with centered icon
 * ------------------------------------------------------------------------- */
.upgrade-cta-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(54, 224, 160, 0.35);
    flex-shrink: 0;
}

.upgrade-cta-icon-circle i {
    font-size: 1.5rem;
    color: var(--color-on-green-dark);
    line-height: 1;
}

/* -------------------------------------------------------------------------
 * Upgrade button — green pill CTA
 * Uses design system color tokens. Navy text on green background matches
 * the WCAG-compliant pattern established for .bg-green in utilities.css.
 * ------------------------------------------------------------------------- */
.upgrade-cta-btn {
    --bs-btn-bg: var(--color-green);
    --bs-btn-color: var(--color-navy);
    --bs-btn-hover-bg: var(--color-green-dark);
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-active-bg: var(--color-green-dark);
    --bs-btn-active-color: var(--color-white);
    --bs-btn-border-radius: var(--radius-pill);
    --bs-btn-border-width: 0;
    --bs-btn-padding-x: 1.25rem;
    --bs-btn-padding-y: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.upgrade-cta-btn:hover {
    box-shadow: 0 4px 12px rgba(54, 224, 160, 0.4);
}

/* Smaller variant used inside the banner */
.upgrade-cta-btn--sm {
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: 0.375rem;
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------------
 * Banner context overrides
 * Bootstrap's .alert sets an inherited `color` on all descendants, which
 * overrides the button's --bs-btn-color CSS variable. These rules restore
 * the correct navy/white colors for the upgrade button inside the banner.
 * ------------------------------------------------------------------------- */
.upgrade-cta-banner .upgrade-cta-btn,
.upgrade-cta-banner .upgrade-cta-btn:visited {
    color: var(--color-navy);
}

.upgrade-cta-banner .upgrade-cta-btn:hover,
.upgrade-cta-banner .upgrade-cta-btn:focus {
    color: var(--color-white);
}

/* -------------------------------------------------------------------------
 * Locked add-portfolio link — shown in edit sidebar when user is at limit.
 * Mirrors the visual weight of the .action-add-portfolio link but signals
 * that the action is unavailable without inline styles.
 * ------------------------------------------------------------------------- */
.action-add-portfolio--locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Responsive adjustments
 * ------------------------------------------------------------------------- */
@media (max-width: 576px) {
    .upgrade-cta-banner {
        padding: 0.75rem;
    }

    .upgrade-cta-banner.alert-dismissible {
        padding-right: 2.75rem;
    }

    .upgrade-cta-locked {
        padding: 2rem 1.25rem;
    }

    .upgrade-cta-locked__description {
        max-width: 100%;
    }
}
