/* Container */
.mpa-studio-container {
    max-width: 900px;
    margin: 40px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    align-items: flex-start;
}

/* --- THE CARD CANVAS --- */
.mpa-card-preview {
    flex: 0 0 400px; 
    width: 400px;
    max-width: 400px;
    
    position: relative;
    background: #222; 
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    isolation: isolate; 
    z-index: 1;
    margin: 0 auto; 
    transition: all 0.3s ease;
}

/* --- FORMAT RATIOS --- */
.mpa-ratio-portrait { aspect-ratio: 4/5; height: auto; min-height: 500px; }
.mpa-ratio-square { aspect-ratio: 1/1; height: auto; min-height: 400px; }
.mpa-ratio-story { aspect-ratio: 9/16; height: auto; min-height: 711px; }

/* --- LAYERS --- */
#mpa-card-img {
    position: absolute;
    top: 50%; left: 50%; 
    transform: translate(-50%, -50%); 
    z-index: 1;
    max-width: none; max-height: none;
    transition: none; 
}

.mpa-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.mpa-frame-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 20; 
    border: 10px solid rgba(30, 30, 30, 0.15); 
    box-sizing: border-box; 
    transition: opacity 0.3s; 
}

/* --- STICKERS --- */
.mpa-sticker-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 50; }
.mpa-sticker { position: absolute; font-size: 60px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); display: none; }

/* Sticker Positions */
.mpa-sticker-tl { top: 25px; left: 25px; }
.mpa-sticker-tr { top: 25px; right: 25px; }
.mpa-sticker-bl { bottom: 25px; left: 25px; }
.mpa-sticker-br { bottom: 25px; right: 25px; }
.mpa-sticker-tc { top: 25px; left: 50%; transform: translateX(-50%); }
.mpa-sticker-bc { bottom: 25px; left: 50%; transform: translateX(-50%); }

/* --- GREETING TEXT LAYER --- */
.mpa-greeting-layer {
    position: absolute;
    left: 20px; right: 20px;
    text-align: center;
    pointer-events: none;
    z-index: 100;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 1 !important;
    visibility: visible !important;
    color: #ffffff; 
}

/* Fonts */
.mpa-font-modern { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; }
.mpa-font-elegant { font-family: 'Playfair Display', serif !important; }
.mpa-font-handwritten { font-family: 'Dancing Script', cursive !important; }
.mpa-font-williwaw-script { font-family: 'Pinyon Script', cursive !important; } 
.mpa-font-williwaw-normal { font-family: 'Jost', sans-serif !important; }
.mpa-font-georgia { font-family: Georgia, 'Times New Roman', Times, serif !important; }

/* Text Styling */
#mpa-display-text {
    font-weight: 300; letter-spacing: 1px; text-transform: uppercase;
    margin: 0 0 30px 0; line-height: 1.3; color: inherit; text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    font-size: 24px !important;
}

#mpa-display-signoff, #mpa-display-sender {
    font-weight: 400; margin: 0; opacity: 0.95; color: inherit; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    font-size: 18px !important; 
}
#mpa-display-signoff { margin-bottom: 5px; }
#mpa-display-sender { text-transform: capitalize; }

/* --- SHADOW TOGGLE CLASS (New) --- */
.mpa-no-shadow #mpa-display-text,
.mpa-no-shadow #mpa-display-signoff,
.mpa-no-shadow #mpa-display-sender {
    text-shadow: none !important;
}

/* Font Specifics */
.mpa-font-modern #mpa-display-text, .mpa-font-georgia #mpa-display-text, .mpa-font-williwaw-normal #mpa-display-text { text-transform: uppercase; letter-spacing: 1px; }
.mpa-size-small.mpa-font-modern #mpa-display-text, .mpa-size-small.mpa-font-georgia #mpa-display-text, .mpa-size-small.mpa-font-williwaw-normal #mpa-display-text { font-size: 20px !important; }
.mpa-size-medium.mpa-font-modern #mpa-display-text, .mpa-size-medium.mpa-font-georgia #mpa-display-text, .mpa-size-medium.mpa-font-williwaw-normal #mpa-display-text { font-size: 24px !important; }
.mpa-size-large.mpa-font-modern #mpa-display-text, .mpa-size-large.mpa-font-georgia #mpa-display-text, .mpa-size-large.mpa-font-williwaw-normal #mpa-display-text { font-size: 28px !important; }

.mpa-font-elegant #mpa-display-text { text-transform: none; font-style: italic; }
.mpa-size-small.mpa-font-elegant #mpa-display-text { font-size: 24px !important; }
.mpa-size-medium.mpa-font-elegant #mpa-display-text { font-size: 28px !important; }
.mpa-size-large.mpa-font-elegant #mpa-display-text { font-size: 32px !important; }

.mpa-font-handwritten #mpa-display-text { text-transform: none; font-weight: 700; }
.mpa-size-small.mpa-font-handwritten #mpa-display-text { font-size: 32px !important; }
.mpa-size-medium.mpa-font-handwritten #mpa-display-text { font-size: 36px !important; }
.mpa-size-large.mpa-font-handwritten #mpa-display-text { font-size: 40px !important; }

.mpa-font-williwaw-script #mpa-display-text { text-transform: none; font-weight: 400; letter-spacing: 0; }
.mpa-size-small.mpa-font-williwaw-script #mpa-display-text { font-size: 38px !important; }
.mpa-size-medium.mpa-font-williwaw-script #mpa-display-text { font-size: 42px !important; }
.mpa-size-large.mpa-font-williwaw-script #mpa-display-text { font-size: 46px !important; }

.mpa-size-small #mpa-display-signoff, .mpa-size-small #mpa-display-sender { font-size: 14px !important; }
.mpa-size-medium #mpa-display-signoff, .mpa-size-medium #mpa-display-sender { font-size: 18px !important; }
.mpa-size-large #mpa-display-signoff, .mpa-size-large #mpa-display-sender { font-size: 22px !important; }

/* Positioning */
.mpa-pos-bottom { top: auto; bottom: 80px; }
.mpa-pos-center { top: 0; bottom: 0; margin: auto; }
.mpa-pos-top    { top: 60px; bottom: auto; }
.mpa-ratio-story .mpa-pos-bottom { bottom: 120px; }
.mpa-ratio-story .mpa-pos-top { top: 100px; }
.mpa-ratio-square .mpa-pos-bottom { bottom: 60px; }

/* Brand Layer */
.mpa-brand-layer { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 100; }
.mpa-brand-mark { color: rgba(255,255,255,0.6) !important; font-size: 8px !important; letter-spacing: 2px; text-transform: uppercase; margin: 0 !important; padding: 0; line-height: 1; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; display: block; }

/* Controls */
.mpa-controls { flex: 1 1 350px; display: flex; flex-direction: column; }
.mpa-control-group { margin-bottom: 20px; }
.mpa-control-group label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: bold; }
.mpa-control-group select, .mpa-control-group input[type="text"], .mpa-control-group input[type="email"], .mpa-control-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; background: #fff; font-size: 14px; box-sizing: border-box; }
.mpa-checkbox-label { display: flex; align-items: center; cursor: pointer; font-size: 13px; margin-top: 5px; }
.mpa-checkbox-label input { margin-right: 10px; width: auto !important; }
.mpa-inputfile { width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1; }
.mpa-helper-text { display: block; font-size: 11px; color: #666; margin-top: 8px; font-style: italic; }
.mpa-actions { display: flex; gap: 10px; }
.mpa-btn { flex: 1; display: flex; align-items: center; justify-content: center; padding: 15px; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; cursor: pointer; border: 1px solid #000; transition: all 0.2s; height: 46px; background: transparent; color: #000; }
label.mpa-btn { width: 100%; margin: 0; font-weight: normal; }
.mpa-btn.fill { background: #000; color: #fff; }
.mpa-btn.outline { background: transparent; color: #000; }
.mpa-btn:hover { opacity: 0.6; }
#mpa-response { margin-top: 15px; font-size: 12px; text-align: center; }
.mpa-privacy-note { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; font-size: 13px; color: #580e00; line-height: 1.5; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    .mpa-studio-container { flex-direction: column; gap: 30px; }
    .mpa-card-preview { flex: 0 0 100%; max-width: 100%; width: 100%; }
    .mpa-ratio-portrait, .mpa-ratio-square, .mpa-ratio-story { min-height: 0 !important; height: auto !important; }
    .mpa-frame-layer { border-width: 12px; }
    .mpa-sticker { font-size: 40px; }
}