/**
 * F2F Store Tools - Water Testing Station Styles
 */

/* Variables */
:root {
  --primary-color: #F38221;
  --primary-hover: #e67012;
  --text-dark: #333;
  --text-medium: #555;
  --text-light: #666;
  --error-color: #ff5252;
  --success-color: #4CAF50;
  --border-light: #ddd;
  --bg-light: #f9f9f9;
  --bg-white: #fff;
  --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 3px 10px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 5px 15px rgba(0, 0, 0, 0.3);
  --border-radius: 8px;
  --border-radius-pill: 20px;
}

/* Main Container */
.f2f-testing-station {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header Styles */
.f2f-testing-header {
  margin-bottom: 30px;
  text-align: center;
}

.f2f-testing-header h2 {
  color: var(--primary-color);
  font-size: 32px;
  margin-bottom: 10px;
}

.f2f-testing-intro {
  font-size: 18px;
  color: var(--text-medium);
}

/* Instructions */
.f2f-testing-instructions {
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 30px;
  border-left: 4px solid var(--primary-color);
}

.f2f-testing-instructions h3 {
  color: var(--text-dark);
  margin-top: 0;
  margin-bottom: 15px;
}

.f2f-testing-instructions ol {
  margin-left: 20px;
  padding-left: 0;
}

.f2f-testing-instructions li {
  margin-bottom: 10px;
}

.f2f-note {
  font-style: italic;
  color: var(--text-light);
  margin-top: 15px;
  font-size: 14px;
}

/* Cycle Selector */
.f2f-cycle-selector {
  margin-bottom: 30px;
}

.f2f-cycle-selector h3 {
  color: var(--text-dark);
  margin-bottom: 15px;
}

.f2f-cycle-selector select {
  width: 100%;
  max-width: 400px;
  padding: 5px 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 16px;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-light);
}

/* Aquarium Cards */
.f2f-aquariums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.f2f-aquarium-card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.f2f-aquarium-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-heavy);
}

.f2f-aquarium-header {
  padding: 15px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.f2f-aquarium-header h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text-dark);
}

.f2f-type-badge {
  padding: 5px 10px;
  border-radius: var(--border-radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.f2f-type-badge.saltwater {
  background-color: #e6f7ff;
  color: #0066cc;
}

.f2f-type-badge.freshwater {
  background-color: #e6ffe6;
  color: #008800;
}

.f2f-aquarium-body {
  padding: 15px;
}

.f2f-aquarium-info {
  margin-bottom: 15px;
}

.f2f-aquarium-info p {
  margin: 5px 0;
  color: var(--text-medium);
}

/* Test History Items */
.f2f-test-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 5px 0;
}

.f2f-date-info {
  display: flex;
  align-items: center;
}

.f2f-status-complete {
  margin-right: 8px;
}

.f2f-view-results-btn {
  background-color: var(--primary-color);
  color: white !important;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  text-decoration: none;
  transition: background-color 0.2s;
  font-weight: 500;
  display: inline-block;
  margin-left: auto;
}

.f2f-view-results-btn:hover {
  background-color: var(--primary-hover);
  text-decoration: none !important;
  color: white !important;
}

/* Buttons */
.f2f-test-button, 
.f2f-button, 
.f2f-submit-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.f2f-test-button:hover,
.f2f-button:hover,
.f2f-submit-button:hover {
  background-color: var(--primary-hover);
}

.f2f-test-button {
  padding: 10px 15px;
  width: 100%;
}

.f2f-button, 
.f2f-submit-button {
  padding: 12px 25px;
  font-size: 16px;
}

.f2f-cancel-button {
  background-color: #f5f5f5;
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  padding: 12px 25px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 0.2s;
}

.f2f-cancel-button:hover {
  background-color: #e9e9e9;
}

/* Form Styles */
.f2f-test-form {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-heavy);
  padding: 25px;
  margin-bottom: 30px;
}

.f2f-test-form h3 {
  color: var(--text-dark);
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.f2f-form-field {
  margin-bottom: 20px;
}

.f2f-form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-medium);
  font-weight: 500;
}

.f2f-form-field input[type="number"],
.f2f-form-field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 16px;
}

.f2f-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.f2f-form-field input.out-of-range {
  border-color: var(--error-color);
  background-color: #fff8f8;
}

.f2f-form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

/* Add required field indicator */
.test-parameter-input[required] + label:after,
.f2f-form-field label:has(+ input[required]):after {
  content: " *";
  color: var(--error-color);
}

/* Conversion Groups */
.f2f-conversion-group {
  background-color: var(--bg-light);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 25px;
}

.f2f-conversion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.f2f-conversion-header h4 {
  margin: 0;
  color: var(--text-dark);
}

.f2f-range-info {
  font-size: 14px;
  color: var(--text-light);
}

.f2f-range-info.small {
  font-size: 12px;
  font-style: italic;
  display: block;
  margin-top: 3px;
}

.f2f-conversion-inputs {
  display: flex;
  gap: 15px;
}

.f2f-input-group {
  flex: 1;
}

/* Modal Styles */
.f2f-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.f2f-modal-content {
  background-color: var(--bg-white);
  margin: 10% auto;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-heavy);
  width: 80%;
  max-width: 800px;
  position: relative;
}

.f2f-modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.f2f-modal-close:hover,
.f2f-modal-close:focus {
  color: black;
  text-decoration: none;
}

/* Test Results Table */
.f2f-test-results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  table-layout: fixed;
}

.f2f-test-results-table th,
.f2f-test-results-table td {
  padding: 10px;
  border: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}

.f2f-test-results-table th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.f2f-test-results-table th:first-child {
  width: 40%;
}

.f2f-test-results-table th:nth-child(2),
.f2f-test-results-table td:nth-child(2) {
  width: 30%;
  text-align: center;
}

.f2f-test-results-table th:last-child,
.f2f-test-results-table td:last-child {
  width: 30%;
  text-align: center;
}

.f2f-test-results-table tr.out-of-range td {
  background-color: #fff8f8;
}

/* Status Indicators */
.f2f-warning {
  background-color: transparent !important;
  color: var(--error-color);
  font-weight: 600;
  padding: 4px 8px;
}

.f2f-normal {
  color: var(--success-color);
}

/* Success Message */
.f2f-test-result-message {
  text-align: center;
  padding: 50px 0;
}

.f2f-result-content {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-heavy);
  padding: 30px;
  max-width: 500px;
  margin: 0 auto;
}

.f2f-result-icon {
  display: block; /* Keeps the icon on its own line */
  margin-bottom: 20px; /* Keeps the space below the icon */
  /* font-size and color removed from here */
}

/* Add the actual icon character and its specific styling */
.f2f-result-icon::before {
  content: "\2713";        /* Add the checkmark character */
  font-size: 48px;         /* Apply original font-size to the icon */
  color: var(--success-color); /* Apply original color to the icon */
  line-height: 1;          /* Optional: Ensure consistent vertical alignment */
}

.f2f-result-content h3 {
  color: var(--text-dark);
  margin-top: 0;
}

.f2f-result-content p {
  color: var(--text-medium);
  margin-bottom: 25px;
}

.f2f-out-of-range-message { /* Changed from # to . */
 background-color: #ffebee;
 padding: 10px;
 border-radius: 4px;
 margin-bottom: 20px;
  /* Ensure it's hidden by default if needed, JS handles showing */
  /* display: none;  <-- Already handled inline in PHP and by JS */
}

/* Loading and Error States */
.f2f-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
}

.f2f-error {
  text-align: center;
  padding: 20px;
  color: var(--error-color);
  background-color: #ffebee;
  border-radius: 4px;
}

.f2f-message {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
  font-style: italic;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .f2f-aquariums-grid {
    grid-template-columns: 1fr;
  }
  
  .f2f-conversion-inputs {
    flex-direction: column;
    gap: 10px;
  }
  
  .f2f-form-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .f2f-submit-button, 
  .f2f-cancel-button {
    width: 100%;
  }
}

/* Create a card footer section for buttons */
.f2f-aquarium-body {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Creates consistent spacing between elements */
}

/* Style consistency between buttons */
.f2f-toggle-button-parameters,
.f2f-test-button {
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

/* Give the test button a distinct style */
.f2f-test-button {
    background-color: #F38221;
    color: white;
    border: none;
}

.f2f-test-button:hover {
    background-color: #D66E10;
}