/* NextJS VAT Validator - Admin Styles */

/* Settings Page Layout */
.njvv-settings-page {
  max-width: 1200px;
  margin: 20px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.njvv-settings-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.njvv-settings-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 10px 0;
}

.njvv-settings-header .description {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* Settings Cards */
.njvv-settings-container {
  display: grid;
  gap: 24px;
}

.njvv-settings-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 24px; /* Keep original mb or use grid gap? Let's keep for now */
  min-height: 220px; /* Added minimum height */
}

.njvv-settings-section {
  margin-bottom: 32px;
}

.njvv-settings-section:last-child {
  margin-bottom: 0;
}

.njvv-settings-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px 0;

}
.njvv-settings-heading{
  font-size: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

/* Form Fields */
.njvv-field-row {
  display: flex;
  flex-direction: column;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: flex-start; /* Default alignment */
  /* margin-bottom: 24px;  <-- Removed, handled by wrapper gap */
}

.njvv-field-row.toggle-row {
    align-items: left; /* Vertically center label and input area for toggles */
}

.njvv-field-row:last-child {
}

.njvv-field-row label {
  font-weight: 500;
  color: #374151;
  /* padding-top: 8px; Align label better with input */
}

.njvv-field-input {
  max-width: 500px;
}

.njvv-field-input input[type="text"],
.njvv-field-input input[type="password"],
.njvv-field-input textarea,
.njvv-field-input select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; /* Added box-shadow transition */
}

.njvv-field-input input[type="text"]:focus,
.njvv-field-input input[type="password"]:focus,
.njvv-field-input textarea:focus,
.njvv-field-input select:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.njvv-field-input .description {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

/* Adjust input area for toggles */
.njvv-field-row.toggle-row .njvv-field-input {
    display: flex;
    flex-wrap: wrap; /* Allow description to wrap */
    align-items: center; /* Vertically align toggle and description */
    gap: 15px; /* Space between toggle and description */
}

/* Toggle Switch */
/* .njvv-toggle-container { Removed - using flex on .njvv-field-input instead
    display: flex;
    align-items: center;
    gap: 10px;
} */

.njvv-toggle {
  position: relative;
  display: inline-block;
  width: 50px; /* Increased width slightly */
  height: 26px; /* Increased height slightly */
  flex-shrink: 0; /* Prevent shrinking */
}

.njvv-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.njvv-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* Changed default color */
  transition: .4s;
  border-radius: 34px;
}

.njvv-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px; /* Adjusted size */
  width: 18px; /* Adjusted size */
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Added shadow */
}

.njvv-toggle input:checked + .njvv-toggle-slider {
  background-color: #6366f1;
}

.njvv-toggle input:focus + .njvv-toggle-slider {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); /* Focus ring */
}

.njvv-toggle input:checked + .njvv-toggle-slider:before {
  transform: translateX(24px); /* Adjusted transform */
}

/* Buttons */
.njvv-settings-page .button-primary, /* Target WP's primary button */
.njvv-submit-button { /* Keep custom class for potential specific use */
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: white !important;
  padding: 8px 20px !important; /* Adjusted padding */
  height: auto !important;
  border-radius: 6px !important;
  text-shadow: none !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease-in-out !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

.njvv-settings-page .button-primary:hover,
.njvv-submit-button:hover {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

.njvv-test-button {
  background: #fff !important;
  border: 1px solid #d1d5db !important;
  color: #374151 !important;
  padding: 8px 20px !important; /* Adjusted padding */
  height: auto !important;
  border-radius: 6px !important;
  text-shadow: none !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease-in-out !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  margin-left: 10px; /* Add some space if next to primary */
}

.njvv-test-button:hover {
  background: #f9fafb !important;
  border-color: #9ca3af !important;
  color: #1f2937 !important; /* Darken text on hover */
}

/* Responsive Design */
@media screen and (max-width: 782px) {
  .njvv-fields-wrapper {
      grid-template-columns: 1fr; /* Single column on smaller screens */
      gap: 16px; /* Adjust gap for mobile */
  }

  .njvv-field-row {
    grid-template-columns: 1fr; /* Stack label above input on mobile */
    gap: 10px; /* Reduced gap */
    margin-bottom: 16px; /* Add margin back for single column flow */
    align-items: flex-start; /* Revert to default alignment for stacked layout */
  }

  .njvv-field-row:last-child {
      margin-bottom: 0;
  }

  .njvv-field-row label {
    padding-top: 0; /* Remove padding on mobile */
  }

  .njvv-field-input {
    max-width: 100%;
  }

  .njvv-settings-card {
    padding: 16px; /* Reduce padding */
  }

  .njvv-settings-header h1 {
    font-size: 24px;
  }

  .njvv-settings-section h2 {
    font-size: 18px;
  }

  .njvv-field-row.toggle-row .njvv-field-input {
      gap: 8px; /* Adjust gap for mobile */
  }

  .njvv-field-row.toggle-row .njvv-field-input .description {
      flex-basis: 100%; /* Make description take full width below toggle */
      margin-top: 5px; /* Add a small top margin when wrapped */
  }
}

/* Notice Styling */
.njvv-settings-page .notice {
  margin: 20px 0 0 0; /* Adjust margin */
  border-radius: 6px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* Add shadow */
  padding: 12px 20px 12px 16px; /* Adjusted padding */
  border-left-width: 4px;
  border-left-style: solid;
  position: relative; /* Needed for absolute positioning of dismiss button */
}

.njvv-settings-page .notice p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

.njvv-settings-page .notice.notice-success {
    background-color: #f0fdf4; /* Lighter green background */
    border-left-color: #22c55e; /* Green border */
    color: #15803d; /* Darker green text */
}

.njvv-settings-page .notice.notice-error {
    background-color: #fef2f2; /* Lighter red background */
    border-left-color: #ef4444; /* Red border */
    color: #b91c1c; /* Darker red text */
}

.njvv-settings-page .notice .notice-dismiss {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    text-decoration: none;
    color: inherit; /* Inherit color from notice type */
    opacity: 0.7;
    padding: 5px;
}

.njvv-settings-page .notice .notice-dismiss:hover {
    opacity: 1;
}

.njvv-settings-page .notice .notice-dismiss .screen-reader-text {
    position: absolute;
    margin: -1px;
    padding: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    word-wrap: normal !important;
}

/* Test Connection Form */
.njvv-test-connection {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.njvv-test-connection-result {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
}
.njvv-test-connection-result.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #c3e6cb;
}
.njvv-test-connection-result.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Tutorial Button */
.njvv-tutorial-button {
    display: inline-flex;
    align-items: center;
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border: 1px solid #c7d2fe !important;
    padding: 5px 12px !important;
    height: auto !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    margin-top: -5px; /* Adjust alignment */
    margin-bottom: 15px; /* Add space below */
}

.njvv-tutorial-button .dashicons {
    margin-right: 5px;
    font-size: 18px;
    height: 18px;
    width: 18px;
}

.njvv-tutorial-button:hover {
    background: #e0e7ff !important;
    border-color: #a5b4fc !important;
    color: #4338ca !important;
}

/* Align description text with toggle - Updated */
.njvv-field-row.toggle-row label {
    /* padding-top: 4px; Removed - using align-items: center on row */
}
.njvv-field-row.toggle-row .njvv-field-input .description {
    margin: 0; /* Reset margin, rely on flex gap */
    flex-basis: calc(100% - 50px - 15px); /* Allow description to take remaining space, accounting for toggle width and gap */
    flex-grow: 1;
    font-size: 13px; /* Ensure consistency */
    color: #6b7280;
}

/* Wrapper for fields inside sections */
.njvv-fields-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 24px 20px; /* Row gap and Column gap */
    align-items: start; /* Align grid items to the top */
} 