/**
 * TubeOnAI Universal Summarizer Frontend Styles
 * 
 * Base styles for all summarizer tools
 */

/* Universal Summarizer Container */
.tubeonai-universal-summarizer {
  max-width: 800px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Tool Selection Dropdown */
.tubeonai-tool-selector {
  margin-bottom: 20px;
}

.tubeonai-tool-selector select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  background-color: white;
  transition: border-color 0.2s ease;
}

.tubeonai-tool-selector select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input Section Styles */
.tubeonai-input-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.tubeonai-input-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tubeonai-tab-button {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tubeonai-tab-button.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.tubeonai-tab-button:hover:not(.active) {
  background: #f3f4f6;
}

/* File Upload Styles */
.tubeonai-file-upload {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tubeonai-file-upload:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.tubeonai-file-upload.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.tubeonai-file-upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.tubeonai-file-upload-text {
  color: #6b7280;
  margin-bottom: 8px;
}

.tubeonai-file-upload-subtext {
  color: #9ca3af;
  font-size: 14px;
}

/* URL Input Styles */
.tubeonai-url-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.tubeonai-url-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tubeonai-url-input:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
}

/* Submit Button */
.tubeonai-submit-button {
  width: 100%;
  padding: 14px 24px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

.tubeonai-submit-button:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tubeonai-submit-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tubeonai-submit-button.loading {
  position: relative;
}

.tubeonai-submit-button.loading::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: tubeonai-spin 1s linear infinite;
}

@keyframes tubeonai-spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* Output Section */
.tubeonai-output-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.tubeonai-output-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tubeonai-output-tab {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  color: #6b7280;
}

.tubeonai-output-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tubeonai-output-tab:hover:not(.active) {
  color: #374151;
}

.tubeonai-output-content {
  line-height: 1.6;
  color: #374151;
}

/* Tool-specific color overrides */
.tubeonai-tool-youtube .tubeonai-submit-button { background: #ff0000; }
.tubeonai-tool-youtube .tubeonai-submit-button:hover { background: #cc0000; }

.tubeonai-tool-pdf .tubeonai-submit-button { background: #dc2626; }
.tubeonai-tool-pdf .tubeonai-submit-button:hover { background: #b91c1c; }

.tubeonai-tool-podcast .tubeonai-submit-button { background: #1db954; }
.tubeonai-tool-podcast .tubeonai-submit-button:hover { background: #1ed760; }

.tubeonai-tool-twitter .tubeonai-submit-button { background: #1da1f2; }
.tubeonai-tool-twitter .tubeonai-submit-button:hover { background: #1991db; }

.tubeonai-tool-powerpoint .tubeonai-submit-button { background: #d24726; }
.tubeonai-tool-powerpoint .tubeonai-submit-button:hover { background: #c73e1d; }

/* Examples and Help Text */
.tubeonai-examples {
  margin-top: 12px;
  padding: 12px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 14px;
}

.tubeonai-examples-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.tubeonai-examples-list {
  color: #6b7280;
  line-height: 1.5;
}

.tubeonai-help-text {
  margin-top: 8px;
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
}

/* Error States */
.tubeonai-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

/* Success States */
.tubeonai-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #059669;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

/* Loading States */
.tubeonai-loading {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.tubeonai-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: tubeonai-spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tubeonai-universal-summarizer {
    margin: 0 16px;
  }
  
  .tubeonai-input-section {
    padding: 16px;
  }
  
  .tubeonai-output-section {
    padding: 16px;
  }
  
  .tubeonai-output-tabs {
    font-size: 14px;
  }
  
  .tubeonai-output-tab {
    padding: 10px 12px;
  }
}

/* Accessibility */
.tubeonai-submit-button:focus,
.tubeonai-url-input:focus,
.tubeonai-tool-selector select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .tubeonai-input-section,
  .tubeonai-submit-button {
    display: none;
  }
  
  .tubeonai-output-section {
    border: none;
    box-shadow: none;
  }
}