/* =========================================================================
   Milestone-Based Upgrade Nudge — Modal Overlay
   Shared CSS for contextual upgrade messages across exercise widgets.
   ========================================================================= */

/* Backdrop */
.milestone-nudge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: nudgeBackdropIn 0.3s ease-out;
    padding: 20px;
}

@keyframes nudgeBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Card */
.milestone-nudge {
    position: relative;
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 16px;
    padding: 32px 28px;
    text-align: center;
    animation: nudgeCardIn 0.35s ease-out;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

@keyframes nudgeCardIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dismiss button */
.milestone-nudge-dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #92400e;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.milestone-nudge-dismiss:hover {
    opacity: 1;
}

.milestone-nudge-dismiss:focus-visible {
    outline: 2px solid #92400e;
    outline-offset: 2px;
    border-radius: 4px;
    opacity: 1;
}

/* Content area */
.milestone-nudge-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.milestone-nudge-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.milestone-nudge-text {
    font-size: 1rem;
    color: #78350f;
    line-height: 1.5;
    margin: 0;
    max-width: 360px;
}

/* CTA button */
.milestone-nudge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 48px;
}

.milestone-nudge-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.milestone-nudge-btn:focus-visible {
    outline: 2px solid #92400e;
    outline-offset: 2px;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .milestone-nudge-overlay {
        padding: 16px;
    }

    .milestone-nudge {
        padding: 28px 20px;
    }

    .milestone-nudge-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .milestone-nudge {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .milestone-nudge-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* =========================================================================
   Accessibility
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    .milestone-nudge-overlay {
        animation: none;
    }

    .milestone-nudge {
        animation: none;
    }

    .milestone-nudge-btn {
        transition: none;
    }

    .milestone-nudge-btn:hover {
        transform: none;
    }

    .milestone-nudge-dismiss {
        transition: none;
    }
}
