/* Global Styles */
:root {
  /* Blue Catholic theme colors */
  --primary-color: #1e3a8a; /* Deep blue for main elements */
  --primary-dark: #0f2361; /* Darker blue */
  --secondary-color: #95a5a6;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #f5f8ff; /* Light blue background */
  --bg-light: #ffffff;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gold-accent: #f59e0b; /* Gold for accents */
  --blue-accent: #3b82f6; /* Light blue accent */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #f0f9ff 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

/* Catholic decorative background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 138, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(147, 197, 253, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 24px;
  padding: 32px 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1e40af 100%);
  background-size: 200% 200%;
  color: white;
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: gradientAnimation 8s ease infinite;
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

/* Cross decoration in header */
.header::before {
  content: '✝';
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 3rem;
  opacity: 0.15;
  color: var(--gold-accent);
  transform: rotate(15deg);
}

.header::after {
  content: '✝';
  position: absolute;
  bottom: 15px;
  left: 20px;
  font-size: 3rem;
  opacity: 0.15;
  color: var(--gold-accent);
  transform: rotate(-15deg);
}

.title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.tagline {
  font-size: 0.9375rem;
  opacity: 0.9;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  line-height: 1.4;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.subtitle {
  font-size: 1.0625rem;
  opacity: 0.95;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.mobile-break {
  display: none;
}

/* Main Content */
.main {
  flex: 1;
  margin-bottom: 40px;
}

/* PWA Install Prompt */
.install-prompt {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 2px solid var(--blue-accent);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
  animation: slideUpFadeIn 0.5s ease-out;
}

.install-prompt-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.install-prompt-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.install-prompt-text {
  flex: 1;
  min-width: 200px;
}

.install-prompt-text h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 4px 0;
}

.install-prompt-text p {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
}

.install-prompt-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .install-prompt-content {
    flex-direction: column;
    text-align: center;
  }
  
  .install-prompt-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .install-prompt-actions .btn {
    width: 100%;
  }
}

/* Offline Indicator */
.offline-indicator {
  background: linear-gradient(135deg, #fbbf24 0%, var(--warning-color) 100%);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1100; /* Above modal (z-index: 1000) */
}

.alert-success {
  background: linear-gradient(135deg, #34d399 0%, var(--success-color) 100%);
  color: white;
}

.alert-error {
  background: linear-gradient(135deg, #f87171 0%, var(--error-color) 100%);
  color: white;
}

.alert-info {
  background: linear-gradient(135deg, var(--blue-accent) 0%, var(--primary-color) 100%);
  color: white;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0c1d4a);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-success {
  background: linear-gradient(135deg, #34d399, var(--success-color));
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, var(--error-color));
  color: white;
}

.btn-large {
  padding: 18px 32px;
  font-size: 1.125rem;
  width: 100%;
  border-radius: 16px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Form Section */
.form-section {
  margin-bottom: 32px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

.modal-content {
  background: var(--bg-light);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  margin: auto;
  position: relative;
  border: 3px solid var(--gold-accent);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.5rem;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--text-color);
}

/* Form */
form {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-color);
}

.required {
  color: var(--error-color);
  font-weight: 700;
  font-size: 1.1em;
  margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

small {
  display: block;
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.form-actions .btn {
  flex: 1;
}

/* History Section */
.history-section {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.015em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-item {
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: slideUpFadeIn 0.4s ease-out;
}

.history-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue-accent), var(--primary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.history-item:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.history-item:hover::before {
  opacity: 1;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
  gap: 12px;
}

.history-item-name {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text-color);
  letter-spacing: -0.01em;
  flex: 1;
}

.history-item-status {
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.status-pending {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
}

.status-synced {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
}

.status-failed {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
}

.history-item-contact {
  color: var(--text-light);
  font-size: 0.8125rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-item-date {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-item-intention {
  color: var(--text-color);
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.history-item-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Status badge */
.status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-right: auto;
}

.status-badge.status-offered {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.status-badge.status-pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fbbf24;
}

.sync-item-btn {
  background: linear-gradient(135deg, var(--blue-accent), var(--primary-color));
  color: white;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sync-item-btn:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.delete-item-btn {
  background: linear-gradient(135deg, #f87171, var(--error-color));
  color: white;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.delete-item-btn:hover {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.sync-icon.spinning {
  animation: spin 1s linear infinite;
}

.empty-message {
  text-align: center;
  color: var(--text-light);
  padding: 48px 20px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 20px;
}

.footer p {
  opacity: 0.8;
  margin-bottom: 8px;
}

.footer p:last-child {
  margin-top: 12px;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  display: inline-block;
}

.footer a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  background: linear-gradient(90deg, var(--blue-accent), var(--primary-color));
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.footer a:hover {
  color: var(--primary-dark);
}

.footer a:hover::after {
  width: 100%;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

.spinning {
  animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header {
    padding: 28px 20px;
    border-radius: 20px;
    margin-bottom: 20px;
  }

  .title {
    font-size: 1.5rem;
    white-space: nowrap;
    margin-bottom: 10px;
  }

  .tagline {
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .subtitle {
    font-size: 0.9375rem;
    margin-top: 2px;
  }

  .mobile-break {
    display: inline;
  }

  .form-section {
    margin-bottom: 32px;
  }

  .btn-large {
    padding: 16px 28px;
    font-size: 1.0625rem;
  }

  .history-section {
    padding: 16px;
    border-radius: 16px;
  }

  .history-item {
    padding: 16px;
    border-radius: 14px;
  }

  .history-item-name {
    font-size: 1rem;
  }

  .history-item-status {
    padding: 5px 12px;
    font-size: 0.75rem;
  }

  .history-item-contact {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }

  .history-item-date {
    font-size: 0.8125rem;
  }

  .history-item-intention {
    font-size: 0.875rem;
  }

  .history-item-actions {
    padding-top: 10px;
  }

  .delete-item-btn,
  .sync-item-btn {
    padding: 7px 14px;
    font-size: 0.8125rem;
  }

  .modal {
    padding: 10px;
    align-items: flex-start;
  }

  .modal-content {
    border-radius: 16px;
    max-height: 95vh;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-light);
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    padding: 14px 16px;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  form {
    padding: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  label {
    margin-bottom: 4px;
    font-size: 0.9375rem;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="date"],
  textarea {
    padding: 10px;
    font-size: 0.9375rem;
  }

  textarea {
    min-height: 70px;
  }

  small {
    font-size: 0.8125rem;
    margin-top: 2px;
  }

  .form-actions {
    flex-direction: column-reverse;
    margin-top: 16px;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
  }

  #captcha-container {
    min-height: 50px;
    margin: 0;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

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

  .section-header .btn {
    width: 100%;
  }
}

/* Catholic decorative elements */
.form-section .btn-large {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  border: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  position: relative;
  overflow: hidden;
}

.form-section .btn-large::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.form-section .btn-large:hover::before {
  left: 100%;
}

.form-section .btn-large:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  transform: translateY(-3px);
}

/* Captcha container styling */
#captcha-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
}

/* Print Styles */
@media print {
  .btn,
  .form-section,
  .footer {
    display: none;
  }
}

