/**
 * GCC Wedding Card - UNIFIED CSS v2.0
 * 
 * LOGIC DESIGN:
 * 1. Preview Mode (.gcc-preview-wedding-card) - Compact preview trong form
 * 2. Card View (.gcc-wedding-card) - Kích thước thực tế A4 khi xem card
 * 
 * KÍCH THƯỚC:
 * Preview: Compact sizes (400-600px) với đúng tỷ lệ
 * Real Card: A4 standard @ 96 DPI
 *   - Portrait: 794px × 1123px (210mm × 297mm)
 *   - Landscape: 1123px × 794px (297mm × 210mm)
 *   - Square: 794px × 794px (210mm × 210mm)
 */

/* ==========================================================================
   PART 1: PREVIEW MODE - Compact sizes for form sidebar
   ========================================================================== */

.gcc-preview-wedding-card {
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    font-family: 'Georgia', serif;
    color: #2c3e50;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Preview visibility toggle */
body.gcc-wedding-active .gcc-preview-general,
body.gcc-wedding-active #gccLivePreview {
    display: none !important;
}

body.gcc-wedding-active .gcc-preview-wedding,
body.gcc-wedding-active #gccWeddingPreview {
    display: block !important;
}

#gccWeddingPreview {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Preview Orientation Sizes ---------- */

/* Portrait Preview - 400px width, 2:3 ratio */
.gcc-preview-wedding-card.gcc-preview-wedding-card[data-orientation="portrait"] {
    max-width: 400px !important;
    width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    padding: 16px !important;
    gap: 8px !important;
}

/* Landscape Preview - 600px width, GRID 2 columns */
/* Landscape Preview - 700px width, GRID 3 rows x 2 cols - Ratio 3:2 */
/* Landscape Preview - 700px width, GRID: photo top, 2 cols, footer bottom */
.gcc-preview-wedding-card.gcc-preview-wedding-card[data-orientation="landscape"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto 1fr auto !important;
    flex-direction: initial !important;
    max-width: 700px !important;
    width: 700px !important;
    min-width: 700px !important;
    aspect-ratio: 3 / 2 !important;
    overflow: hidden !important;
    padding: 12px !important;
    gap: 10px !important;
}

/* Photo — full width, row 1, centered */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-photo-section {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 80px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgb(245, 245, 245) !important;
    flex: none !important;
    border: 2px solid #d4af37 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-photo-section img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-photo-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: transparent !important;
    border: none !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-photo-placeholder svg {
    width: 30px !important;
    height: 30px !important;
    color: #d4af37 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-photo-placeholder span {
    font-size: 9px !important;
    color: #9ca3af !important;
}

/* Header — row 2, col 1 */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-header {
    grid-column: 1 !important;
    grid-row: 2 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 3px !important;
}

/* Content — row 2, col 2 */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-content {
    grid-column: 2 !important;
    grid-row: 2 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* Footer — row 3, full width — fixed 40px, không dãn theo nội dung */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-footer {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    padding: 0 6px !important;
    margin: 0 !important;
    text-align: center !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-footer::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-ornament {
    font-size: 16px !important;
    margin: 2px 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-divider {
    width: 60% !important;
    height: 1px !important;
    margin: 4px auto !important;
}

/* Typography */
.gcc-preview-wedding-card[data-orientation="landscape"] .invitation-title {
    font-size: 13px !important;
    letter-spacing: 2px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Couple names — flex row, wrap, căn giữa */
.gcc-preview-wedding-card[data-orientation="landscape"] .couple-names {
    font-size: 22px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-align: center !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 2px 0 !important;
    width: 100% !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .groom-name,
.gcc-preview-wedding-card[data-orientation="landscape"] .bride-name {
    flex: 0 1 auto !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .ampersand {
    display: inline !important;
    flex: 0 0 auto !important;
    align-self: center !important;
}

/* Parents */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-parents-names {
    font-size: 11px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    text-align: center !important;
}

/* Message */
.gcc-preview-wedding-card[data-orientation="landscape"] .invitation-message {
    font-size: 12px !important;
    line-height: 1.4 !important;
    min-height: 120px !important;
    max-height: 120px !important;
    height: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 6px !important;
    border: 1px solid rgba(212,175,55,0.2) !important;
    border-radius: 6px !important;
    background: rgba(212,175,55,0.05) !important;
    text-align: center !important;
}
.gcc-preview-wedding-card[data-orientation="landscape"] .invitation-message::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* Event details */
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-event-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 6px !important;
    margin: 0 !important;
    background: #f9fafb !important;
    border-radius: 6px !important;
    min-height: 0 !important;
    max-height: 150px !important;
    height: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-event-details::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .wedding-detail-item {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: flex-start !important;
    margin: 0 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .detail-icon {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    color: #d4af37 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .detail-icon svg {
    width: 14px !important;
    height: 14px !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .detail-content {
    flex: 1 !important;
    text-align: left !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .detail-label {
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .detail-value {
    font-size: 11px !important;
    line-height: 1.3 !important;
    color: #6b7280 !important;
}

.gcc-preview-wedding-card[data-orientation="landscape"] .footer-message {
    font-size: 11px !important;
}

/* Layout variations removed - using classic layout only */


/* Modern layout - sidebar photo */





/* Elegant layout - full background */





/* Minimalist layout - circle photo */



/* ==========================================================================
   PART 2: REAL CARD VIEW - Full A4 sizes for actual card display
   ========================================================================== */

.gcc-wedding-card {
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    font-family: 'Georgia', serif;
    color: #2c3e50;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
    height: auto !important;
}

/* ---------- Real Card Orientation Sizes (A4 @ 96 DPI) ---------- */

/* Portrait - 210mm × 297mm */
.gcc-wedding-card[data-orientation="portrait"] {
    width: 794px !important;
    max-width: 794px !important;
    min-width: 794px !important;
    min-height: 1123px !important;
    padding: 40px 30px !important;
}

/* Landscape - 297mm × 210mm */
.gcc-wedding-card[data-orientation="landscape"] {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 50px !important;
    width: 1123px !important;
    max-width: 1123px !important;
    min-width: 1123px !important;
    min-height: 794px !important;
    padding: 50px !important;
}

/* Landscape - Photo Section on LEFT (25% width) */
.gcc-wedding-card[data-orientation="landscape"] .wedding-photo-section {
    flex: 0 0 25% !important;
    max-width: 280px !important;
    min-width: 280px !important;
    order: 1 !important;
    margin: 0 !important;
}

/* Landscape - Content sections on RIGHT (75% width) */
.gcc-wedding-card[data-orientation="landscape"] .wedding-header,
.gcc-wedding-card[data-orientation="landscape"] .wedding-content,
.gcc-wedding-card[data-orientation="landscape"] .wedding-footer {
    flex: 1 !important;
    order: 2 !important;
}


/* ---------- Real Card Content Sizes ---------- */

/* Portrait - vertical names, single column */
.gcc-wedding-card[data-orientation="portrait"] .wedding-invitation-title {
    font-size: 14px;
    letter-spacing: 3px;
}

.gcc-wedding-card[data-orientation="portrait"] .wedding-couple-names {
    font-size: 48px;
    flex-direction: column;
    gap: 10px;
}

.gcc-wedding-card[data-orientation="portrait"] .ampersand {
    display: none !important;
}

.gcc-wedding-card[data-orientation="portrait"] .wedding-message {
    font-size: 16px;
    line-height: 1.8;
}

.gcc-wedding-card[data-orientation="portrait"] .wedding-event-details {
    display: block;
    padding: 25px;
}

.gcc-wedding-card[data-orientation="portrait"] .wedding-detail-item {
    margin: 15px 0;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.gcc-wedding-card[data-orientation="portrait"] .detail-icon {
    width: 24px;
    height: 24px;
}

.gcc-wedding-card[data-orientation="portrait"] .detail-content {
    flex: 1;
    text-align: left;
}

.gcc-wedding-card[data-orientation="portrait"] .detail-label {
    font-size: 12px;
}

.gcc-wedding-card[data-orientation="portrait"] .detail-value {
    font-size: 16px;
    line-height: 1.6;
}

/* Landscape - horizontal names, 2 columns */
.gcc-wedding-card[data-orientation="landscape"] .wedding-invitation-title {
    font-size: 14px;
    letter-spacing: 3px;
}

.gcc-wedding-card[data-orientation="landscape"] .wedding-couple-names {
    font-size: 42px;
    flex-direction: row;
    gap: 15px;
}

.gcc-wedding-card[data-orientation="landscape"] .ampersand {
    display: inline !important;
}

.gcc-wedding-card[data-orientation="landscape"] .wedding-message {
    font-size: 16px;
    line-height: 1.8;
}

.gcc-wedding-card[data-orientation="landscape"] .wedding-event-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 25px;
}

.gcc-wedding-card[data-orientation="landscape"] .wedding-detail-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.gcc-wedding-card[data-orientation="landscape"] .detail-icon {
    width: 24px;
    height: 24px;
}

.gcc-wedding-card[data-orientation="landscape"] .detail-content {
    width: 100%;
    text-align: center;
}

.gcc-wedding-card[data-orientation="landscape"] .detail-label {
    font-size: 12px;
}

.gcc-wedding-card[data-orientation="landscape"] .detail-value {
    font-size: 16px;
    line-height: 1.6;
}











/* Layout variations removed - using classic layout only */



/* Modern layout - small photo top-left corner */









/* Elegant layout - full background */









/* Minimalist layout - circle photo */





/* ==========================================================================
   PART 3: SHARED STYLES - Common elements for both preview & real card
   ========================================================================== */

.wedding-header {
    text-align: center;
    min-height: 136px;
    max-height: 136px;
    height: 136px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}
.wedding-header::-webkit-scrollbar { display: none; width: 0; }

.wedding-invitation-title,
.invitation-title {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    font-weight: 400;
    min-height: 21px;
    max-height: 21px;
    height: 21px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wedding-invitation-title::-webkit-scrollbar,
.invitation-title::-webkit-scrollbar { display: none; width: 0; }

.wedding-couple-names,
.couple-names {
    font-weight: 300;
    font-family: 'Playfair Display', Georgia, serif;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
    color: #1f2937;
    min-height: 34px;
    max-height: 34px;
    height: 34px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 4px;
}
.wedding-couple-names::-webkit-scrollbar,
.couple-names::-webkit-scrollbar { display: none; width: 0; }

.groom-name,
.bride-name {
    font-family: 'Georgia', serif;
    flex: 0 1 auto;
    text-align: center;
}

.ampersand {
    font-size: 0.8em;
    color: #d4af37;
    font-style: italic;
    flex: 0 0 auto;
    /* Khi wrap: chiếm cả hàng để nằm giữa 2 tên */
}

.wedding-parents-names {
    color: #666;
    line-height: 1.6;
    min-height: 35px;
    max-height: 35px;
    height: 35px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wedding-parents-names::-webkit-scrollbar { display: none; width: 0; }

.wedding-ornament {
    color: #d4af37;
    text-align: center;
    min-height: 24px;
    max-height: 24px;
    height: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wedding-ornament::-webkit-scrollbar { display: none; width: 0; }

.wedding-divider {
    height: 2px;
    background: #d4af37;
    margin: 20px auto;
    width: 60px;
}

.wedding-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wedding-message,
.invitation-message {
    text-align: center;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;

    /* Scroll độc lập, ẩn scrollbar - lăn chuột bình thường */
    min-height: 150px !important;
    max-height: 150px !important;
    height: 150px !important;
    overflow-y: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.wedding-message::-webkit-scrollbar,
.invitation-message::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.wedding-event-details {
    background: #f8f9fa;
    border-radius: 12px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Scroll độc lập, ẩn scrollbar */
    min-height: 150px;
    max-height: 150px;
    height: 150px;
    overflow-y: auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wedding-event-details::-webkit-scrollbar {
    display: none;
    width: 0;
}

.wedding-detail-item {
    display: flex !important;
    visibility: visible !important;
}

.wedding-detail-item:last-child {
    margin-bottom: 0 !important;
}

.detail-icon {
    color: #d4af37;
    flex-shrink: 0;
}

.detail-icon svg {
    width: 100%;
    height: 100%;
}

.detail-content {
    min-width: 0;
}

.detail-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #374151;
    font-weight: 600;
}

.detail-value {
    color: #6b7280;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.wedding-map-button {
    display: inline-block;
    padding: 10px 20px;
    background: #d4af37;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    margin-top: 10px;
}

.wedding-map-button:hover {
    background: #b8941f;
}

.wedding-footer {
    text-align: center;
    color: #666;
    font-style: italic;
    border-top: 1px solid #e5e7eb;
    /* Scroll độc lập, ẩn scrollbar */
    min-height: 50px;
    max-height: 50px;
    height: 50px;
    overflow-y: auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wedding-footer::-webkit-scrollbar {
    display: none;
    width: 0;
}

.footer-message {
    color: #6b7280;
    font-style: italic;
}

.wedding-photo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.wedding-photo-section img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}



.wedding-photo-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* SVG - 50% container, max 40px */
.wedding-photo-placeholder svg {
    width: 50%;
    max-width: 40px;
    max-height: 40px;
    opacity: 0.4; /* subtle */
}

/* Text - 8px, compact */
.wedding-photo-placeholder span {
    font-size: 8px;
    color: #999;
    text-align: center;
}
/* ==========================================================================
   PART 4: RESPONSIVE - Desktop/Tablet/Mobile
   ========================================================================== */

@media (max-width: 1200px) {
    /* Scale down real cards on medium screens */
    .gcc-wedding-card {
        transform: scale(0.9);
        transform-origin: top center;
    }
}

@media (max-width: 768px) {
    /* Scale down real cards on tablets */
    .gcc-wedding-card {
        transform: scale(0.7);
    }
    
    /* Preview adjustments */
    #gccWeddingPreview {
        padding: 12px;
    }
    
    .gcc-preview-wedding-card {
        padding: 14px !important;
        max-width: 100% !important;
    }
    
    /* All become single column on mobile */
    .gcc-wedding-card .wedding-event-details,
    .gcc-preview-wedding-card .wedding-event-details {
        grid-template-columns: 1fr !important;
        display: block !important;
    }
    
    .gcc-wedding-card .wedding-couple-names,
    .gcc-preview-wedding-card .couple-names {
        flex-direction: column !important;
        font-size: 18px !important;
    }
    
    .gcc-wedding-card .ampersand,
    .gcc-preview-wedding-card .ampersand {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* Further scale down real cards on mobile */
    .gcc-wedding-card {
        transform: scale(0.5);
    }
}

/* ==========================================================================
   PART 5: PRINT STYLES - Convert to mm
   ========================================================================== */

@media print {
    @page {
        margin: 0;
    }
    
    .gcc-wedding-card[data-orientation="portrait"] {
        width: 210mm !important;
        min-height: 297mm !important;
        transform: none !important;
    }
    
    .gcc-wedding-card[data-orientation="landscape"] {
        width: 297mm !important;
        min-height: 210mm !important;
        transform: none !important;
    }
    
    
    .gcc-wedding-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .wedding-map-button {
        display: none;
    }
}
/* =================================================================
   WEDDING PREVIEW FIXES - FINAL VERSION
   - Footer cố định dưới cùng (TẤT CẢ layout)
   - Portrait: compact layout + scroll
   - Landscape: photo góc trái, 2 cột header+content, borders
   - Photo fit (TẤT CẢ layout)
   ================================================================= */

/* ============= COMMON - TẤT CẢ LAYOUT ============= */

/* Photo fit cho tất cả layout */
.wedding-photo-section img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* ============= PORTRAIT LAYOUT ============= */

/* Footer cố định dưới cùng - Portrait */
.gcc-preview-wedding-card[data-orientation="portrait"] {
    position: relative !important;
    overflow: auto !important;
    padding: 10px !important;
    gap: 4px !important;
    padding-bottom: 40px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-footer {
    position: absolute !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    z-index: 10 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .footer-message {
    text-align: center !important;
    width: 100% !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-photo-section {
    width: 80px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    flex: 0 0 80px !important;
    margin: 0 auto 6px !important;
    padding: 0 !important;
    border: 3px solid #d4af37 !important;
    border-radius: 50% !important;
    background: rgb(245, 245, 245) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: -1 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-photo-section img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-photo-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-photo-placeholder svg {
    width: 30px !important;
    height: 60px !important;
    color: #d4af37 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-photo-placeholder span {
    font-size: 8px !important;
    color: #9ca3af !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-header {
    text-align: center !important;
    padding: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    min-height: 136px !important;
    max-height: 136px !important;
    height: 136px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-header::-webkit-scrollbar { display: none !important; width: 0 !important; }

.gcc-preview-wedding-card[data-orientation="portrait"] .invitation-title {
    font-size: 14px !important;
    margin: 2px 0 !important;
    min-height: 21px !important;
    max-height: 21px !important;
    height: 21px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .invitation-title::-webkit-scrollbar { display: none !important; width: 0 !important; }

.gcc-preview-wedding-card[data-orientation="portrait"] .couple-names {
    font-size: 22px !important;
    flex-direction: row !important;
    gap: 4px !important;
    margin: 4px 0 !important;
    align-items: center !important;
    justify-content: center !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    word-break: break-word !important;
    gap: 4px !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .couple-names::-webkit-scrollbar { display: none !important; width: 0 !important; }

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-parents-names {
    font-size: 12px !important;
    margin-top: 3px !important;
    min-height: 35px !important;
    max-height: 35px !important;
    height: 35px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-parents-names::-webkit-scrollbar { display: none !important; width: 0 !important; }

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-divider {
    margin: 6px auto !important;
    width: 40px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .invitation-message {
    font-size: 13px !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
    flex: 0 0 auto !important;
    min-height: 150px !important;
    max-height: 150px !important;
    height: 150px !important;
    overflow-y: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 8px !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    border-radius: 6px !important;
    background: rgba(212, 175, 55, 0.05) !important;
    text-align: center !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .invitation-message::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-event-details {
    padding: 6px !important;
    margin: 4px 0 !important;
    min-height: 125px !important;
    max-height: 125px !important;
    height: 125px !important;
    overflow-y: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-event-details::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-detail-item {
    margin-bottom: 4px !important;
    gap: 6px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .detail-label {
    font-size: 11px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .detail-value {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-footer {
    padding: 6px 0 0 !important;
    margin-top: 6px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .footer-message {
    font-size: 12px !important;
}

.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-ornament {
    margin: 3px 0 !important;
    min-height: 24px !important;
    max-height: 24px !important;
    height: 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.gcc-preview-wedding-card[data-orientation="portrait"] .wedding-ornament::-webkit-scrollbar { display: none !important; width: 0 !important; }


/* Card - aspect ratio 1:1, flex column, photo đã ở đầu HTML */

/* Photo Section - CIRCULAR, 100x100, ở đầu HTML - HIGH SPECIFICITY */





/* Header - compact */








/* Content wrapper - flex tự nhiên, không giới hạn max-height */

/* Message - compact với max-height */

/* Event Details - fill remaining space, no max-height limit */








/* Footer - relative position, không đè lên content */






/* ==========================================================================
   CARD VIEW SQUARE (1:1) - Full A4 Square @ 96 DPI
   ========================================================================== */


/* Photo Section - Circular, centered, compact */




/* Header - compact */







/* Content - flexible, fill space */

/* Message */

/* Event Details */







/* Footer */

/* ==========================================================================
   BACKGROUND IMAGE FIX - Added 2025-02-05
   Ensures background images work across all contexts and layouts
   ========================================================================== */

/* ========== BACKGROUND IMAGE: Card container base ========== */
/*
 * FIX: Bỏ gradient border cố định 7 màu vì nó ghi đè style của từng template.
 * Mỗi template (gcc-wtpl-*) tự định nghĩa border/border-radius riêng của nó.
 * Ở đây chỉ set position + shadow chung, không áp border hay border-radius cố định.
 */
.gcc-preview-wedding-card[style*="background-image"],
main.gcc-preview-wedding-card[style*="background-image"] {
    position: relative !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15) !important;
    overflow: visible !important;
}

/* Ensure card content is above background */
.gcc-preview-wedding-card[style*="background-image"] > *,
main.gcc-preview-wedding-card[style*="background-image"] > * {
    position: relative !important;
    z-index: 1 !important;
}

/* Enable background image on ALL wedding card containers */
.gcc-preview-wedding-card,
main.gcc-preview-wedding-card,
.gcc-wedding-card,
#gccWeddingPreview .gcc-preview-wedding-card {
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
}

/* ========== CRITICAL FIX: TRANSPARENT SECTIONS WHEN BACKGROUND EXISTS ========== */
/* Make ALL sections COMPLETELY TRANSPARENT - NO BACKGROUND AT ALL */
/* But KEEP borders for better visual separation */
.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
.gcc-preview-wedding-card[style*="background-image"] .wedding-footer,
.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section,
.gcc-preview-wedding-card[style*="background-image"] .wedding-message,
.gcc-preview-wedding-card[style*="background-image"] .invitation-message,
.gcc-preview-wedding-card[style*="background-image"] .wedding-event-details,
.gcc-preview-wedding-card[style*="background-image"] .wedding-detail-item,
.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-footer,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-message,
main.gcc-preview-wedding-card[style*="background-image"] .invitation-message,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-event-details,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-detail-item,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names {
    background: none !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* KEEP subtle borders for visual separation */
    box-shadow: none !important;
}

/*
 * FIX: Bỏ gradient border cố định trên các section (header, content, footer, photo).
 * Border + padding cố định ở đây ghi đè style của template đang chọn.
 * Các template tự định nghĩa border/padding riêng qua class gcc-wtpl-*.
 * Chỉ giữ position:relative để z-index hoạt động đúng.
 */
.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
.gcc-preview-wedding-card[style*="background-image"] .wedding-footer,
.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-footer,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section {
    position: relative !important;
}

/* REMOVE ::before pseudo-elements from sections */
.gcc-preview-wedding-card[style*="background-image"] .wedding-header::before,
.gcc-preview-wedding-card[style*="background-image"] .wedding-content::before,
.gcc-preview-wedding-card[style*="background-image"] .wedding-footer::before,
.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section::before,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-header::before,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-content::before,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-footer::before,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-photo-section::before {
    content: none !important;
    display: none !important;
}

/* REMOVE borders from child sections (detail-item, parents, etc.) */
.gcc-preview-wedding-card[style*="background-image"] .wedding-detail-item,
.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names,
.gcc-preview-wedding-card[style*="background-image"] .wedding-event-details > *,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-detail-item,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-event-details > * {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/*
 * FIX: Bỏ background:none !important trên tất cả * vì nó xóa luôn background
 * của template đang chọn (ví dụ: màu nền, gradient của template).
 * Chỉ xóa background trên các section wrapper cụ thể để thấy background image.
 */
.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
.gcc-preview-wedding-card[style*="background-image"] .wedding-footer,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-header,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-content,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-footer {
    background-color: transparent !important;
}

/* Keep text visible - ADD HIGH CONTRAST for readability */
.gcc-preview-wedding-card[style*="background-image"] .invitation-title,
.gcc-preview-wedding-card[style*="background-image"] .couple-names,
.gcc-preview-wedding-card[style*="background-image"] .wedding-couple-names,
.gcc-preview-wedding-card[style*="background-image"] .groom-name,
.gcc-preview-wedding-card[style*="background-image"] .bride-name,
.gcc-preview-wedding-card[style*="background-image"] .wedding-message,
.gcc-preview-wedding-card[style*="background-image"] .invitation-message,
.gcc-preview-wedding-card[style*="background-image"] .detail-label,
.gcc-preview-wedding-card[style*="background-image"] .detail-value,
.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names,
main.gcc-preview-wedding-card[style*="background-image"] .invitation-title,
main.gcc-preview-wedding-card[style*="background-image"] .couple-names,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-couple-names,
main.gcc-preview-wedding-card[style*="background-image"] .groom-name,
main.gcc-preview-wedding-card[style*="background-image"] .bride-name,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-message,
main.gcc-preview-wedding-card[style*="background-image"] .invitation-message,
main.gcc-preview-wedding-card[style*="background-image"] .detail-label,
main.gcc-preview-wedding-card[style*="background-image"] .detail-value,
main.gcc-preview-wedding-card[style*="background-image"] .wedding-parents-names {
    color: #1a1a1a !important; /* Dark gray text for high contrast */
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(255, 255, 255, 0.6),
        0 0 10px rgba(255, 255, 255, 0.5) !important; /* White glow for readability */
    font-weight: 500 !important; /* Slightly bolder */
}

/* Extra emphasis for names */
.gcc-preview-wedding-card[style*="background-image"] .groom-name,
.gcc-preview-wedding-card[style*="background-image"] .bride-name,
main.gcc-preview-wedding-card[style*="background-image"] .groom-name,
main.gcc-preview-wedding-card[style*="background-image"] .bride-name {
    color: #000000 !important; /* Pure black for names */
    font-weight: 600 !important; /* Bolder names */
}

/* Z-index for content over background */
.gcc-preview-wedding-card[style*="background-image"] > *,
main.gcc-preview-wedding-card[style*="background-image"] > * {
    position: relative !important;
    z-index: 1 !important;
}

/* Modern layout sidebar - also transparent */
.gcc-preview-wedding-card[data-layout="modern"][style*="background-image"] .wedding-photo-sidebar,
main.gcc-preview-wedding-card[data-layout="modern"][style*="background-image"] .wedding-photo-sidebar {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
}

/* Elegant layout overlay - also transparent */
.gcc-preview-wedding-card[data-layout="elegant"][style*="background-image"] .wedding-content-overlay,
main.gcc-preview-wedding-card[data-layout="elegant"][style*="background-image"] .wedding-content-overlay {
    background: transparent !important;
    backdrop-filter: none !important;
}

/* Minimalist layout photo - also transparent */
.gcc-preview-wedding-card[data-layout="minimalist"][style*="background-image"] .wedding-photo-minimal,
main.gcc-preview-wedding-card[data-layout="minimalist"][style*="background-image"] .wedding-photo-minimal {
    background: transparent !important;
    border: none !important;
}

/* Fallback for no background - ensure white */
.gcc-preview-wedding-card:not([style*="background-image"]),
main.gcc-preview-wedding-card:not([style*="background-image"]),
.gcc-wedding-card:not([style*="background-image"]) {
    background: #ffffff !important;
}

/* When NO background, restore default backgrounds */
.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-header,
.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-content,
.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-footer,
main.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-header,
main.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-content,
main.gcc-preview-wedding-card:not([style*="background-image"]) .wedding-footer {
    background: transparent !important;
    backdrop-filter: none !important;
    text-shadow: none !important;
}

/* Print support */
@media print {
    .gcc-preview-wedding-card[style*="background-image"],
    main.gcc-preview-wedding-card[style*="background-image"],
    .gcc-wedding-card[style*="background-image"] {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* ==========================================================================
   END BACKGROUND IMAGE FIX
   ========================================================================== */

/* ==========================================================================
   CARD VIEW SIZE FIX
   main tag trong card view bị giới hạn bởi container nhỏ
   Dùng width cố định + overflow-x: auto trên body để scroll ngang nếu cần
   ========================================================================== */

/* Portrait: luôn 400px dù container nhỏ hơn */
main.gcc-preview-wedding-card.gcc-preview-wedding-card[data-orientation="portrait"] {
    width: 400px !important;}