/* --- Global Styles --- */

html {
  font-family: "Salesforce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 20px;
  /* Light gray background, as per guidelines and main app */
  background-color: #f3f4f6; 
  color: #1a202c;
  line-height: 1.5;
}

/* --- Main App Container & Card --- */
.container {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
}

/* This is the new card style for all content boxes */
.card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 2rem;
}

/* Report page card can be wider */
.report .card,
/* Specific override for report.html (applies to body > .card) */
body > .card {
  max-width: 900px;
  margin: 2rem auto;
}

.logo {
  max-width: 250px; /* MODIFIED: Was 150px */
  height: auto;
  margin-bottom: 1.5rem;
}

h1, h2, h3, h4 {
  margin-top: 0;
  font-weight: 700; /* MODIFIED: Was 600 */
  color: #111827;
}

h2 { 
  font-size: 1.875rem; /* MODIFIED: Was 1.5rem */ 
  margin-bottom: 1.5rem; 
  text-align: left; /* ADDED: Override legacy center-align */
}
h3 { font-size: 1.25rem; margin-bottom: 1rem; }
h4 { font-size: 1.1rem; margin-bottom: 1rem; color: #374151; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.5rem;}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: #0b5cac;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.back-link {
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* --- Form & Button Styles --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
}

.form-control,
.form-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Primary Button (matches main app gradient) */
.btn {
  display: inline-block;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  color: #ffffff;
  /* Gradient from main app screenshot */
  background-image: linear-gradient(to right, #4f46e5, #7c3aed); 
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.2);
}

/* Success state for Copy button */
.btn-success {
  background-image: none;
  background-color: #16a34a;
}

/* --- Report-Specific Styles --- */
.report-section {
  margin-top: 2rem;
}

/* New Summary Box Styles */
.summary-box {
  padding: 1rem 1.5rem;
  border-radius: 6px;
  border-left-width: 4px;
  border-left-style: solid;
  margin: 1.5rem 0;
}

.summary-box h3 {
  margin-bottom: 0.5rem;
}

.summary-box p {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.summary-success {
  background-color: #f0fdf4; 
  border-color: #16a34a; 
  color: #15803d;
}

.summary-success h3 { color: #166534; }

.summary-error {
  background-color: #fef2f2; 
  border-color: #dc2626; 
  color: #b91c1c;
}

.summary-error h3 { color: #991b1b; }

/* New Report Table Styles */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.report-table th,
.report-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.report-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.report-table tr:last-child td {
  border-bottom: none;
}

.report-table tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Code & ID styles */
.id-code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  background-color: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: #4b5563;
}

/* Error cell style (using Guideline Red) */
.error-cell {
  color: #dc2626; 
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: pre-wrap;
}

/* Main Task Error Block */
.error-section {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid #dc2626;
}

.error-section h4 {
  color: #991b1b;
  margin-top: 0;
}

.error-section .error-cell {
  display: block;
  background-color: #fee2e2;
  padding: 0.5rem;
  border-radius: 4px;
  color: #991b1b;
}

/* Share Link Styles */
.share-link-container {
  margin-bottom: 1.5rem;
}

.share-link-container label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
}

.share-link-input-group {
  display: flex;
}

.share-link-input-group input[type="text"] {
  flex-grow: 1;
  border: 1px solid #d1d5db;
  padding: 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px 0 0 6px;
  background-color: #f9fafb;
  color: #4b5563;
  border-right: none;
}

.share-link-input-group button {
  border-radius: 0 6px 6px 0;
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: 0.9rem;
}

/* --- Footer --- */
footer {
  max-width: 900px;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #EFF4FA;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  text-align: left;
}

/* Report footer should match report card width */
body > .card + footer {
  max-width: 900px;
}

.feedback-footer {
  display: flex;
  align-items: center;
  width: 100%;
}

.feedback-footer img {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.feedback-footer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.feedback-footer a {
  color: #0b5cac;
  text-decoration: none;
}

.feedback-footer a:hover {
  text-decoration: underline;
}

/* --- Legacy/Compatibility Styles --- */

/* Collapsible Intro Section */
.intro-section {
  margin-bottom: 1.5rem;
}

.intro-toggle-link {
  display: inline-block;
  color: #0b5cac;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.intro-toggle-link:hover {
  text-decoration: underline;
}

.intro-toggle-link::before {
  content: "▼ ";
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 0.25rem;
}

.intro-toggle-link.collapsed::before {
  transform: rotate(-90deg);
}

#introContent {
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

.help-link {
  color: #0b5cac;
  text-decoration: underline;
  cursor: pointer;
}
.faq-section {
  position: fixed;
  right: 20px;
  top: 50px;
  background-color: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px; /* Adjusted for more internal space */
  max-width: 600px;
  z-index: 99;
  font-size: 14px; /* Adjust as needed */
}

.faq-question {
  font-weight: bold;
  margin-top: 20px; /* Adjust as needed */
}

.faq-answer {
  margin-bottom: 20px; /* Adjust as needed */
  text-align: justify;
}

.container {
  max-width: 600px;
  margin: auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h2 {
  text-align: center; /* Centers the text of the h2 element */
  margin-top: 0;
}

h4 {
  text-align: center; /* Centers the text of the h4 element */
  margin-top: 0;
}

h2,
p,
label {
  font-family: inherit;
  margin-top: 0;
  width: 100%; /* Ensures full width */
  padding: 8px;
  margin-bottom: 20px;
  box-sizing: border-box; /* Includes padding and border in the element's total width and height */
}
select,
textarea,
input[type="submit"],
input[type="email"],
input[type="text"],
#demoScenario {
  font-family: inherit;
  margin-top: 0;
  width: 100%; /* Ensures full width */
  padding: 8px;
  margin-bottom: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  box-sizing: border-box; /* Includes padding and border in the element's total width and height */
}
select,
textarea,
input[type="submit"],
input[type="password"],
#demoScenario {
  font-family: inherit;
  margin-top: 0;
  width: 100%; /* Ensures full width */
  padding: 8px;
  margin-bottom: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  box-sizing: border-box; /* Includes padding and border in the element's total width and height */
}
#demoScenario {
  height: 160px;
  overflow-y: auto;
  background-color: #EFF4FA;
  color: #333;
  display: block; /* Ensures the div behaves like a block-level element */
}
.g-recaptcha-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px; /* Optional: Add margin bottom for spacing */
}
input[type="submit"] {
  background-color: #0056D0;
  color: white;
  cursor: pointer;
  font-size: 16px;
}
.form-section {
  display: none;
}
.form-section.active {
  display: block;
}
.justified {
  text-align: justify;
}
.button-style {
  background-color: #0056D0; /* Background color */
  color: white; /* Text color */
  padding: 8px; /* Padding - adjust as needed to match the height */
  text-decoration: none; /* Removes underline from links */
  border-radius: 8px; /* Border radius for rounded corners */
  font-size: 16px; /* Font size */
  display: inline-block; /* Allows applying padding and margins */
  width: 100%; /* Full width */
  box-sizing: border-box; /* Border and padding are included in the width */
  text-align: center; /* Centers text */
  margin: 0; /* Removes default margin */
  border: none; /* Removes border */
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap onto multiple lines */
  justify-content: center;
  margin: 10px 0;
}

.checkbox-option {
  margin: 10px 10px; /* Adjust spacing between checkboxes */
}

.checkbox-option input[type="checkbox"] {
  display: none; /* Hide the default checkbox */
}

.checkbox-option label {
  cursor: pointer;
  padding: 5px 10px;
  background-color: #f0f0f0; /* Default background color */
  color: #555;
  border-radius: 20px;
  border: 1px solid #ccc; /* Add border style */
  transition: background-color 0.3s ease, color 0.3s ease; /* Add transition for smoother color change */
}

.checkbox-option label:hover {
  background-color: #e0e0e0; /* Change background color on hover */
}

.checkbox-option input[type="checkbox"]:checked + label {
  background-color: #FFFFFF; /* Change background color when checked */
  color: #1E1F27; /* Change text color when checked */
}


.g-recaptcha {
  display: inline-block;
}

.info-icon {
  display: inline-block;
  margin-left: 5px;
  margin-bottom: 5px;
  color: #007bff;
  cursor: pointer;
  border: 1px solid #007bff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.info-icon:hover {
  background-color: #007bff;
  color: white;
}

.tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  max-width: 250px; 
  word-wrap: break-word; 
  white-space: normal; 
}
p {
  margin-bottom: 5px; 
}

ul {
  margin-top: 5px; 
  margin-bottom: 10px; 
}

ul li {
  margin-bottom: 5px;
}

/* Test Connection Button */
.test-connection-btn {
  font-family: inherit;
  background-color: #0176d3;
  color: white;
  border: none;
  padding: 10px 20px;
  margin-bottom: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.test-connection-btn:hover {
  background-color: #014486;
}

.test-connection-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Connection Test Result */
.connection-test-result {
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 4px;
  font-size: 14px;
  display: none;
  border-left: 4px solid transparent;
}

.connection-test-result:not(:empty) {
  display: block;
}

.connection-test-result.success {
  background-color: #f0fdf4;
  color: #166534;
  border-left-color: #16a34a;
}

.connection-test-result.error {
  background-color: #fef2f2;
  color: #991b1b;
  border-left-color: #dc2626;
}

/* Config Import/Export Buttons */
.config-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  margin-top: 10px;
}

.config-btn {
  font-family: inherit;
  background-color: white;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  flex: 1;
  transition: all 0.3s ease;
}

.config-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #475569;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 30px;
  border: 1px solid #888;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.modal-content h3 {
  color: #856404;
  margin-top: 0;
}

.modal-content p {
  margin: 10px 0;
  text-align: left;
}

.modal-btn {
  font-family: inherit;
  background-color: #0056D0;
  color: white;
  border: none;
  padding: 10px 30px;
  margin-top: 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.modal-btn:hover {
  background-color: #004299;
}

/* Migration Progress Styles */
.migration-progress {
  margin: 20px 0;
}

.migration-log {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.log-entry {
  padding: 4px 0;
  border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-info {
  color: #475569;
}

.log-success {
  color: #166534;
  font-weight: 500;
}

.log-error {
  color: #991b1b;
  font-weight: 500;
}

.log-warning {
  color: #b45309;
}

.migration-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  background-color: #e7f3ff;
  text-align: center;
}

.status-success {
  color: #155724;
}

.status-error {
  color: #721c24;
}

.report-section {
  margin: 20px 0;
  text-align: center;
}

/* Report Page Styles */
.report-summary {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #6c757d;
}

.summary-success {
  border-left-color: #16a34a;
  background-color: #f0fdf4;
}

.summary-error {
  border-left-color: #dc2626;
  background-color: #fef2f2;
}

.summary-details p {
  margin: 8px 0;
  text-align: left;
}

.metrics-summary {
  display: flex;
  gap: 20px;
  margin: 30px 0;
  justify-content: center;
}

.metric-box {
  flex: 1;
  max-width: 200px;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-success {
  background-color: #f0fdf4;
  border: 2px solid #16a34a;
}

.metric-failed {
  background-color: #fef2f2;
  border: 2px solid #dc2626;
}

.metric-number {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 10px;
}

.metric-success .metric-number {
  color: #166534;
}

.metric-failed .metric-number {
  color: #991b1b;
}

.metric-label {
  font-size: 16px;
  font-weight: 500;
}

.report-section {
  margin: 30px 0;
}

.report-section h3 {
  text-align: left;
  margin-bottom: 15px;
  color: #333;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-table thead {
  background-color: #f8f9fa;
}

.report-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
}

.report-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}

.row-success {
  background-color: #f0fdf4;
}

.row-error {
  background-color: #fef2f2;
}

.error-cell {
  color: #991b1b;
  font-size: 13px;
}

.error-details-row td {
  padding: 8px 12px;
  background-color: #fff8e1;
}

.error-details {
  font-size: 13px;
  color: #856404;
}

.id-code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background-color: #f8f9fa;
  padding: 2px 6px;
  border-radius: 3px;
  color: #495057;
}

.error-section {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 15px;
  margin: 20px 0;
  border-left: 4px solid #dc2626;
}

.error-section h3 {
  color: #991b1b;
  margin-top: 0;
}

.error-message {
  color: #991b1b;
  font-weight: 500;
}

.share-section {
  margin: 30px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.share-link-container {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.share-link-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.copy-btn {
  padding: 10px 20px;
  background-color: #0176d3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background-color: #014486;
}
