/* TopVolley Student Profiles – My Account Students Page Styles */
/* Matches WooCommerce address styling */

/* Override Elementor styles for students tab */
/* Higher specificity without !important - using more specific class combinations */
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address
  .woocommerce-Address-title
  .edit,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Addresses
  .woocommerce-Address
  .woocommerce-Address-title
  .edit,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address-title
  .edit {
  color: #e91e63;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 600;
}

.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address
  .woocommerce-Address-title
  .edit:hover,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Addresses
  .woocommerce-Address
  .woocommerce-Address-title
  .edit:hover,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address-title
  .edit:hover {
  text-decoration: underline;
  color: #c2185b;
}

/* Disabled delete button override for Elementor */
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address
  .woocommerce-Address-title
  .tvsp-delete-disabled,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Addresses
  .woocommerce-Address
  .woocommerce-Address-title
  .tvsp-delete-disabled {
  color: #999;
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.6;
}

.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Address
  .woocommerce-Address-title
  .tvsp-delete-disabled:hover,
.elementor-widget-woocommerce-my-account
  .e-my-account-tab.e-my-account-tab__students
  .woocommerce-Addresses
  .woocommerce-Address
  .woocommerce-Address-title
  .tvsp-delete-disabled:hover {
  text-decoration: none;
  opacity: 0.6;
  color: #999;
}

/* Use WooCommerce address classes for consistency */
.woocommerce-Addresses {
  margin-top: -1rem;
}

.woocommerce-Address {
  margin-bottom: 2em;
}

.woocommerce-Address-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5em;
}

.woocommerce-Address-title::before,
.woocommerce-Address-title::after {
  content: none !important;
}

.woocommerce-Address-title .edit {
  color: #e91e63;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 600;
}

.woocommerce-Address-title .edit:hover {
  text-decoration: underline;
}

.woocommerce-Address address {
  font-style: normal;
  line-height: 1.8;
  margin: 0;
  padding: 0;
}

.woocommerce-Address address a {
  color: #e91e63;
  text-decoration: none;
}

.woocommerce-Address address a:hover {
  text-decoration: underline;
}

/* Add profile section */
.tvsp-add-profile-section {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid #e0e0e0;
}

.tvsp-add-profile-section h3 {
  margin: 0 0 1.5em 0;
  font-size: 1.25em;
  font-weight: 600;
}

/* Form styling to match WooCommerce */
.woocommerce-address-fields {
  margin: 0;
}

.woocommerce-address-fields__field-wrapper {
  margin-bottom: 1.5em;
}

.woocommerce-address-fields .form-row {
  margin-bottom: 1.5em;
}

.woocommerce-address-fields label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: 600;
}

.woocommerce-address-fields label .required {
  color: #e91e63;
}

.woocommerce-address-fields .input-text,
.woocommerce-address-fields .select,
.woocommerce-address-fields textarea {
  width: 100%;
  padding: 0.75em;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.95em;
  box-sizing: border-box;
  background-color: #fff;
}

.woocommerce-address-fields .input-text:focus,
.woocommerce-address-fields .select:focus,
.woocommerce-address-fields textarea:focus {
  outline: none;
  border-color: #e91e63;
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
  background-color: #fff;
}

.woocommerce-address-fields .form-row-first,
.woocommerce-address-fields .form-row-last {
  width: 48%;
  display: inline-block;
  vertical-align: top;
}

.woocommerce-address-fields .form-row-first {
  margin-right: 4%;
}

.woocommerce-address-fields .form-row-wide {
  width: 100%;
}

/* Radio buttons - matching checkout styles */
.woocommerce-address-fields input[type="radio"] {
  position: relative;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}

@media (max-width: 567px) {
  .woocommerce-address-fields input[type="radio"] {
    margin: 0 0.25rem 0 0;
    width: 20px;
    height: 20px;
  }
}

.woocommerce-address-fields input[type="radio"]:checked::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--google-grey, #f9db6f);
  border: 1px solid;
  border-radius: 50px;
  left: -1px;
  top: -1px;
  box-sizing: border-box;
}

@media (max-width: 567px) {
  .woocommerce-address-fields input[type="radio"]:checked::before {
    width: 20px;
    height: 20px;
    left: -1px;
    top: -1px;
  }
}

.woocommerce-address-fields input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: black;
  box-sizing: border-box;
}

@media (max-width: 567px) {
  .woocommerce-address-fields input[type="radio"]:checked::after {
    width: 8px;
    height: 8px;
  }
}

/* Make ALL radio buttons horizontal - WooCommerce structure */
.woocommerce-address-fields .form-row .woocommerce-input-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Radio button input styling within wrapper */
.woocommerce-address-fields .woocommerce-input-wrapper input[type="radio"] {
  margin-right: 8px;
  flex-shrink: 0;
}

/* Radio button labels (WooCommerce uses label.radio) */
.woocommerce-address-fields .woocommerce-input-wrapper label.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 0.5rem;
  padding: 0;
  font-weight: normal;
  cursor: pointer;
  white-space: nowrap;
}

/* Ensure specific radio field groups are horizontal */
.woocommerce-address-fields
  .form-row:has(input[name="student_medical_condition"])
  .woocommerce-input-wrapper,
.woocommerce-address-fields
  .form-row:has(input[name="student_injury_recent"])
  .woocommerce-input-wrapper,
.woocommerce-address-fields
  .form-row:has(input[name="student_gender"])
  .woocommerce-input-wrapper {
  display: flex;
  flex-direction: row;
  margin-top: 8px;
}

/* Conditional fields - matching checkout styles */
.woocommerce-address-fields .tvsp-medical-details,
.woocommerce-address-fields .tvsp-injury-details {
  display: none;
  margin-top: 1em;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  overflow: hidden;
}

.woocommerce-address-fields .tvsp-medical-details.show,
.woocommerce-address-fields .tvsp-injury-details.show {
  display: block;
  opacity: 1;
}

/* Textarea base styles */
.woocommerce-address-fields textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}

/* Make conditional textareas nicer - matching checkout styles */
.woocommerce-address-fields .tvsp-medical-details textarea,
.woocommerce-address-fields .tvsp-injury-details textarea {
  border-left: 3px solid #4a90e2;
  transition: border-color 0.3s ease;
}

.woocommerce-address-fields .tvsp-medical-details textarea:focus,
.woocommerce-address-fields .tvsp-injury-details textarea:focus {
  border-left-color: #2c6aa0;
  outline: none;
}

/* Buttons */
.woocommerce-address-fields .button {
  background-color: #e91e63;
  color: #ffffff;
  border: 1px solid #e91e63;
  border-radius: 3px;
  padding: 0.75em 1.5em;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.woocommerce-address-fields .button:hover {
  background-color: #c2185b;
  border-color: #c2185b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(233, 30, 99, 0.3);
}

.woocommerce-address-fields .button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(233, 30, 99, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .woocommerce-Address-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .woocommerce-Address-title .edit {
    margin-top: 0.5em;
  }

  .woocommerce-address-fields .form-row-first,
  .woocommerce-address-fields .form-row-last {
    width: 100%;
    margin-right: 0;
  }
}

/* Locked profiles (linked to orders) */
.woocommerce-Address.tvsp-profile-locked {
  opacity: 1;
}

.woocommerce-Address-title .tvsp-delete-disabled {
  color: #999;
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.6;
  position: relative !important
  ;
}

.woocommerce-Address-title .tvsp-delete-disabled:hover {
  text-decoration: none;
  opacity: 0.6;
}

.tvsp-order-notice {
  display: block;
  margin-top: 1em;
  padding: 0.75em;
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
  color: #856404;
  font-size: 0.9em;
  line-height: 1.5;
}

.tvsp-order-notice strong {
  color: #856404;
}

/* Success/Error messages */
.tvsp-message {
  padding: 1em;
  margin: 0 0 1.5em 0;
  border-radius: 3px;
  border-left: 4px solid;
}

.tvsp-message.success {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.tvsp-message.error {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

a.edit.tvsp-delete-profile {
  position: relative !important;
}
