/**
 * Legal Validator Custom Styling
 * Modern Material Design-inspired styling for the Legal Validator form
 * Following Windsurf Rules for Material Design and Mobile-First
 */

/* Main Container */
.legal-validator-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
}

/* Header Section */
.legal-validator-header {
  background: linear-gradient(135deg, #2c3e50, #3498db);
  color: #fff;
  padding: 2rem;
  position: relative;
}

.legal-validator-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  font-weight: 500;
  color: #fff;
}

.legal-validator-description {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

/* Form Container */
.legal-validator-form {
  padding: 2rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Input Method Tabs */
.input-method-tabs {
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

/* Tab Buttons */
.tab-buttons {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f5f7fa;
}

.tab-button {
  flex: 1;
  padding: 1rem 0.5rem;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
}

.tab-button:hover {
  color: #3498db;
  background-color: rgba(52, 152, 219, 0.05);
}

.tab-button.active {
  color: #3498db;
  background-color: #fff;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #3498db;
  border-radius: 3px 3px 0 0;
}

/* Tab Icons */
.tab-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.url-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='2' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3E%3C/path%3E%3C/svg%3E");
}

.upload-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='17 8 12 3 7 8'%3E%3C/polyline%3E%3Cline x1='12' y1='3' x2='12' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

.paste-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'%3E%3C/path%3E%3Crect x='8' y='2' width='8' height='4' rx='1' ry='1'%3E%3C/rect%3E%3Cpath d='M9 12h6'%3E%3C/path%3E%3Cpath d='M9 16h6'%3E%3C/path%3E%3C/svg%3E");
}

/* Tab Content */
.tab-content-wrapper {
  padding: 1.5rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

.input-field {
  margin-bottom: 0;
}

/* File Upload Styling */
.file-upload-field {
  position: relative;
}

.file-upload-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border: 2px dashed #e0e0e0;
  border-radius: 6px;
  padding: 1.5rem;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.file-upload-wrapper:hover,
.file-upload-wrapper:focus-within {
  border-color: #3498db;
  background-color: rgba(52, 152, 219, 0.05);
}

.file-upload-wrapper.has-file {
  border-style: solid;
  border-color: #3498db;
  background-color: #e8f4fc;
}

.file-upload-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-upload-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.file-name {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: #2c3e50;
  font-weight: 500;
}

.file-upload-wrapper.has-file .file-name {
  color: #3498db;
}

.file-select-button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.file-select-button:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.file-upload-wrapper.has-file .file-select-button {
  background-color: #2ecc71;
}

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

/* Form Controls */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
  background-color: #fff;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select Styling */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Description Text */
.description {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  font-weight: normal;
  background-color: #f1f5f9;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.checkbox-group label:hover {
  background-color: #e8f0fe;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 0.5rem;
  position: relative;
  width: 18px;
  height: 18px;
}

.checkbox-group input[type="checkbox"]:checked + span {
  font-weight: 500;
}

/* Button Styling */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.button-primary {
  background-color: #3498db;
  color: white;
}

.button-primary:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.button-primary:active {
  transform: translateY(0);
}

.switch-input-method {
  background: transparent;
  color: #3498db;
  border: 1px solid #3498db;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.switch-input-method:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

/* Form Actions */
.form-actions {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Loading State */
.validation-loading {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  color: #666;
  width: 100%;
}

.loading-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.loading-indicator .spinner {
  margin-right: 0.75rem;
}

.loading-text {
  font-size: 0.9rem;
  color: #555;
}

/* Progress Bar */
.progress-bar {
  height: 6px;
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  border-radius: 3px;
  transition: width 0.3s ease;
  animation: progress-animation 2s infinite ease-in-out;
}

@keyframes progress-animation {
  0% { width: 10%; }
  50% { width: 70%; }
  70% { width: 80%; }
  90% { width: 90%; }
  100% { width: 10%; }
}

/* Error Messages */
.validation-error {
  background-color: #fff;
  border-left: 4px solid #dc3545;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 20px 25px;
  margin: 20px 0;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.validation-error h3 {
  color: #dc3545;
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 500;
}

.api-key-error {
  border-left-color: #ff9800;
}

.api-key-error h3 {
  color: #ff9800;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results Container */
#validation-results-container {
  padding: 1.5rem 2rem;
  background-color: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

/* Validation Notices */
.legal-validator-notice {
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.legal-validator-notice.valid {
  background-color: #e3f8e5;
  color: #1e7e34;
}

.legal-validator-notice.warning {
  background-color: #fff8e6;
  color: #856404;
}

.legal-validator-notice.invalid {
  background-color: #fdeeee;
  color: #721c24;
}

.legal-validator-notice::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
}

.legal-validator-notice.valid::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231e7e34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.legal-validator-notice.warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23856404' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
}

.legal-validator-notice.invalid::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23721c24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

/* Badge Styling */
.legal-validator-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legal-validator-badge.valid {
  background-color: #1e7e34;
  color: white;
}

.legal-validator-badge.warning {
  background-color: #ffc107;
  color: #212529;
}

.legal-validator-badge.invalid {
  background-color: #dc3545;
  color: white;
}

/* Summary Section */
.legal-validator-summary {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.legal-validator-summary h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 500;
  color: #2c3e50;
}

.legal-validator-summary ul {
  margin-left: 1.25rem;
  padding-left: 0;
}

.legal-validator-summary li {
  margin-bottom: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .legal-validator-header {
    padding: 1.5rem;
  }
  
  .legal-validator-form {
    padding: 1.5rem;
  }
  
  .checkbox-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .checkbox-group label {
    width: 100%;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .button {
    width: 100%;
  }
}

/* Elevation and Depth Effects */
.legal-validator-container {
  transition: box-shadow 0.3s ease;
}

.legal-validator-container:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Apply animations */
.tab-content.active {
  animation: slideUp 0.3s ease-out;
}

.file-upload-wrapper.has-file {
  animation: pulse 0.5s ease-out;
}

/* Responsive styles for tabs */
@media (max-width: 768px) {
  .tab-buttons {
    flex-direction: column;
    border-bottom: none;
  }
  
  .tab-button {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .tab-button:last-child {
    border-bottom: none;
  }
  
  .tab-button.active::after {
    height: 100%;
    width: 3px;
    top: 0;
    left: 0;
    border-radius: 0 3px 3px 0;
  }
  
  .tab-icon {
    margin-right: 0.75rem;
  }
  
  /* Improve mobile form experience */
  .legal-validator-form .form-control,
  .legal-validator-form select,
  .legal-validator-form textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  .file-upload-wrapper {
    padding: 1rem;
  }
  
  .tab-content-wrapper {
    padding: 1rem;
  }
}

#validation-results-container {
  animation: fadeIn 0.4s ease-out;
}

/* Focus States for Accessibility */
.form-control:focus,
.button:focus,
input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.4);
}

/* Divi-specific overrides */
.et_pb_module .legal-validator-container {
  margin: 0;
  width: 100%;
}
