:root {
  --primary-gold: #c9a961;
  --primary-green: #1b5e3f;
  --dark-green: #0f3d2a;
  --light-gold: #e8d9b5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, #1b5e3f 0%, #0f3d2a 100%);
  min-height: 100vh;
  color: #2c2c2c;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

header {
  text-align: center;
  margin-bottom: 50px;
  color: white;
}
.header-logo {
  margin-bottom: 25px;
}
.logo-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #c9a961, #e8d9b5);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.arabic-text {
  font-size: 40px;
  color: #0f3d2a;
}
header h1 {
  font-family: "Playfair Display", serif;
  font-size: 2.8rem;
  margin-bottom: 15px;
}
.header-divider {
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c9a961, transparent);
  margin: 20px auto;
}
.tagline {
  font-size: 1.3rem;
  color: #e8d9b5;
  margin-bottom: 8px;
  font-style: italic;
}
.subtitle {
  font-size: 1rem;
}

/* FORM STYLES */
.form-section {
  background: white;
  padding: 45px;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
  margin-bottom: 30px;
  position: relative;
}
.form-section::before,
.form-section::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid #c9a961;
}
.form-section::before {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
}
.form-section::after {
  bottom: 15px;
  right: 15px;
  border-left: none;
  border-top: none;
}
.form-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px solid #e0ddd8;
}
.form-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  color: #1b5e3f;
  margin-bottom: 10px;
}
.form-header p {
  color: #666;
  font-size: 0.95rem;
}
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.form-row {
  display: flex;
  gap: 20px;
}
.form-row.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.form-group label {
  font-weight: 600;
  margin-bottom: 10px;
  color: #2c2c2c;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.label-icon {
  font-size: 1.1rem;
}

.form-group input,
.form-group select {
  padding: 15px 18px;
  border: 2px solid #e0ddd8;
  border-radius: 10px;
  font-size: 16px;
  background: #f9f7f4;
  font-family: "Montserrat", sans-serif;
  transition: all 0.3s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #c9a961;
  background: white;
  box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.1);
}
.form-group select {
  cursor: pointer;
}
.form-footer {
  margin-top: 15px;
  text-align: center;
}
.submit-btn {
  background: linear-gradient(135deg, #1b5e3f 0%, #0f3d2a 100%);
  color: white;
  padding: 18px 45px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(27, 94, 63, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(27, 94, 63, 0.4);
}
.btn-icon {
  font-size: 1.3rem;
}
.form-note {
  margin-top: 15px;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* STATUS MESSAGES */
.loading,
.success,
.error {
  padding: 20px;
  border-radius: 12px;
  margin-top: 25px;
  text-align: center;
  font-weight: 600;
}
.loading {
  background: #e3f2fd;
  color: #1976d2;
  border: 2px solid #bbdefb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px;
}
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #bbdefb;
  border-top: 4px solid #c9a961;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.loading-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: #1b5e3f;
}
.loading-dots {
  display: flex;
  gap: 3px;
}
.loading-dots span {
  animation: loadingDots 1.5s infinite;
}
.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}
.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes loadingDots {
  0%,
  60%,
  100% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
}
.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 2px solid #c8e6c9;
}
.error {
  background: #ffebee;
  color: #c62828;
  border: 2px solid #ffcdd2;
}
.hidden {
  display: none !important;
}

/* CARD STYLES */
.card-section {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.fullscreen-card {
  top: 0;
  left: 0;

  background: linear-gradient(135deg, #1b5e3f 0%, #0f3d2a 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.5s;
}
.fullscreen-card.card-visible {
  opacity: 1;
}
.fullscreen-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
}
.fullscreen-header {
  margin-bottom: 45px;
  color: white;
  text-align: center;
}
.success-icon {
  width: 80px;
  height: 80px;
  background: #c9a961;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: #0f3d2a;
  margin-bottom: 20px;
}
.fullscreen-header h1 {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  margin-bottom: 15px;
}
.fullscreen-header p {
  font-size: 1.2rem;
  color: #e8d9b5;
  font-style: italic;
}
.card-container {
  margin-bottom: 40px;
}

/* RSVP CARD */
.rsvp-card {
  width: 500px;
  min-height: 320px;
  background: linear-gradient(135deg, #ffffff 0%, #f9f7f4 100%);
  border: 3px solid #c9a961;
  border-radius: 15px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}
.card-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid #c9a961;
}
.corner-tl {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
}
.corner-tr {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
}
.corner-bl {
  bottom: 10px;
  left: 10px;
  border-right: none;
  border-top: none;
}
.corner-br {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
}
.logo-placeholder {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #c9a961, #e8d9b5);
  border: 3px solid #1b5e3f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.star-moon {
  font-size: 30px;
  color: #0f3d2a;
}

.card-title {
  flex: 1;
  text-align: left;
}
.card-title h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  color: #1b5e3f;
  margin-bottom: 3px;
  font-weight: 700;
  letter-spacing: 2px;
}
.event-name {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}
.badge-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, #c9a961, transparent);
  margin: 15px 0;
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.guest-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.info-item .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.info-item .value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #2c2c2c;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}
.name-item .value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1b5e3f;
  font-family: "Playfair Display", serif;
}
/* Make email and phone text smaller to fit better */
.info-item:not(.name-item):not(.half) .value {
  font-size: 0.85rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  gap: 15px;
}

.footer-text {
  flex: 1;
  text-align: right;
}
.tagline-small {
  font-size: 0.8rem;
  color: #1b5e3f;
  font-style: italic;
  margin-bottom: 3px;
}
.website {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
}
.card-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.print-btn,
.new-card-btn {
  padding: 15px 35px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.print-btn {
  background: linear-gradient(135deg, #c9a961, #e8d9b5);
  color: #0f3d2a;
}
.new-card-btn {
  background: white;
  color: #1b5e3f;
  border: 2px solid #c9a961;
}
.print-btn:hover,
.new-card-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  .tagline {
    font-size: 1.1rem;
  }
  .form-section {
    padding: 30px 25px;
  }
  .form-row.two-columns {
    grid-template-columns: 1fr;
  }
  .rsvp-card {
    width: 100%;
    max-width: 400px;
  }
  .card-title h2 {
    font-size: 1.2rem;
  }
  .fullscreen-header h1 {
    font-size: 2rem;
  }
  .card-actions {
    flex-direction: column;
  }
}
@media (max-width: 480px) {
  header h1 {
    font-size: 1.6rem;
  }
  .form-section {
    padding: 25px 20px;
  }
  .submit-btn {
    padding: 15px 30px;
    font-size: 1rem;
  }
  .rsvp-card {
    max-width: 340px;
    padding: 18px;
  }
}

/* PRINT */
@page {
  margin: 0; /* Remove browser headers/footers including website URL */
  size: A4 portrait;
}

@media print {
  /* Hide everything on the page */
  body * {
    visibility: hidden;
  }

  /* Only show the cards and their contents */
  .rsvp-card,
  .rsvp-card *,
  .duplicate-card,
  .duplicate-card * {
    visibility: visible;
  }

  /* Position first card (OFFICE COPY) - left side */
  .rsvp-card {
    position: absolute;
    left: 0.25in;
    top: 0.25in;
    width: 3.5in;
    min-height: 2.5in;
    box-shadow: none;
    border: 2px solid #c9a961;
    margin: 0;
    padding: 0.15in;
    page-break-inside: avoid;
  }

  /* Position second card (VISITOR COPY) - below cutting line */
  .duplicate-card {
    position: absolute;
    left: 4.3in;
    top: 0.25in;
    width: 3.5in;
    min-height: 2.5in;
    box-shadow: none;
    border: 2px solid #c9a961;
    margin: 0;
    padding: 0.15in;
    page-break-inside: avoid;
  }

  /* Cutting line at 50% height */
  /* body::before {
    content: "";
    position: absolute;
    left: 4in;
    top: 0;
    width: 10px;
    height: 50vh;
    border-top: 2px dashed #999;
    z-index: 1000;
    visibility: visible;
  } */

  /* Alternative cutting line with text */
  /* body::after {
    content: "✂️ CUT HERE ✂️ CUT HERE ✂️ CUT HERE ✂️ CUT HERE ✂️ CUT HERE ✂️ CUT HERE ✂️";
    position: absolute;
    left: 0;
    top: calc(50% - 10px);
    width: 100%;
    text-align: center;
    font-size: 8pt;
    color: #666;
    font-weight: bold;
    letter-spacing: 2px;
    z-index: 999;
    visibility: visible;
  } */

  /* Style for copy labels */
  .copy-label {
    position: absolute;
    top: -0.3in;
    left: 0;
    font-size: 8pt;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* Hide all buttons and unnecessary elements when printing */
  .card-actions,
  .fullscreen-header {
    display: none !important;
    visibility: hidden !important;
  }

  /* Print page setup */
  body {
    margin: 0;
    padding: 0;
  }
}

/* FULL PAGE LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 61, 42, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.loading-overlay.hidden {
  display: none !important;
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.loading-overlay .loading-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(201, 169, 97, 0.2);
  border-top: 6px solid #c9a961;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 30px rgba(201, 169, 97, 0.3);
}

.loading-overlay .loading-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  color: white;
  font-weight: 600;
}

.loading-overlay .loading-dots {
  display: flex;
  gap: 4px;
}

.loading-overlay .loading-dots span {
  color: #c9a961;
  font-size: 1.5rem;
  animation: loadingDots 1.5s infinite;
}

.loading-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  margin-top: -10px;
  font-style: italic;
}
