.affidavit-header {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #dee2e6;
}

.affidavit-header h2 {
  margin: 0 0 10px 0;
  color: #333;
  text-align: center;
}

.header-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-controls button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-controls button::before {
  content: '';
  width: 16px;
  height: 16px;
  display: inline-block;
}

.print-btn::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>') no-repeat center;
  background-size: contain;
}

.import-export-btn::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>') no-repeat center;
  background-size: contain;
}

.share-btn::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z"/></svg>') no-repeat center;
  background-size: contain;
}

.clear-btn::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"/></svg>') no-repeat center;
  background-size: contain;
}

.import-export-btn {
  background: #8b5cf6;
  color: white;
}

.import-export-btn:hover {
  background: #7c3aed;
}

.clear-btn {
  background: #9ca3af;
  color: white;
}

.clear-btn:hover {
  background: #6b7280;
}

.download-btn {
  background: #6b7280;
  color: white;
}

.download-btn:hover {
  background: #4b5563;
}

.share-btn {
  background: #10b981;
  color: white;
}

.share-btn:hover {
  background: #059669;
}

.print-btn {
  background: #3b82f6;
  color: white;
}

.print-btn:hover {
  background: #2563eb;
}

.dynamic-field {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.3s ease;
  display: inline-block;
  min-width: 60px;
  text-align: center;
  border: 2px dashed pink;
  text-transform: capitalize;
  color: rgba(0, 0, 0, .3);
}

.dynamic-field:hover {
  background-color: #f0f0f0;
  border-color: #007bff;
}

/* Green border for filled fields - exactly 2px as required */
.dynamic-field[style*="border: 2px solid rgb(76, 175, 80)"],
.dynamic-field[style*="border: 2px solid #4caf50"] {
  background-color: #e8f5e8 !important;
  border: 2px solid #4caf50 !important;
}

.field-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fefefe !important;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  width: 80%;
  max-width: 300px;
  position: relative;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 10px;
}

.close:hover,
.close:focus {
  color: black;
}

#modalBody input,
#modalBody select {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

#modalBody button {
  background: #007bff;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 5px;
}

#modalBody button:hover {
  background: #0056b3;
}

#validationMessage {
  background: #f8d7da;
  color: #721c24;
  padding: 8px;
  border-radius: 4px;
  margin: 10px 0;
  border: 1px solid #f5c6cb;
  font-size: 13px;
  font-weight: 500;
}

.input-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.tooltip {
  position: fixed;
  background: #333;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1001;
  pointer-events: none;
  max-width: 200px;
  word-wrap: break-word;
}

.affidavit-field-item {
  background: white;
  padding: 30px;
  border: 1px solid #ddd;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 14px;
  text-align: justify;
}

@media print {
  .affidavit-header {
    display: none;
  }

  .affidavit-field-wrapper {
    padding: 0;
    margin: 0;
  }

  .dynamic-field {
    border: none !important;
    background: transparent !important;
  }
}

@media (max-width: 768px) {
  .header-controls {
    flex-direction: column;
    align-items: center;
  }

  .header-controls button {
    width: 100%;
    max-width: 200px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}
