/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    /* Base Colors */
    --color-cream: #FDFBF7;
    --color-white: #FFFFFF;
    --color-text-dark: #333333;
    --color-text-light: #666666;

    /* Elegant Gold Theme */
    --gold-primary: #D4AF37;
    --gold-highlight: #F4E4BC;
    --gold-bg: #FAFAF5;

    /* Confetti Pop Theme */
    --pop-primary: #FF6F61;
    --pop-secondary: #45B7D1;
    --pop-bg: #FFF8E1;

    /* Minimalist Botanical Theme */
    --botanical-primary: #4A7c59;
    --botanical-secondary: #C8E6C9;
    --botanical-bg: #F1F8E9;

    /* UI Elements */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--color-cream);
    color: var(--color-text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===========================
   Creator Studio (Form) 
   =========================== */
.studio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.studio-card {
    background: var(--color-white);
    padding: 3rem 4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.studio-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-dark);
}

.studio-header p {
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 1px solid #eee;
    background: #FAFAFA;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--gold-primary);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Theme Selector */
.theme-section {
    margin-bottom: 1.5rem;
}

.theme-category-title {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns */
    gap: 0.8rem;
}

.theme-option {
    display: flex;
}

.theme-option input[type="radio"] {
    display: none;
}

/* Theme Preview Buttons (Mini Cards) */
.theme-label {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 80px;
    /* Taller for preview feel */
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    line-height: 1.2;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid #eee;
    /* Default border */
    background-color: #fff;
    /* Default background */
}

/* Selected State - Global Indicator */
.theme-option input[type="radio"]:checked+.theme-label {
    transform: scale(1.05);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* --- Individual Theme Previews --- */

/* Elegant Gold */
.theme-option input[value="gold"]+.theme-label {
    background-color: var(--gold-bg);
    border: 3px double var(--gold-primary);
    color: var(--gold-primary);
    font-family: var(--font-heading);
}

/* Confetti Pop */
.theme-option input[value="confetti"]+.theme-label {
    background-color: var(--pop-bg);
    border: 2px solid transparent;
    color: var(--pop-primary);
    font-weight: 800;
    font-family: var(--font-body);
    background-image: radial-gradient(var(--pop-secondary) 15%, transparent 16%),
        radial-gradient(var(--pop-primary) 15%, transparent 16%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

/* Sweet Cake */
.theme-option input[value="cake"]+.theme-label {
    background-color: #fff0f5;
    border: 3px solid #f8bbd0;
    color: #e91e63;
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    text-transform: lowercase;
}

/* Minimalist Botanical */
.theme-option input[value="botanical"]+.theme-label {
    background-color: #f1f8e9;
    border: 1px solid #c8e6c9;
    color: var(--botanical-primary);
    font-family: var(--font-heading);
}

/* Grateful Heart */
.theme-option input[value="grateful"]+.theme-label {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffcc80;
    color: #ef6c00;
    font-family: var(--font-heading);
    font-style: italic;
}

/* Serene Skies */
.theme-option input[value="sky"]+.theme-label {
    background: linear-gradient(to bottom, #e1f5fe 0%, #fff 100%);
    border: 1px solid #b3e5fc;
    color: #039be5;
    font-family: var(--font-body);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Victory Blue */
.theme-option input[value="victory"]+.theme-label {
    background: radial-gradient(circle at center, #e3f2fd 0%, #bbdefb 100%);
    border: 3px double #1565c0;
    color: #0d47a1;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Festive Spirit */
.theme-option input[value="festive"]+.theme-label {
    background-color: #ffebee;
    border: 2px solid #b71c1c;
    color: #b71c1c;
    font-family: var(--font-heading);
    background-image: radial-gradient(#ef9a9a 10%, transparent 10%);
    background-size: 15px 15px;
}

/* Neon Party */
.theme-option input[value="neon"]+.theme-label {
    background-color: #1e1e1e;
    border: 2px solid #00e676;
    color: #00e676;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    font-weight: 900;
    text-shadow: 0 0 5px rgba(0, 230, 118, 0.4);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    /* Inner shadow for depth */
}

.btn-submit {
    display: inline-block;
    background: var(--color-text-dark);
    color: var(--color-white);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 1rem;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: var(--gold-primary);
}


/* ===========================
   Preview Page (The Card) 
   =========================== */
.preview-body {
    display: flex;
    flex-direction: column;
    /* Stack card and action bar */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    transition: background-color 0.5s ease;
}

.card-container {
    width: 100%;
    max-width: 600px;
    perspective: 1000px;
}

.card-inner {
    background: #fff;
    min-height: 700px;
    /* Portrait card layout */
    padding: 4rem;
    border-radius: 4px;
    /* Sharp corners for paper feel, or slightly rounded */
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    /* Paper Texture effect */
    background-image: linear-gradient(to bottom right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5));
}

.card-header h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 0;
    margin-bottom: 2rem;
    text-align: center;
}

.card-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-text {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--color-text-light);
    white-space: pre-wrap;
    text-align: center;
}

.card-footer {
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 2rem;
}

.card-footer p {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
}

.sender-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-text-dark);
    margin-top: 0.5rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* ===========================
   THEME VARIATIONS 
   =========================== */

/* Elegant Gold */
.theme-gold {
    background-color: var(--gold-bg);
}

.theme-gold .card-inner {
    border: 12px double var(--gold-primary);
}

.theme-gold h1 {
    color: var(--gold-primary);
}

/* Confetti Pop */
.theme-confetti {
    background-color: var(--pop-bg);
    background-image: radial-gradient(var(--pop-secondary) 15%, transparent 16%),
        radial-gradient(var(--pop-primary) 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

.theme-confetti .card-inner {
    border: none;
    box-shadow: 0 20px 60px rgba(255, 111, 97, 0.2);
}

.theme-confetti .card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--pop-primary), var(--pop-secondary));
}

.theme-confetti h1 {
    color: var(--pop-primary);
    font-weight: 800;
}

/* Minimalist Botanical */
.theme-botanical {
    background-color: var(--botanical-bg);
}

.theme-botanical .card-inner {
    background-color: #fff;
    border: 1px solid var(--botanical-secondary);
    /* In a real app, I'd add a leafy SVG background image here */
}

.theme-botanical h1 {
    color: var(--botanical-primary);
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

.theme-botanical .message-text {
    font-family: var(--font-heading);
    /* Serif body for this theme */
    color: #5d6d5e;
}

/* Grateful Heart Theme */
.theme-grateful {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.theme-grateful .card-inner {
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ffcc80;
    box-shadow: 0 15px 35px rgba(239, 108, 0, 0.15);
}

.theme-grateful h1 {
    color: #ef6c00;
    font-family: var(--font-heading);
    font-style: italic;
}

.theme-grateful .message-text {
    font-family: var(--font-body);
    color: #4e342e;
}

.theme-grateful .card-footer p {
    color: #d84315;
}

/* Victory Blue Theme */
.theme-victory {
    background: radial-gradient(circle at center, #e3f2fd 0%, #bbdefb 100%);
}

.theme-victory .card-inner {
    background-color: #fff;
    border: 4px double #1565c0;
    box-shadow: 0 20px 40px rgba(13, 71, 161, 0.2);
}

.theme-victory h1 {
    color: #0d47a1;
    font-family: var(--font-heading);
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.theme-victory .message-text {
    color: #1a237e;
}

.theme-victory .card-footer p {
    color: #0277bd;
    font-weight: 700;
}

/* Festive Spirit Theme */
.theme-festive {
    background-color: #ffebee;
    background-image: radial-gradient(#ef9a9a 10%, transparent 10%);
    background-size: 30px 30px;
}

.theme-festive .card-inner {
    background-color: #fff;
    border: 3px solid #b71c1c;
    box-shadow: 0 15px 35px rgba(183, 28, 28, 0.2);
}

.theme-festive h1 {
    color: #b71c1c;
    font-family: var(--font-heading);
    border-bottom: 2px solid #ffcdd2;
    padding-bottom: 1rem;
    display: inline-block;
}

.theme-festive .message-text {
    color: #3e2723;
}

.theme-festive .card-footer p {
    color: #c62828;
}

.theme-botanical h1 {
    color: var(--botanical-primary);
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

.theme-botanical .message-text {
    font-family: var(--font-heading);
    /* Serif body for this theme */
    color: #5d6d5e;
}


/* Sweet Cake Theme (Pink/Cream) */
.theme-cake {
    background-color: #fff0f5;
    background-image: repeating-linear-gradient(45deg, #ffe4e1, #ffe4e1 10px, #fff0f5 10px, #fff0f5 20px);
}

.theme-cake .card-inner {
    background: #fff;
    border: 4px solid #f8bbd0;
    border-radius: 20px;
}

.theme-cake h1 {
    color: #e91e63;
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    text-transform: lowercase;
}

.theme-cake .message-text {
    color: #880e4f;
    font-weight: 400;
}


/* Serene Skies Theme (Blue/White) */
.theme-sky {
    background: linear-gradient(to bottom, #e1f5fe 0%, #fff 100%);
}

.theme-sky .card-inner {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid #b3e5fc;
    box-shadow: 0 10px 40px rgba(129, 212, 250, 0.3);
}

.theme-sky h1 {
    color: #039be5;
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.theme-sky .message-text {
    color: #0277bd;
    font-weight: 300;
}


/* Neon Party Theme (Dark) */
.theme-neon {
    background-color: #121212;
}

.theme-neon .card-inner {
    background-color: #1e1e1e;
    border: 2px solid #00e676;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.theme-neon h1 {
    color: #00e676;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
}

.theme-neon .message-text {
    color: #fff;
    font-family: 'Courier New', monospace;
}

.theme-neon .card-footer p {
    color: #69f0ae;
}

.theme-neon .sender-name {
    color: #fff !important;
}


/* Action Bar (Preview Page) */
.action-bar {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.button {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.button.secondary {
    background: #FFFFFF;
    color: var(--color-text-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.button.secondary:hover {
    background: #F0F0F0;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.button.btn-share {
    background: var(--gold-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.button.btn-share:hover {
    background: #C5A028;
    /* Slightly darker gold */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.button.primary:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ===========================
   Share Modal Overlay 
   =========================== */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.share-overlay.visible .share-modal {
    transform: translateY(0);
}

.share-modal h2 {
    font-family: var(--font-heading);
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--color-text-dark);
}

.share-modal p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* URL Input Group */
.share-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f5f5f5;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #ddd;
}

.share-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 0.9rem;
    color: #555;
    outline: none;
    padding: 0.5rem;
}

.btn-copy {
    background: var(--color-text-dark);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #000;
}

/* Share Actions Grid */
.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid #eee;
    background: #fff;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: #f9f9f9;
    border-color: #ddd;
    transform: translateY(-1px);
}

.btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #ccc;
    cursor: pointer;
}

.btn-close-modal:hover {
    color: #333;
}