/* ===== Wedding Programs Page Styles ===== */
/* Uses variables from webdesign-content.css: --primary-color, --primary-dark, --primary-light,
   --text-dark, --text-light, --bg-light, --bg-white, --border-color, --shadow-sm through --shadow-xl */

/* ===== Hero Section ===== */
.wedding-hero {
    padding: 160px 20px 80px;
    text-align: center;
    background: linear-gradient(135deg, #f0faf9 0%, #e8f4f8 40%, #fdf2f8 100%);
    position: relative;
    overflow: hidden;
}

.wedding-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(32, 178, 170, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255, 127, 80, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.wedding-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.15;
    position: relative;
}

.wedding-hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    position: relative;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* Override btn-primary for this page to use the teal fill instead of white fill */
.wedding-hero .btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.wedding-hero .btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* ===== Templates Section ===== */
.templates-section {
    padding: 80px 0;
    background: var(--bg-white);
}

/* ===== Filter Buttons ===== */
.template-filters {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.template-filters .filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: #fff;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.template-filters .filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.template-filters .filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== Template Grid ===== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ===== Template Card ===== */
.template-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Scaled-down iframe preview */
.template-preview {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f9fafb;
}

.template-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 1000px;
    transform: scale(0.35);
    transform-origin: top left;
    border: none;
    pointer-events: none;
}

.template-info {
    padding: 1rem 1.25rem 0.5rem;
}

.template-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.template-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1.25rem;
}

/* Small button variant */
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    display: inline-block;
    text-align: center;
}

.btn-sm.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-sm.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-sm.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.3rem 1rem; /* compensate for border */
}

.btn-sm.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Large button variant */
.btn-lg {
    padding: 1.1rem 3rem;
    font-size: 1.15rem;
}

/* ===== Generator Section ===== */
.generator-section {
    padding: 80px 0;
    background: var(--bg-light);
}

/* ===== Wedding Form ===== */
.wedding-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #adb5bd;
}

.form-group select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

/* ===== Dynamic Rows (Party + Ceremony) ===== */
.party-row,
.ceremony-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.party-row input,
.ceremony-row input {
    flex: 1;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.party-row input:focus,
.ceremony-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.12);
}

.party-row input::placeholder,
.ceremony-row input::placeholder {
    color: #adb5bd;
}

.remove-row-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-light);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-row-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ===== Template Selector (in form) ===== */
.template-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.template-selector-card {
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    background: #fff;
}

.template-selector-card:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.template-selector-card.selected {
    border-color: var(--primary-color);
    background: rgba(32, 178, 170, 0.06);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.12);
}

/* ===== Generate Button ===== */
.wedding-form > .btn-lg {
    display: block;
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    margin-top: 0.5rem;
}

.wedding-form > .btn-lg:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== Result Section ===== */
.result-section {
    padding: 60px 0 80px;
    background: var(--bg-white);
}

.result-section .section-header {
    max-width: 100%;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.result-actions .btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.result-actions .btn-primary:hover {
    background: var(--primary-dark);
}

.result-preview {
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.result-preview iframe {
    width: 100%;
    height: 800px;
    border: none;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: #fff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
}

.loading-content h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.loading-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Preview Modal ===== */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.preview-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.preview-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.2s ease;
}

.preview-modal-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* ===== SEO Content Section ===== */
.seo-content-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.seo-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.seo-column h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.seo-column p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

/* ===== FAQ Section ===== */
.faq-section {
    padding: 60px 0 80px;
    background: var(--bg-white);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    font-family: inherit;
}

.faq-question i {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding-bottom: 1.25rem;
}

.faq-answer p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.75;
}

/* ===== Promo Modal (post-download upsell) ===== */
.promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
    animation: promoFadeIn 0.3s ease;
}

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

.promo-modal-content {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: promoSlideUp 0.3s ease;
}

@keyframes promoSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.promo-modal-content h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.promo-modal-content > p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.promo-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-light);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.promo-modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-dark);
}

/* Center the otter input bar inside the promo modal */
#promoInputBar {
    max-width: 520px;
    margin: 0 auto;
}

/* ===== Fade-in animation (used by filter) ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive: Tablet (max-width 968px) ===== */
@media (max-width: 968px) {
    .wedding-hero {
        padding: 140px 20px 60px;
    }

    .wedding-hero h1 {
        font-size: 2.5rem;
    }

    .wedding-hero p {
        font-size: 1.1rem;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .template-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .seo-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .result-preview iframe {
        height: 600px;
    }
}

/* ===== Responsive: Mobile (max-width 640px) ===== */
@media (max-width: 640px) {
    .wedding-hero {
        padding: 120px 16px 50px;
    }

    .wedding-hero h1 {
        font-size: 2rem;
    }

    .wedding-hero p {
        font-size: 1rem;
    }

    .hero-cta-group {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta-group .btn {
        width: 100%;
        max-width: 280px;
    }

    .templates-section {
        padding: 50px 0;
    }

    .template-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .template-filters {
        gap: 0.4rem;
    }

    .template-filters .filter-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-section {
        padding: 1.5rem;
    }

    .template-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .template-selector-card {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
    }

    .party-row,
    .ceremony-row {
        flex-wrap: wrap;
    }

    .party-row input,
    .ceremony-row input {
        flex: 1 1 100%;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .result-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .result-preview iframe {
        height: 500px;
    }

    .preview-modal {
        padding: 1rem;
    }

    .preview-modal-content {
        height: 90vh;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .generator-section {
        padding: 50px 0;
    }

    .faq-question {
        font-size: 0.95rem;
    }
}
