/**
 * Areawise CF7 Popup Styles
 * Core styles not controlled by plugin settings
 */

/* Button styles */
.areawise-force-thank-you {
  display: none !important;
}
.areawise-cf7-popup-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4caf50;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.areawise-cf7-popup-button:hover {
  background-color: #45a049;
}

/* Additional styling - main styles are in initialize.php for dynamic values */
.areawise-cf7-popup-content h2 {
  text-align: center;
  margin-top: 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.areawise-cf7-selector-step h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* Form styling */
.areawise-cf7-selector-step-form .wpcf7-form p {
  margin-bottom: 15px;
}

.areawise-cf7-selector-step-form .wpcf7-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.areawise-cf7-selector-step-form .wpcf7-form input[type="text"],
.areawise-cf7-selector-step-form .wpcf7-form input[type="email"],
.areawise-cf7-selector-step-form .wpcf7-form input[type="tel"],
.areawise-cf7-selector-step-form .wpcf7-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.areawise-cf7-selector-step-form .wpcf7-form input[type="submit"] {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4caf50;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.areawise-cf7-selector-step-form .wpcf7-form input[type="submit"]:hover {
  background-color: #45a049;
}

/* Validation styles */
.areawise-cf7-selector-step-form .wpcf7-not-valid-tip {
  color: #dc3232;
  font-size: 1em;
  font-weight: normal;
  display: block;
  margin-top: 5px;
}

.areawise-cf7-selector-step-form .wpcf7-response-output {
  margin: 2em 0.5em 1em;
  padding: 0.6em 1em;
  border: 2px solid #00a0d2;
  border-radius: 4px;
}

.areawise-cf7-selector-step-form .wpcf7-validation-errors {
  border-color: #dc3232;
}

.areawise-cf7-selector-step-form .wpcf7-mail-sent-ok {
  border-color: #4caf50;
}

/* Animation */
.areawise-cf7-selector-step {
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(0);
}

.areawise-cf7-selector-step.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.areawise-cf7-selector-step.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Form styles */
.wpcf7-areawise-state,
.wpcf7-areawise-zone {
  width: 100%;
  max-width: 100%;
  margin-bottom: 15px;
}

.wpcf7-areawise-state select,
.wpcf7-areawise-zone select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.areawise-cf7-team-member-details {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.areawise-cf7-team-member-details:empty {
  display: none;
}

/* Team member card in form */
.areawise-cf7-form-team-member {
  display: flex;
  margin-bottom: 15px;
}

.areawise-cf7-form-team-member-image {
  flex: 0 0 200px;
  margin-right: 15px;
}

.areawise-cf7-form-team-member-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.areawise-cf7-form-team-member-details {
  flex: 1;
}

.areawise-cf7-form-team-member-name {
  font-size: 18px;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 5px;
}

.areawise-cf7-form-team-member-contact {
  margin-top: 10px;
}

.areawise-cf7-form-team-member-contact p {
  margin: 3px 0;
  font-size: 14px;
}

/* Responsive styles */
@media (max-width: 600px) {
  .areawise-cf7-form-team-member {
    flex-direction: column;
  }

  .areawise-cf7-form-team-member-image {
    margin-right: 0;
    margin-bottom: 15px;
  }
}

/* New popup styles matching the example */
.areawise-popup-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.areawise-popup-content {
  background-color: #fff;
  margin: 50px auto;
  max-width: 50%;
  width: 90%;
  position: relative;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.areawise-popup-close {
  color: #333;
  float: right;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  z-index: 100;
  background: #f2f2f2;
  width: 30px;
  height: 30px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
}

.areawise-popup-close:hover {
  background-color: #ddd;
}

.areawise-popup-body {
  padding: 0;
  position: relative;
}

/* Team member detail layout in popup */
.areawise-team-member-detail {
  display: flex;
  flex-direction: row;
}

.areawise-team-member-image {
  flex: 0 0 35%;
  padding: 15px;
}

.areawise-team-member-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.areawise-team-member-info {
  flex: 0 0 65%;
  padding: 30px;
  position: relative;
}

.areawise-team-member-name {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 5px 0;
  color: #333;
}

.areawise-team-member-designation {
  font-size: 16px;
  color: #666;
  margin: 0 0 20px 0;
}

.areawise-team-member-bio {
  margin-bottom: 25px;
  line-height: 1.6;
}

.areawise-team-member-contact-info {
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.areawise-team-member-contact-info p {
  margin: 8px 0;
  display: flex;
  align-items: center;
}

.areawise-team-member-contact-info strong {
  width: 60px;
  display: inline-block;
}

.areawise-team-member-contact-info a {
  color: #4caf50;
  text-decoration: none;
}

.areawise-team-member-contact-info a:hover {
  text-decoration: underline;
}

/* Responsive adjustments for popup */
@media (max-width: 768px) {
  .areawise-team-member-detail {
    flex-direction: column;
  }

  .areawise-team-member-image {
    flex: 0 0 auto;
    max-height: 300px;
  }

  .areawise-team-member-info {
    flex: 1 1 auto;
    padding: 20px;
  }
}

/* Hide popups when thank you page is set */
body.acf7p-has-thank-you-page .areawise-cf7-popup,
body.acf7p-has-thank-you-page .areawise-popup-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

/* Add extra specificity to ensure popups stay hidden */
html body.acf7p-has-thank-you-page .areawise-cf7-popup,
html body.acf7p-has-thank-you-page .areawise-popup-overlay,
html body.acf7p-has-thank-you-page .areawise-popup-content {
  display: none !important;
  visibility: hidden !important;
}

/* Highlight the form when direct access is used */
.areawise-cf7-highlighted-form {
  animation: acf7pFormHighlight 1.5s ease-in-out;
  background-color: rgba(74, 122, 170, 0.05);
  transition: background-color 1.5s ease;
  border: 2px solid rgba(74, 122, 170, 0.3);
}

@keyframes acf7pFormHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 122, 170, 0.5);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(74, 122, 170, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 122, 170, 0);
  }
}

/* Add new styles for zone selection */
#areawise-cf7-zone-select option[data-state-id] {
  display: none;
}

/* Highlight state when zones are being shown */
.areawise-cf7-selector-step-zone-active #areawise-cf7-state-select {
  border-color: #4caf50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Style for loading zones */
.areawise-cf7-loading {
  text-align: center;
  padding: 10px;
  color: #666;
  font-style: italic;
}

/* Error message styling */
.areawise-cf7-error {
  text-align: center;
  padding: 10px;
  color: #dc3232;
  font-style: italic;
}

/* Improve zone select usability */
#areawise-cf7-zone-select {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#areawise-cf7-zone-select:focus {
  border-color: #4caf50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
  outline: none;
}

/* Improve team member selection */
.areawise-cf7-team-member-select {
  cursor: pointer;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: background-color 0.3s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.areawise-cf7-team-member-select:hover {
  background-color: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.areawise-cf7-team-member-select.selected {
  background-color: #e8f5e9;
  border-color: #4caf50;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.areawise-cf7-select-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent transparent transparent transparent;
  transition: border-color 0.3s;
}

.areawise-cf7-team-member-select.selected .areawise-cf7-select-indicator {
  border-color: transparent #4caf50 transparent transparent;
}

.areawise-cf7-selection-instruction {
  text-align: center;
  margin-bottom: 15px;
  padding: 5px 10px;
  background-color: #f8f8f8;
  border-radius: 4px;
  font-size: 14px;
  color: #666;
}

/* Fade animation for team member selection */
.areawise-cf7-team-members {
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
