/**
 * Contact Form 7 Custom Styling for Barsha Theme
 *
 * Add this to your theme to style CF7 forms to match the Barsha theme design
 */

/* Form Container - Wrap in section with container like other blocks */
.wpcf7 {
  max-width: 100%;
}

/* Add container styling when CF7 is inside a section */
section.contact-form-section {
  margin: 4rem 0;
  background-color: #faf7f3; /* custom-bg */
}

section.contact-form-section > div {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  section.contact-form-section > div {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  section.contact-form-section > div {
    padding: 0 3rem;
  }
}

/* Form Fields */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 textarea,
.wpcf7 select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #382c2c; /* custom-brown */
  background-color: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
  font-family: "Inter", sans-serif;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 input[type="date"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
  outline: none;
  border-color: #ffc999; /* custom-pastel */
  box-shadow: 0 0 0 3px rgba(255, 201, 153, 0.1);
}

/* Textarea Specific */
.wpcf7 textarea {
  min-height: 150px;
  resize: vertical;
}

/* Labels */
.wpcf7 label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #382c2c; /* custom-brown */
  font-family: "Inter", sans-serif;
}

/* Required Asterisk */
.wpcf7 .wpcf7-form-control-wrap abbr {
  color: #dc2626;
  text-decoration: none;
}

/* Form Rows */
.wpcf7 p {
  margin: 0;
}

/* Submit Button */
.wpcf7 input[type="submit"],
.wpcf7 button[type="submit"] {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #382c2c; /* custom-brown */
  background-color: #ffc999; /* custom-pastel */
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  font-family: "Inter", sans-serif;
  transform: scale(1);
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 button[type="submit"]:hover {
  background-color: #d4b191;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(1.05);
}

.wpcf7 input[type="submit"]:active,
.wpcf7 button[type="submit"]:active {
  transform: scale(0.98);
}

/* Validation Errors */
.wpcf7-not-valid-tip {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.wpcf7-not-valid {
  border-color: #dc2626 !important;
}

/* Response Messages */
.wpcf7-response-output {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.wpcf7-mail-sent-ok {
  background-color: #d1fae5;
  color: #065f46;
  border: 2px solid #10b981;
}

.wpcf7-mail-sent-ng,
.wpcf7-validation-errors {
  background-color: #fee2e2;
  color: #991b1b;
  border: 2px solid #dc2626;
}

.wpcf7-spam-blocked {
  background-color: #fef3c7;
  color: #92400e;
  border: 2px solid #f59e0b;
}

/* Spinner/Loading */
.wpcf7 .ajax-loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  vertical-align: middle;
}

/* Acceptance Checkbox */
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
  accent-color: #ffc999; /* custom-pastel */
}

.wpcf7-list-item {
  margin: 0.5rem 0;
}

.wpcf7-list-item-label {
  display: inline;
  font-size: 0.875rem;
  color: #5a4a4a; /* custom-brown-light */
}

/* File Upload */
.wpcf7 input[type="file"] {
  padding: 0.5rem 0;
  border: 2px dashed #e5e5e5;
  border-radius: 0.5rem;
  background-color: #faf7f3; /* custom-bg */
}

.wpcf7 input[type="file"]:focus {
  border-color: #ffc999; /* custom-pastel */
}

/* Select Dropdown */
.wpcf7 select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23382c2c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Two Column Layout (Optional) */
.wpcf7-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.wpcf7-form-row p {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .wpcf7-form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* Accessibility - Screen Reader Text */
.wpcf7-screen-reader-response {
  position: absolute;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
}
