/* AYH Accommodation Booking Styles */
.ayh-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 24px; font-family: inherit !important; box-shadow: 0 4px 12px rgba(0,0,0,0.05); margin: 20px auto; max-width: 720px; }
.ayh-card * { font-family: inherit !important; }
.ayh-header { text-align: center; border-bottom: 2px dashed #cbd5e1; padding-bottom: 16px; margin-bottom: 20px; }
.ayh-title { font-size: 20px; color: #1e293b; margin: 0; font-weight: bold; }
.ayh-subtitle { font-size: 12px; color: #64748b; margin-top: 4px; }
.ayh-section { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.ayh-sec-title { font-size: 13px; color: var(--ayh-primary, #2563eb); margin: 0 0 12px 0; font-weight: bold; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }
.ayh-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ayh-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ayh-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ayh-field { margin-bottom: 10px; }
.ayh-field label { display: block; font-size: 11px; font-weight: bold; color: #334155; margin-bottom: 4px; }
.ayh-field label .req { color: #e11d48; }
.ayh-field input, .ayh-field select, .ayh-field textarea { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12px; font-family: inherit !important; background: #ffffff; box-sizing: border-box; color: #1e293b; }
.ayh-field input:focus, .ayh-field select:focus, .ayh-field textarea:focus { border-color: var(--ayh-primary, #2563eb); outline: none; }
.ayh-field input.ayh-input-valid { border-color: #10b981 !important; box-shadow: 0 0 0 1px #10b981 !important; }
.ayh-field input.ayh-input-invalid { border-color: #f43f5e !important; box-shadow: 0 0 0 1px #f43f5e !important; }
.ayh-field input.ayh-input-incomplete { border-color: #f59e0b !important; box-shadow: 0 0 0 1px #f59e0b !important; }
.ayh-field-hint { display: none; font-size: 11px; color: #d97706; margin-top: 4px; font-weight: 500; }
.ayh-field input:not(:placeholder-shown):invalid ~ .ayh-field-hint { display: block; }
.ayh-field input:not(:placeholder-shown):invalid { border-color: #f59e0b !important; background-color: #fffbeb !important; }
.ayh-select-time { font-size: 13px !important; color: #1e293b !important; font-weight: 600 !important; }
.ayh-checkbox-field label { display: flex !important; align-items: center !important; gap: 8px !important; cursor: pointer; font-size: 12px; color: #1e293b; font-weight: 600; margin: 0 !important; flex-direction: row !important; }
.ayh-checkbox-field input[type="checkbox"] { width: 18px !important; height: 18px !important; min-width: 18px !important; margin: 0 !important; cursor: pointer; accent-color: var(--ayh-primary, #2563eb); order: 0 !important; display: inline-block !important; vertical-align: middle !important; }
.ayh-badge-sum { text-align: center; background: var(--ayh-primary-light, #e0f2fe); color: var(--ayh-primary-text, #0369a1); border: 1px solid var(--ayh-primary-border, #bae6fd); padding: 6px 12px; border-radius: 8px; font-size: 12px; margin-top: 8px; font-weight: bold; }
.ayh-captcha-sec { background: #fff7ed; border-color: #ffedd5; }
.ayh-captcha-box { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.ayh-captcha-q { font-weight: bold; font-size: 13px; color: #1e293b; white-space: normal; }
.ayh-captcha-box input { width: 80px !important; min-width: 80px !important; text-align: center; font-size: 14px; font-weight: bold; padding: 6px; }
.ayh-submit-btn, a.ayh-submit-btn, button.ayh-submit-btn { display: inline-block; width: 100%; text-align: center; background-color: var(--ayh-primary, #2563eb) !important; color: #ffffff !important; border: none; padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s ease-in-out; font-family: inherit !important; text-decoration: none !important; box-sizing: border-box; }
.ayh-submit-btn:hover, a.ayh-submit-btn:hover, button.ayh-submit-btn:hover,
.ayh-submit-btn:focus, a.ayh-submit-btn:focus, button.ayh-submit-btn:focus,
.ayh-submit-btn:active, a.ayh-submit-btn:active, button.ayh-submit-btn:active { background-color: var(--ayh-primary-hover, #1d4ed8) !important; color: #ffffff !important; text-decoration: none !important; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35); }
.ayh-result-box { margin-top: 16px; padding: 16px; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; font-size: 13px; text-align: center; }

/* Jalali Popover Picker */
.ayh-jalali-popover { position: absolute; z-index: 99999; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15); padding: 12px; width: 280px; font-family: inherit !important; direction: rtl; display: none; }
.ayh-jalali-popover-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: bold; font-size: 13px; color: #1e293b; }
.ayh-jalali-popover-nav { background: #f1f5f9; border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 14px; color: #334155; font-weight: bold; }
.ayh-jalali-popover-nav:hover { background: #e2e8f0; }
.ayh-jalali-popover-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.ayh-jalali-weekday { font-weight: bold; color: #64748b; padding-bottom: 4px; font-size: 11px; }
.ayh-jalali-day { padding: 6px 0; border-radius: 6px; cursor: pointer; color: #1e293b; font-weight: 600; }
.ayh-jalali-day:hover { background: var(--ayh-primary-light, #e0f2fe); color: var(--ayh-primary, #0284c7); }
.ayh-jalali-day.selected { background: var(--ayh-primary, #2563eb) !important; color: #ffffff !important; }
.ayh-jalali-day.disabled { opacity: 0.35; cursor: not-allowed; background: transparent !important; }

/* Voucher Card */
.ayh-voucher-card { background: #ffffff; border: 2px solid var(--ayh-primary, #2563eb); border-radius: 16px; padding: 24px; max-width: 800px; margin: 20px auto; font-family: inherit !important; }
.ayh-voucher-search { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.ayh-search-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ayh-search-form input { flex: 1; min-width: 220px; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-family: inherit !important; background: #ffffff; }
.ayh-search-form button { background: var(--ayh-primary, #2563eb); color: #ffffff; border: none; padding: 10px 22px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; white-space: nowrap; font-family: inherit !important; transition: background 0.2s; }
.ayh-search-form button:hover { background: var(--ayh-primary-hover, #1d4ed8); }
.ayh-v-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 16px; }
.ayh-v-badge { background: var(--ayh-primary-light, #dbeafe); color: var(--ayh-primary-text, #1e40af); padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: bold; }
.ayh-v-title { font-size: 18px; font-weight: bold; color: #1e293b; margin: 0; }
.ayh-v-status { font-weight: bold; font-size: 12px; padding: 6px 12px; border-radius: 8px; }
.ayh-v-status.status-approved { background: #dcfce7; color: #15803d; }
.ayh-v-status.status-rejected { background: #ffe4e6; color: #be123c; }
.ayh-v-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.ayh-v-table th, .ayh-v-table td { border: 1px solid #cbd5e1; padding: 10px; text-align: right; font-size: 12px; }
.ayh-v-table th { background: #f8fafc; font-weight: bold; width: 20%; }
.ayh-print-btn { background: #059669; color: #ffffff; border: none; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; font-family: inherit !important; }

/* Responsive Mobile Layout Fixes */
@media (max-width: 640px) {
  .ayh-card { padding: 14px 12px; border-radius: 12px; margin: 10px auto; }
  .ayh-section { padding: 12px 10px; margin-bottom: 12px; }
  .ayh-grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .ayh-grid-3 { grid-template-columns: 1fr; gap: 8px; }
  .ayh-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ayh-field label { font-size: 11px; }
  .ayh-time-picker-wrapper { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .ayh-time-picker-selects { width: 100% !important; justify-content: center !important; box-sizing: border-box !important; }
  .ayh-time-picker-quick { width: 100% !important; justify-content: space-between !important; box-sizing: border-box !important; }
  .ayh-time-picker-quick select { flex: 1 !important; width: auto !important; }
  .ayh-v-header { flex-direction: column; gap: 8px; text-align: center; }
  .ayh-v-table th, .ayh-v-table td { font-size: 11px; padding: 6px; }
}

/* Print Stylesheet for Clean A4 / Voucher Printing */
@media print {
  /* Hide theme headers, footers, sidebars, admin bar, buttons, search form, rules modal */
  #adminbar, #wpadminbar, header, footer, nav, aside, .sidebar, 
  .elementor-header, .elementor-footer, .elementor-sidebar, .elementor-nav-menu,
  .ayh-voucher-search, .ayh-search-form, .ayh-v-footer, .ayh-print-btn, 
  .ayh-v-rules-box, #ayh-status-rules-btn, #ayh-status-rules-modal, #ayh-rules-modal-overlay, .no-print {
    display: none !important;
    visibility: hidden !important;
  }

  /* Reset html & body dimensions */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Unconstrain parent theme / Elementor containers */
  .elementor-column, .elementor-widget, .elementor-element, .elementor-container,
  .entry-content, main, article, #content, #primary, #main, .site-main, .ayh-voucher-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  /* Printable Voucher Card Container */
  .ayh-voucher-content, .printable {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 18px !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
  }

  .ayh-v-header {
    border-bottom: 2px solid #000000 !important;
    padding-bottom: 10px !important;
    margin-bottom: 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .ayh-v-badge, .ayh-v-status {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    background: #f1f5f9 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 10pt !important;
  }

  .ayh-v-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
  }

  .ayh-v-table th, .ayh-v-table td {
    border: 1px solid #000000 !important;
    padding: 8px 10px !important;
    font-size: 10pt !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .msg-custom {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 12px !important;
    border-radius: 6px !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.8 !important;
  }

  /* Prevent page breaks inside voucher element */
  .ayh-voucher-content, .ayh-v-table, .msg-custom {
    page-break-inside: avoid;
  }
}
