/* Task Templates - WhisperPlan SEO Tools
   Modular CSS for task template forms and quick capture
   ===================================================== */

/* Template Container */
.template-container {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.template-header {
  margin-bottom: 1.5rem;
}

.template-header h2 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.template-header .template-type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

/* Voice Example Banner */
.voice-example-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
  border: 1px solid rgba(52, 199, 89, 0.4);
  border-radius: 0 10px 10px 0;
  margin-bottom: 1.5rem;
}

.voice-example-banner .voice-icon {
  font-size: 2rem;
  line-height: 1;
}

.voice-example-banner .voice-content h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: #34c759;
}

.voice-example-banner .voice-content p {
  margin: 0;
  font-style: italic;
  color: var(--color-text);
  font-size: 0.95rem;
}

/* Template Form */
.template-form {
  display: grid;
  gap: 1.25rem;
}

.template-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-field label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.template-field label .required-star {
  color: #ff3b30;
  font-weight: 400;
}

.template-field label .optional-tag {
  font-size: 0.7rem;
  font-weight: 400;
  color: #888;
  background: rgba(128, 128, 128, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.template-field input,
.template-field textarea,
.template-field select {
  padding: 0.875rem 1rem;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

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

.template-field input:focus,
.template-field textarea:focus,
.template-field select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.template-field input::placeholder,
.template-field textarea::placeholder {
  color: #666;
  font-style: italic;
}

.template-field .field-help {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.template-field .field-help::before {
  content: '💡';
  font-size: 0.75rem;
}

/* Quick Capture Mode */
.quick-capture-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 149, 0, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px dashed rgba(255, 149, 0, 0.4);
}

.quick-capture-toggle label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-capture-toggle label::before {
  content: '⚡';
}

.quick-capture-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Quick Capture Simplified Form */
.quick-capture-form {
  display: none;
}

.quick-capture-form.active {
  display: block;
}

.quick-capture-form .mega-input {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.1rem;
  border: 2px solid #ff9500;
  border-radius: 12px;
  background: rgba(255, 149, 0, 0.05);
  margin-bottom: 1rem;
}

.quick-capture-form .mega-input:focus {
  border-color: #ff9500;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.2);
}

/* Template Preview */
.template-preview {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.template-preview h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #888;
}

.preview-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-field:last-child {
  border-bottom: none;
}

.preview-field .field-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #888;
}

.preview-field .field-value {
  font-size: 0.95rem;
}

.preview-field .field-value.empty {
  color: #555;
  font-style: italic;
}

/* Template Actions */
.template-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.template-actions .btn {
  flex: 1;
  min-width: 140px;
}

.btn-use-template {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-download-template {
  background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.btn-clear-form {
  background: transparent;
  border: 2px solid rgba(102, 126, 234, 0.3);
  color: var(--color-text);
}

/* Field Types Visual Indicators */
.template-field[data-type="priority"] select {
  background-image: linear-gradient(45deg, transparent 50%, rgba(102, 126, 234, 0.5) 50%),
                    linear-gradient(135deg, rgba(102, 126, 234, 0.5) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 12px) 50%;
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
}

.template-field[data-type="date"] input {
  position: relative;
}

/* Saved Templates */
.saved-templates {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.saved-templates h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.saved-template-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.saved-template-card:hover {
  background: rgba(102, 126, 234, 0.1);
}

.saved-template-card .template-name {
  flex: 1;
  font-weight: 500;
}

.saved-template-card .template-date {
  font-size: 0.8rem;
  color: #888;
}

/* Responsive */
@media (max-width: 768px) {
  .template-container {
    padding: 1.25rem;
    margin: 0 -1rem 1.5rem;
    border-radius: 0;
  }
  
  .voice-example-banner {
    flex-direction: column;
    text-align: center;
  }
  
  .preview-field {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  
  .template-actions {
    flex-direction: column;
  }
}
