     .container {
         max-width: 1200px;
         margin: 0 auto;
         background-color: white;
         padding: 20px;
         border-radius: 10px;
         box-shadow: 0 0 15px rgba(0,0,0,0.1);
     }

     h1 {
         text-align: center;
         color: #2c3e50;
         margin-bottom: 30px;
     }

     .form-section, .preview-section {
         margin-bottom: 30px;
         padding: 20px;
         border-radius: 8px;
         background-color: #f9f9f9;
     }

     .form-row {
         display: flex;
         flex-wrap: wrap;
         margin-bottom: 15px;
         gap: 15px;
     }

     .form-group {
         flex: 1;
         min-width: 250px;
     }

     label {
         display: block;
         margin-bottom: 5px;
         font-weight: bold;
         color: #2c3e50;
     }

     input[type="text"],
     input[type="datetime-local"],
     textarea,
     select {
         width: 100%;
         padding: 10px;
         border: 1px solid #ddd;
         border-radius: 4px;
         font-size: 16px;
         font-family: inherit;
     }

     textarea {
         height: 100px;
         resize: vertical;
     }

     button {
         background-color: #3498db;
         color: white;
         border: none;
         padding: 10px 20px;
         border-radius: 4px;
         cursor: pointer;
         font-size: 16px;
         transition: background-color 0.3s;
         margin-right: 10px;
     }

         button:hover {
             background-color: #2980b9;
         }

     .card-templates {
         display: flex;
         flex-wrap: wrap;
         gap: 15px;
         margin-bottom: 20px;
         justify-content: center;
     }

     .template-option {
         padding: 10px 20px;
         border: 2px solid #ddd;
         border-radius: 4px;
         cursor: pointer;
         text-align: center;
         font-weight: bold;
         transition: all 0.3s ease;
         flex: 1;
         min-width: 120px;
         max-width: 180px;
     }

         .template-option.selected {
             border-color: #3498db;
             background-color: #eaf4fc;
             color: #3498db;
             box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
         }

     /* Card Styles - Base */
     .card-container {
         display: flex;
         justify-content: center;
         margin: 20px 0;
     }

     .invitation-card {
         position: relative;
         background-color: #fff9e6; /* Default background */
         padding: 30px;
         box-sizing: border-box;
         border: 15px solid transparent; /* Main outer border */
         border-image-slice: 1;
         box-shadow: 0 10px 30px rgba(0,0,0,0.2);
         overflow: hidden;
         width: 513px; /* Decreased width by 10% more (570px * 0.9 = 513px) */
         height: auto; /* Adjust height based on content */
         min-height: 600px; /* Minimum height for vertical cards */
         display: flex;
         flex-direction: column;
         justify-content: space-between; /* Distribute content */
     }

     /* Inner borders - common styles */
     .card-inner-border-1, .card-inner-border-2 {
         position: absolute;
         pointer-events: none;
         box-sizing: border-box; /* Include padding and border in the element's total width and height */
     }

     .card-inner-border-1 {
         top: 5px;
         left: 5px;
         right: 5px;
         bottom: 5px;
     }

     .card-inner-border-2 {
         top: 10px;
         left: 10px;
         right: 10px;
         bottom: 10px;
     }

     /* School/Org Name at top */
     .card-school-org-info {
         text-align: center;
         margin-bottom: 15px;
         font-size: 1.1em;
         font-weight: bold;
         color: #555;
         line-height: 1.4;
     }

         .card-school-org-info p {
             margin: 0; /* Remove default paragraph margins */
             padding: 2px 0;
         }

     /* Event Details Heading */
     .event-details-heading {
         display: flex;
         align-items: center;
         justify-content: center;
         margin: 15px 0;
         text-align: center;
         font-weight: bold;
         font-size: 20px;
         color: #2c3e50; /* Default color */
         white-space: nowrap;
         overflow: hidden;
         text-overflow: ellipsis;
     }

         .event-details-heading .line {
             flex: 1;
             height: 1px;
             background-color: #ccc; /* Default color */
             margin: 0 10px;
         }

         .event-details-heading .icon {
             font-size: 22px;
             color: #e74c3c; /* Default color */
             margin: 0 5px;
             flex-shrink: 0; /* Prevent icon from shrinking */
         }

     /* Template 1 */
     .template-1 {
         /* Simpler border for better PNG capture */
         border: 10px solid #3498db;
         background: linear-gradient(to bottom right, #eaf4fc, #f5faff); /* Subtle gradient background */
     }

         .template-1 .card-inner-border-1 {
             border: 3px solid #8e44ad;
             border-radius: 12px; /* Slightly rounded corners for inner border */
         }

         .template-1 .card-inner-border-2 {
             border: 2px dashed #2ecc71; /* Dashed inner border */
             border-radius: 10px;
         }

         .template-1 .card-title {
             color: #8e44ad;
         }

         .template-1 .divider {
             display: none;
         }
         /* Hide old divider from this template */
         .template-1 .event-details-heading {
             color: #8e44ad;
         }

             .template-1 .event-details-heading .line {
                 background-color: #3498db;
             }

             .template-1 .event-details-heading .icon {
                 color: #e74c3c;
             }

         .template-1 .card-school-org-info {
             color: #555;
         }

         .template-1 .card-invitee {
             border-bottom: none;
         }
     /* No line after invitee name */


     /* Template 2 */
     .template-2 {
         border-image: linear-gradient(to right, #FF7E5F, #FEB47B);
         background-color: #FFF3E0;
         color: #5D4037;
         border: 10px solid #FF7043; /* Solid border to mix with image */
     }

         .template-2 .card-inner-border-1 {
             border: 3px double #FF7E5F;
         }

         .template-2 .card-inner-border-2 {
             display: none; /* No second inner border */
         }

         .template-2 .card-title {
             color: #E64A19;
             font-size: 28px;
             text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
         }

         .template-2 .card-invitee {
             border-bottom: 2px dotted #FF7043;
             color: #795548;
         }

         .template-2 .card-body {
             font-size: 17px;
         }

         .template-2 .card-place, .template-2 .card-time {
             color: #C2185B;
             font-size: 19px;
             text-transform: uppercase;
         }

         .template-2 .divider {
             display: none;
         }
         /* Hide old divider */
         .template-2 .event-details-heading {
             color: #E64A19;
         }

             .template-2 .event-details-heading .line {
                 background-color: #FF7043;
                 height: 2px;
             }

             .template-2 .event-details-heading .icon {
                 color: #FF5722;
                 font-size: 26px;
             }

         .template-2 .card-school-org-info {
             color: #5D4037;
         }

         .template-2 .card-invitee {
             border-bottom: none;
         }
     /* No line after invitee name */


     /* Template 3 */
     .template-3 {
         border-image: linear-gradient(135deg, #56ab2f, #a8e063);
         background-color: #E8F5E9;
         color: #2E7D32;
         border: 10px groove #56ab2f; /* Thicker groove border */
     }

         .template-3 .card-inner-border-1 {
             border: 4px groove #56ab2f;
         }

         .template-3 .card-inner-border-2 {
             border: 1px solid #8BC34A;
         }

         .template-3 .card-title {
             color: #388E3C;
             font-size: 26px;
             font-weight: 700;
         }

         .template-3 .card-invitee {
             border-bottom: 1px solid #66BB6A;
             padding-bottom: 8px;
         }

         .template-3 .card-body {
             font-size: 16.5px;
             color: #4CAF50;
         }

         .template-3 .card-place, .template-3 .card-time {
             color: #1B5E20;
             font-size: 18px;
             font-weight: bold;
         }

         .template-3 .divider {
             display: none;
         }
         /* Hide old divider */
         .template-3 .event-details-heading {
             color: #388E3C;
         }

             .template-3 .event-details-heading .line {
                 background-color: #4CAF50;
             }

             .template-3 .event-details-heading .icon {
                 color: #8BC34A;
                 font-size: 20px;
                 content: '🌿';
             }

         .template-3 .card-school-org-info {
             color: #2E7D32;
         }

         .template-3 .card-invitee {
             border-bottom: none;
         }
     /* No line after invitee name */


     /* Template 4 */
     .template-4 {
         border-image: linear-gradient(to bottom right, #4CAF50, #2196F3);
         background-color: #E3F2FD;
         color: #1565C0;
         border-radius: 15px;
         border: 8px double #90CAF9; /* Unique double border */
     }

         .template-4 .card-inner-border-1 {
             border: 2px solid #BBDEFB;
             border-radius: 12px;
         }

         .template-4 .card-inner-border-2 {
             display: none;
         }
         /* No second inner border */
         .template-4 .card-header {
             border-bottom: 1px dashed #90CAF9;
             padding-bottom: 10px;
             margin-bottom: 10px;
         }

         .template-4 .card-title {
             color: #2196F3;
             font-size: 25px;
             font-style: italic;
         }

         .template-4 .card-invitee {
             color: #42A5F5;
             font-size: 17px;
             font-weight: 600;
             border-bottom: none;
             text-align: left;
             padding-left: 10px;
         }

         .template-4 .card-body {
             font-size: 16px;
             color: #1976D2;
         }

         .template-4 .card-place, .template-4 .card-time {
             color: #0D47A1;
             font-size: 17px;
             font-weight: 700;
             background-color: #E0F2F7;
             padding: 5px 10px;
             border-radius: 5px;
             margin: 5px 0;
             text-align: left;
         }

         .template-4 .divider {
             display: none;
         }
         /* Hide divider for this template */
         .template-4 .event-details-heading {
             color: #0D47A1;
             font-size: 18px;
             text-transform: uppercase;
             letter-spacing: 1px;
         }

             .template-4 .event-details-heading .line {
                 background-color: #BBDEFB;
                 height: 1.5px;
             }

             .template-4 .event-details-heading .icon {
                 color: #2196F3;
                 font-size: 20px;
                 content: '⚙️';
             }

         .template-4 .card-school-org-info {
             color: #1565C0;
         }

         .template-4 .card-invitee {
             border-bottom: none;
         }
     /* No line after invitee name */


     /* Template 5 */
     .template-5 {
         border-image: linear-gradient(to top left, #F06292, #BA68C8);
         background-color: #FCE4EC;
         color: #880E4F;
         border-radius: 20px;
         font-family: 'Times New Roman', serif;
         border: 12px solid #E91E63; /* Thick solid border */
     }

         .template-5 .card-inner-border-1 {
             border: 5px solid #F8BBD0;
             border-radius: 18px;
         }

         .template-5 .card-inner-border-2 {
             border: 1px dashed #EC407A;
             border-radius: 18px;
         }

         .template-5 .card-header {
             justify-content: center; /* Center logos if both exist */
             margin-bottom: 20px;
         }

         .template-5 .card-title {
             color: #AD1457;
             font-size: 30px;
             font-family: 'Georgia', serif;
             text-decoration: underline;
             margin-bottom: 20px;
         }

         .template-5 .card-invitee {
             text-align: left;
             font-size: 20px;
             font-weight: normal;
             border-bottom: 2px solid #F06292;
             padding-bottom: 10px;
             margin-bottom: 20px;
         }

         .template-5 .card-body {
             font-size: 18px;
             line-height: 1.6;
             color: #C2185B;
             text-align: center;
             margin-bottom: 25px;
         }

         .template-5 .card-place, .template-5 .card-time {
             color: #D81B60;
             font-size: 20px;
             font-weight: bold;
             margin-top: 20px;
             background-color: #FCE4EC;
             padding: 8px 15px;
             border-radius: 10px;
             border: 1px solid #F48FB1;
         }

         .template-5 .divider {
             margin: 20px 0;
             opacity: 0.7;
         }

         .template-5 .divider-line {
             background: linear-gradient(to right, transparent, #F06292, transparent);
             height: 1px;
         }

         .template-5 .divider-star {
             color: #BA68C8;
             font-size: 22px;
         }

         .template-5 .event-details-heading {
             color: #AD1457;
             font-size: 24px;
             font-family: 'Georgia', serif;
             margin-top: 25px;
         }

             .template-5 .event-details-heading .line {
                 background-color: #EC407A;
                 height: 1px;
             }

             .template-5 .event-details-heading .icon {
                 color: #BA68C8;
                 font-size: 28px;
                 content: '🌸';
             }

         .template-5 .card-school-org-info {
             color: #880E4F;
         }

         .template-5 .card-invitee {
             border-bottom: none;
         }
     /* No line after invitee name */


     /* Card Content - General */
     .card-content {
         height: 100%;
         display: flex;
         flex-direction: column;
         position: relative;
         z-index: 1; /* Ensure content is above borders */
     }

     .card-header {
         display: flex;
         justify-content: space-between;
         align-items: center;
         margin-bottom: 15px;
     }

     .card-logo {
         height: 80px;
         width: auto;
         max-width: 200px;
         object-fit: contain;
     }

     .card-title {
         text-align: center;
         font-size: 24px;
         font-weight: bold;
         margin: 15px 0;
     }

     .card-invitee {
         text-align: center;
         margin: 15px 0;
         font-size: 18px;
         border-bottom: 1px dashed #e74c3c; /* This will be overridden by template specific CSS */
         padding-bottom: 10px;
         word-wrap: break-word; /* Ensure long names wrap */
     }

     .card-body {
         flex: 1;
         text-align: justify;
         font-size: 16px;
         line-height: 1.5;
         margin: 10px 0;
         overflow-y: auto; /* Allow scrolling if content overflows */
     }

     .card-place, .card-time {
         text-align: center;
         margin: 10px 0;
         font-size: 18px;
         font-weight: bold;
     }

     .divider {
         display: none; /* This old divider is explicitly hidden now */
     }

     .divider-line {
         flex: 1;
         height: 1px;
         background: linear-gradient(to right, transparent, #3498db, transparent);
     }

     .divider-star {
         margin: 0 10px;
         color: #e74c3c;
         font-size: 20px;
     }

     .download-buttons {
         display: flex;
         justify-content: center;
         gap: 20px;
         margin-top: 30px;
     }

     /* Print Specific Styles */
     @media print {
         body * {
             visibility: hidden;
         }

         .invitation-card, .invitation-card * {
             visibility: visible;
         }

         .invitation-card {
             position: absolute;
             left: 0;
             top: 0;
             width: 100%; /* Use 100% of print area */
             max-width: 513px; /* Limit width to card size for centering */
             height: auto;
             box-shadow: none;
             border: none;
             padding: 0;
             margin: 0 auto; /* Center card on print page */
             background-color: white;
             overflow: visible !important;
         }

             .invitation-card .card-inner-border-1,
             .invitation-card .card-inner-border-2 {
                 display: none;
             }

         .card-container {
             display: block;
         }
     }