/* ========================================
   FORMS & INPUTS STYLES
   ======================================== */

/* Form Containers */
.form-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.form-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
}

.tab {
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-600);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--bg-primary);
  transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  font-weight: 400;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

/* Dynamic Fields */
.dynamic-fields {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--gray-50);
}

.dynamic-fields h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--gray-800);
}

.dynamic-item {
  background: var(--bg-primary);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.dynamic-item:last-child {
  margin-bottom: 0;
}

.remove-item {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--error);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.remove-item:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.add-item-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--gray-100);
  border: 2px dashed var(--gray-400);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.add-item-btn:hover {
  background: var(--primary-lighter);
  border-color: var(--primary);
  color: var(--primary);
}

/* Submit Buttons */
.btn-generate {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-top: 2rem;
}

.btn-generate:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-generate:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
  transform: none;
}

/* Results Section */
#results {
  margin-top: 3rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-title {
  font-size: 1.5rem;
  color: var(--gray-900);
}

.results-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-card {
  background: var(--bg-primary);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.result-section {
  margin-bottom: 2rem;
}

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

.result-section h3 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-content {
  color: var(--gray-700);
  line-height: 1.8;
  white-space: pre-wrap;
  background: var(--gray-50);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

/* Hook Variations */
.hooks-container {
  display: grid;
  gap: 1rem;
}

.hook-item {
  background: var(--bg-primary);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.hook-label {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.hook-text {
  color: var(--gray-700);
  line-height: 1.6;
}

/* Copy Button */
.copy-btn {
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 0.875rem;
}

.copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.copy-btn.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Help Text */
.help-text {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Field Counter */
.field-counter {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-align: right;
  margin-top: 0.25rem;
}

/* Form Validation */
input:invalid,
textarea:invalid {
  border-color: var(--error);
}

input:valid,
textarea:valid {
  border-color: var(--success);
}

.error-message {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 640px) {
  .form-card {
    padding: 1.5rem;
  }

  .tabs {
    gap: 0.25rem;
  }

  .tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-actions {
    width: 100%;
  }

  .results-actions button {
    flex: 1;
  }
}

@media (min-width: 768px) {
  .hooks-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   PDF UPLOADER COMPONENT
   ======================================== */

.pdf-uploader-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.pdf-uploader-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pdf-uploader-header h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.pdf-uploader-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
}

.pdf-upload-area {
  background: white;
  border: 3px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.pdf-upload-area:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.pdf-upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.02);
}

.pdf-upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.pdf-upload-text {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.pdf-upload-text strong {
  color: var(--primary);
}

.pdf-upload-hint {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Processing State */
.pdf-processing {
  background: white;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
}

.processing-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.processing-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.processing-subtext {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Success State */
.pdf-result {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.pdf-result-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pdf-result-icon {
  font-size: 2rem;
}

.pdf-result-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--success);
}

/* Error State */
.pdf-error {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.pdf-error .alert {
  margin-bottom: 1rem;
}

#retry-pdf {
  width: 100%;
}
