/* ============================================
   GIFT POPUP — Copy Culture Studio
   Minimal + Glow Design
   ============================================ */

/* --- Overlay --- */
.mg-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1rem;
}
.mg-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Popup Container (Minimal + Glow) --- */
.mg-popup {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2.5rem 2.5rem;
    text-align: center;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 0 120px -30px rgba(139, 92, 246, 0.35),
        0 0 60px -15px rgba(236, 72, 153, 0.2),
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.mg-overlay.active .mg-popup {
    transform: translateY(0) scale(1);
}

/* --- Close Button --- */
.mg-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}
.mg-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* --- Icon (Glow) --- */
.mg-icon-wrap {
    margin-bottom: 1rem;
}
.mg-icon {
    font-size: 3.2rem;
    line-height: 1;
    animation: mg-float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
}
.mg-icon-celebrate {
    animation: mg-celebrate 0.6s ease-out;
}

@keyframes mg-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes mg-celebrate {
    0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --- Typography --- */
.mg-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
}
.mg-title-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.5rem;
    white-space: nowrap;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.3));
}
.mg-subtitle-hero {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}
.mg-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.mg-tagline {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.03em;
    margin-bottom: 1.25rem;
}

/* --- Form --- */
.mg-form {
    margin-bottom: 1rem;
}
.mg-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mg-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--color-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.mg-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.mg-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 0 20px -5px rgba(139, 92, 246, 0.15);
}
.mg-submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--gradient-brand);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 40px -8px rgba(139, 92, 246, 0.5);
}
.mg-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px -12px rgba(139, 92, 246, 0.6);
}
.mg-submit:active {
    transform: translateY(0);
}

/* --- Fine Print --- */
.mg-fine {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.5;
    margin-top: 0.75rem;
}
.mg-fine-white {
    color: #fff;
    opacity: 0.85;
}

/* --- Countdown Block (Minimal + Glow) --- */
.mg-countdown-block {
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.mg-countdown-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.4));
    animation: mg-pulse 2s ease-in-out infinite;
    transition: filter 0.3s;
}
.mg-countdown-number.mg-urgent {
    background: linear-gradient(135deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3));
    animation: mg-pulse-urgent 0.8s ease-in-out infinite;
}
@keyframes mg-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
@keyframes mg-pulse-urgent {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

/* --- CTA Button --- */
.mg-cta {
    display: block;
    width: 100%;
    padding: 0.9rem 2rem;
    background: var(--gradient-brand);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 40px -8px rgba(139, 92, 246, 0.5);
    text-decoration: none;
    text-align: center;
}
.mg-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px -12px rgba(139, 92, 246, 0.6);
}

/* --- Transition between states --- */
.mg-state {
    animation: mg-fadeIn 0.4s ease-out;
}
@keyframes mg-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .mg-overlay {
        padding: 0.75rem;
        align-items: center;
    }
    .mg-popup {
        padding: 2rem 1.25rem 1.75rem;
        max-width: 100%;
        box-shadow:
            0 0 80px -20px rgba(139, 92, 246, 0.3),
            0 15px 30px -10px rgba(0, 0, 0, 0.5);
    }
    .mg-close {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.25rem;
        width: 28px;
        height: 28px;
    }
    .mg-icon-wrap {
        margin-bottom: 0.75rem;
    }
    .mg-icon {
        font-size: 2.5rem;
    }
    .mg-title {
        font-size: 1.15rem;
        margin-bottom: 0.35rem;
    }
    .mg-title-gradient {
        font-size: 1.15rem;
    }
    .mg-subtitle-hero {
        font-size: 0.88rem;
    }
    .mg-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    .mg-countdown-block {
        margin-bottom: 1rem;
    }
    .mg-countdown-number {
        font-size: 2.2rem;
    }
    .mg-input {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
    }
    .mg-submit {
        padding: 0.75rem 1.25rem;
        font-size: 0.92rem;
    }
    .mg-fine {
        font-size: 0.7rem;
    }
    .mg-dismiss-link {
        font-size: 0.72rem;
    }
}

/* --- Dismiss Link --- */
.mg-dismiss-link {
    display: inline-block;
    margin-top: 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.mg-dismiss-link:hover {
    opacity: 0.8;
}
