/* =============================================================
   ecard.css — Bulbmeister eCard
   Self-contained styles for the ecard compose/preview/view pages.
   ============================================================= */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;700&family=Pacifico&family=Great+Vibes&family=Pinyon+Script&family=Sacramento&family=Caveat:wght@500;700&family=Satisfy&family=Lobster&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,700;1,400&family=IM+Fell+English:ital@0;1&family=Comic+Neue:wght@400;700&display=swap');

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Page ────────────────────────────────────────────────────── */
body {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: #2d3748;
    background: url('https://www.bulbmeister.com/images/image_side4.jpg') repeat fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ecard-wrapper {
    max-width: 1800px;
    margin: 0 auto;
    background: rgba(247, 250, 252, 0.97);
    box-shadow: 0 0 30px rgba(0,0,0,0.2);
    min-height: 100vh;
    display: flex;
    flex-direction: column;}

/* ── Mini Header ─────────────────────────────────────────────── */
.ecard-header {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c29 100%);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ecard-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.ecard-logo-text {
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    line-height: 1;
}

.ecard-logo-sub {
    color: rgba(255,255,255,0.85);
    font-size: 0.78rem;
    font-style: italic;
}

.ecard-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ecard-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    transition: background 0.2s;
}

.ecard-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ── Title bar ───────────────────────────────────────────────── */
.ecard-title-bar {
    background: #f0f4f0;
    border-bottom: 2px solid #c8dac8;
    padding: 0.6rem 1.5rem;
    text-align: center;
}

.ecard-title-bar h1 {
    font-size: 1.1rem;
    color: #2d5016;
    font-weight: normal;
    letter-spacing: 0.05em;
}

/* ── Main content ────────────────────────────────────────────── */
.ecard-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
}

/* ── Compose / Preview layout ────────────────────────────────── */
.ecard-layout {
    display: grid;
    grid-template-columns: minmax(300px, auto) minmax(360px, 500px);
    gap: 1.5rem;
    align-items: start;
}

/* ── Image panel ─────────────────────────────────────────────── */
.ecard-image-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://www.bulbmeister.com/images/image_side4.jpg') repeat;
    background-attachment: local;
    border: 1px solid #dde8dd;
    border-radius: 6px;
    padding: 0.75rem;
}

.ecard-image-panel img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Form panel ──────────────────────────────────────────────── */
.ecard-form-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ecard-form-panel::-webkit-scrollbar { width: 6px; }
.ecard-form-panel::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.ecard-form-panel::-webkit-scrollbar-thumb { background: #c8dac8; border-radius: 3px; }

/* ── Form sections ───────────────────────────────────────────── */
.ecard-section {
    background: white;
    border: 1px solid #dde8dd;
    border-radius: 5px;
    overflow: hidden;
}

.ecard-section-title {
    background: #2d5016;
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
}

.ecard-section-body {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ecard-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ecard-field label {
    font-size: 0.78rem;
    color: #4a7c29;
    font-weight: 600;
}

.ecard-field input[type="text"],
.ecard-field input[type="email"],
.ecard-field select,
.ecard-field textarea {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: Georgia, serif;
    color: #2d3748;
    background: white;
    transition: border-color 0.2s;
}

.ecard-field input:focus,
.ecard-field select:focus,
.ecard-field textarea:focus {
    outline: none;
    border-color: #4a7c29;
    box-shadow: 0 0 0 2px rgba(74,124,41,0.15);
}

.ecard-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Two-column row within a section */
.ecard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ── BBCode toolbar ──────────────────────────────────────────── */
.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px;
}

.bbcode-btn {
    padding: 0.15rem 0.45rem;
    background: #f0f4f0;
    border: 1px solid #c8dac8;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #2d5016;
    font-family: Georgia, serif;
    transition: background 0.15s;
    line-height: 1.4;
}

.bbcode-btn:hover {
    background: #2d5016;
    color: white;
    border-color: #2d5016;
}

/* ── Font selector preview ───────────────────────────────────── */
.font-preview {
    font-size: 1.1rem;
    color: #2d5016;
    margin-top: 0.2rem;
    min-height: 1.5rem;
    padding: 0.2rem 0.5rem;
    background: #f8f9f8;
    border-radius: 3px;
    border: 1px solid #e2e8e0;
    text-align: right;
}

/* ── Captcha ─────────────────────────────────────────────────── */
.ecard-captcha {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ecard-captcha input {
    width: 70px !important;
}

.captcha-question {
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.ecard-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.75rem 0 0.25rem;
    flex-wrap: wrap;
}

.btn-ecard {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: Georgia, serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-ecard-primary {
    background: #2d5016;
    color: white;
}

.btn-ecard-primary:hover {
    background: #4a7c29;
    color: white;
}

.btn-ecard-secondary {
    background: white;
    color: #2d5016;
    border: 1px solid #2d5016;
}

.btn-ecard-secondary:hover {
    background: #f0f4f0;
}

/* ── Preview card ────────────────────────────────────────────── */
.ecard-preview-card {
    background: white;
    border: 1px solid #dde8dd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.ecard-preview-layout {
    display: grid;
    grid-template-columns: minmax(300px, auto) minmax(320px, 480px);
    align-items: start;
}

.ecard-preview-image {
    background: url('https://www.bulbmeister.com/images/image_side4.jpg') repeat;
    background-attachment: local;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-right: 1px solid #dde8dd;
}

.ecard-preview-image img {
    max-width: 100%;
    max-height: calc(100vh - 280px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: block;
}

.ecard-preview-message {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ecard-preview-subject {
    font-size: 1.6rem;
    color: #2d5016;
    font-weight: bold;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #dde8dd;
}

.ecard-preview-to {
    font-size: 1.05rem;
    color: #2d3748;
    font-weight: normal;
    margin-bottom: 0.75rem;
    font-family: Georgia, serif;
}

.ecard-preview-body {
    line-height: 1.7;
    white-space: pre-wrap;
}

.ecard-preview-closing {
    margin-top: 1rem;
    line-height: 1.4;
    text-align: right;
    padding-top: 0.5rem;
}

.ecard-preview-closing-phrase,
.ecard-preview-sender {
    display: block;
}

/* ── View card (recipient sees this) ─────────────────────────── */
.ecard-view-card {
    background: white;
    border: 1px solid #dde8dd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    margin: 0 auto;
    max-width: 900px;
}

/* ── Success message ─────────────────────────────────────────── */
.ecard-success {
    text-align: center;
    padding: 2rem;
}

.ecard-success-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.ecard-success h2 {
    color: #2d5016;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.ecard-success p {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* ── Error message ───────────────────────────────────────────── */
.ecard-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
}

/* ── Mini footer ─────────────────────────────────────────────── */
.ecard-footer {
    background: #2d5016;
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ecard-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.ecard-footer a:hover {
    color: white;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ecard-wrapper {
        max-width: 100%;
        box-shadow: none;
    }

    .ecard-header {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .ecard-nav {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .ecard-content {
        padding: 0.75rem 0.75rem;
    }

    .ecard-layout,
    .ecard-preview-layout {
        grid-template-columns: 1fr;
    }

    .ecard-image-panel,
    .ecard-preview-image {
        max-height: 260px;
        border-right: none;
        border-bottom: 1px solid #dde8dd;
    }

    .ecard-preview-layout {
        max-height: none;
    }

    /* Remove fixed height on form panel so it flows naturally on mobile */
    .ecard-form-panel {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .ecard-row {
        grid-template-columns: 1fr;
    }

    .ecard-section-body {
        padding: 0.5rem 0.6rem;
    }

    .ecard-field input[type="text"],
    .ecard-field input[type="email"],
    .ecard-field select,
    .ecard-field textarea {
        font-size: 1rem; /* prevents iOS auto-zoom on focus */
    }

    .ecard-preview-message {
        padding: 1rem;
        overflow-y: visible;
    }

    .ecard-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-ecard {
        text-align: center;
    }

    .ecard-footer {
        padding: 0.6rem 1rem;
        gap: 0.75rem;
    }
}

/* ── eCard language selector ─────────────────────────────────────────────── */
.ecard-nav select {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.78rem;
    font-family: Georgia, serif;
    cursor: pointer;
}

.ecard-nav select:hover {
    background: rgba(255,255,255,0.25);
}

.ecard-nav select option {
    background: #2d5016;
    color: white;
}
