/* ===================================================
   Pro Subscription Encouragement Appeal Modal Styles
   Uses CoderLegion CSS Theme Variables from main-styles.css
   =================================================== */

body.cl-pro-modal-open {
    overflow: hidden !important;
}

.cl-pro-appeal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.cl-pro-appeal-overlay.cl-show {
    opacity: 1;
    visibility: visible;
}

.cl-pro-appeal-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 36px);
    max-height: calc(100dvh - 36px);
    background: var(--popup-bg);
    color: var(--body-deep);
    border: 1px solid var(--item-separator);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transform: scale(0.94) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cl-pro-appeal-overlay.cl-show .cl-pro-appeal-card {
    transform: scale(1) translateY(0);
}

/* Fixed Header */
.cl-pro-appeal-header {
    flex-shrink: 0;
    padding: 20px 24px 14px 24px;
    padding-right: 48px;
    border-bottom: 1px solid var(--item-separator);
    background: var(--popup-bg);
}

.cl-pro-appeal-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    color: var(--on-popup, var(--body-deep));
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Close Button */
.cl-pro-appeal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary-btn-bg, rgba(155, 155, 155, 0.12));
    border: none;
    color: var(--body-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.cl-pro-appeal-close:hover {
    background: var(--item-separator);
    color: var(--body-deep);
    transform: scale(1.08);
}

/* Scrollable Middle Body */
.cl-pro-appeal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 24px;
}

/* Custom Scrollbar for Body */
.cl-pro-appeal-body::-webkit-scrollbar {
    width: 6px;
}

.cl-pro-appeal-body::-webkit-scrollbar-track {
    background: transparent;
}

.cl-pro-appeal-body::-webkit-scrollbar-thumb {
    background: var(--item-separator);
    border-radius: 4px;
}

.cl-pro-appeal-body::-webkit-scrollbar-thumb:hover {
    background: var(--body-lite);
}

/* Progress Section */
.cl-pro-appeal-progress-wrap {
    background: rgba(var(--highlight-rgb, 155, 155, 155), 0.08);
    border: 1px solid var(--item-separator);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.cl-pro-appeal-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--body-deep);
    margin-bottom: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cl-pro-appeal-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--item-separator);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.cl-pro-appeal-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--success, #0b8043) 0%, var(--accent, #1d9bf0) 100%);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(var(--accent-rgb, 29, 155, 240), 0.4);
}

/* Story Section */
.cl-pro-appeal-story {
    margin-bottom: 14px;
}

.cl-pro-appeal-story p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--body-gray);
    margin: 0 0 10px 0;
}

.cl-pro-appeal-story p:last-child {
    margin-bottom: 0;
}

/* Social Proof Banner */
.cl-pro-appeal-proof {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--error-rgb, 175, 0, 32), 0.1);
    border: 1px solid rgba(var(--error-rgb, 175, 0, 32), 0.25);
    color: var(--error);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    margin: 8px 0 14px 0;
}

.cl-pro-appeal-proof .heart-icon {
    color: var(--error);
}

/* Section Headings */
.cl-pro-appeal-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--body-deep);
    margin: 14px 0 8px 0;
}

/* Checklists */
.cl-pro-appeal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cl-pro-appeal-list li {
    display: flex;
    align-items: baseline;
    gap: 9px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--body-gray);
}

.cl-pro-appeal-list .cl-check {
    color: var(--success);
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.cl-pro-appeal-list .cl-perk-icon {
    flex-shrink: 0;
    font-size: 14px;
}

/* Scroll Indicator (Bottom Gradient Fade) */
.cl-pro-appeal-scroll-indicator {
    position: relative;
    height: 0;
    pointer-events: none;
    z-index: 10;
}

.cl-pro-appeal-scroll-indicator::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, var(--popup-bg) 95%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.cl-pro-appeal-card.can-scroll-down .cl-pro-appeal-scroll-indicator::before {
    opacity: 1;
}

/* Centered Scroll Down Arrow Button */
.cl-pro-appeal-scroll-down-btn {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(var(--accent-rgb, 29, 155, 240), 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 12;
}

.cl-pro-appeal-scroll-down-btn .material-symbols-rounded {
    font-family: "Material Symbols Rounded" !important;
    font-size: 22px;
    line-height: 1.2;
    height: 22px;
    color: var(--on-accent) !important;
    user-select: none;
    display: inline-block;
}

.cl-pro-appeal-card.can-scroll-down .cl-pro-appeal-scroll-down-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    animation: cl-bounce-subtle 2s infinite ease-in-out;
}

.cl-pro-appeal-scroll-down-btn:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb, 29, 155, 240), 0.6);
    transform: translateX(-50%) scale(1.12);
}

@keyframes cl-bounce-subtle {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-4px);
    }

    60% {
        transform: translateX(-50%) translateY(-2px);
    }
}

/* Fixed Actions Footer */
.cl-pro-appeal-actions {
    flex-shrink: 0;
    padding: 14px 24px 18px 24px;
    background: var(--popup-bg);
    border-top: 1px solid var(--item-separator);
    text-align: center;
    position: relative;
    z-index: 15;
}

.cl-pro-appeal-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: var(--accent);
    color: var(--on-accent) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb, 29, 155, 240), 0.35);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cl-pro-appeal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb, 29, 155, 240), 0.45);
    filter: brightness(1.08);
    color: var(--on-accent) !important;
}

.cl-pro-appeal-btn-primary:active {
    transform: translateY(0);
}

.cl-pro-appeal-subtext {
    font-size: 12px;
    color: var(--body-lite);
    margin: 6px 0 0 0;
    text-align: center;
}

.cl-pro-appeal-dismiss {
    display: inline-block;
    background: none;
    border: none;
    color: var(--body-gray);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    margin-top: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.cl-pro-appeal-dismiss:hover {
    color: var(--body-deep);
    text-decoration: underline;
}

/* ===================================================
   Mobile Responsiveness
   =================================================== */
@media (max-width: 520px) {
    .cl-pro-appeal-overlay {
        padding: 10px;
    }

    .cl-pro-appeal-card {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 16px;
    }

    .cl-pro-appeal-header {
        padding: 16px 16px 12px 16px;
        padding-right: 44px;
    }

    .cl-pro-appeal-title {
        font-size: 16px;
    }

    .cl-pro-appeal-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .cl-pro-appeal-body {
        padding: 14px 16px;
    }

    .cl-pro-appeal-actions {
        padding: 12px 16px 14px 16px;
    }

    .cl-pro-appeal-btn-primary {
        padding: 12px 14px;
        font-size: 14px;
    }

    .cl-pro-appeal-subtext {
        font-size: 11.5px;
    }
}