
/* Scoped styles for the HobTools HTML Viewer */
#hobtools-html-viewer * { box-sizing: border-box; }
#hobtools-html-viewer { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #333; }
#hobtools-html-viewer .container { max-width: 1400px; margin: 0 auto; padding: 20px; background: #f5f7fa; border-radius: 12px; }
#hobtools-html-viewer .header { text-align: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
#hobtools-html-viewer .header h1 { font-size: 2.5rem; margin-bottom: 10px; font-weight: 700; }
#hobtools-html-viewer .header p { font-size: 1.1rem; opacity: 0.9; }

#hobtools-html-viewer .controls { background: white; padding: 25px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
#hobtools-html-viewer .control-group { display: flex; flex-direction: column; gap: 8px; }
#hobtools-html-viewer .control-group label { font-weight: 600; color: #2c3e50; font-size: 14px; }
#hobtools-html-viewer .control-select, 
#hobtools-html-viewer .control-input { padding: 10px 12px; border: 2px solid #e1e5e9; border-radius: 8px; font-size: 14px; background: white; transition: border-color 0.3s ease; }
#hobtools-html-viewer .control-select:focus, 
#hobtools-html-viewer .control-input:focus { outline: none; border-color: #667eea; }

#hobtools-html-viewer .buttons { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; margin-bottom: 25px; }
#hobtools-html-viewer .btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; color: white; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
#hobtools-html-viewer .btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
#hobtools-html-viewer .btn:disabled { opacity: 0.6; cursor: not-allowed; }
#hobtools-html-viewer .btn-secondary { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
#hobtools-html-viewer .btn-tertiary { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

#hobtools-html-viewer .editor-container { display: grid; grid-template-columns: 50% 50%; gap: 20px; min-height: 700px; height: 70vh; position: relative; }
#hobtools-html-viewer .editor-container::before { content: ''; position: absolute; left: 50%; top: 10%; bottom: 10%; width: 2px; background: linear-gradient(to bottom, transparent, #667eea, transparent); transform: translateX(-50%); z-index: 1; pointer-events: none; }

#hobtools-html-viewer .panel { background: white; border: 2px solid #e1e5e9; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
#hobtools-html-viewer .panel-header { background: #f8f9fa; padding: 15px 20px; border-bottom: 1px solid #e1e5e9; display: flex; justify-content: space-between; align-items: center; }
#hobtools-html-viewer .panel-title { font-weight: 600; color: #2c3e50; font-size: 16px; }
#hobtools-html-viewer .panel-actions { display: flex; gap: 8px; }
#hobtools-html-viewer .mini-btn { background: #6c757d; color: white; border: none; padding: 6px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; transition: background 0.3s ease; }
#hobtools-html-viewer .mini-btn:hover { background: #5a6268; }

#hobtools-html-viewer .tabs { display: flex; background: #f8f9fa; border-bottom: 1px solid #e1e5e9; }
#hobtools-html-viewer .tab { padding: 12px 20px; border: none; background: transparent; color: #6c757d; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; border-bottom: 3px solid transparent; }
#hobtools-html-viewer .tab:hover { background: #e9ecef; color: #495057; }
#hobtools-html-viewer .tab.active { color: #667eea; border-bottom-color: #667eea; background: white; }

#hobtools-html-viewer .tab-content { display: none; flex: 1; flex-direction: column; }
#hobtools-html-viewer .tab-content.active { display: flex; }

#hobtools-html-viewer .code-editor { flex: 1; width: 100%; border: none; padding: 20px; font-family: 'Monaco', 'Menlo', 'Consolas', monospace; font-size: 14px; line-height: 1.5; resize: none; outline: none; background: #ffffff; color: #2c3e50; }
#hobtools-html-viewer .preview { flex: 1; border: none; background: white; width: 100%; height: 100%; }

#hobtools-html-viewer .templates { background: white; border-radius: 12px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); display: none; }
#hobtools-html-viewer .templates.show { display: block; }
#hobtools-html-viewer .templates h3 { margin-bottom: 20px; color: #2c3e50; font-size: 1.3rem; }
#hobtools-html-viewer .template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
#hobtools-html-viewer .template-card { background: #f8f9fa; border: 1px solid #e1e5e9; border-radius: 8px; padding: 15px; cursor: pointer; transition: all 0.3s ease; }
#hobtools-html-viewer .template-card:hover { background: #e9ecef; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
#hobtools-html-viewer .template-title { font-weight: 600; color: #2c3e50; margin-bottom: 8px; }
#hobtools-html-viewer .template-desc { font-size: 13px; color: #6c757d; margin-bottom: 10px; }
#hobtools-html-viewer .template-preview { font-family: 'Monaco', 'Menlo', 'Consolas', monospace; font-size: 11px; color: #495057; background: white; padding: 8px; border-radius: 4px; border: 1px solid #dee2e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#hobtools-html-viewer .message { padding: 15px; border-radius: 8px; margin-bottom: 20px; display: none; }
#hobtools-html-viewer .message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#hobtools-html-viewer .message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
#hobtools-html-viewer .message.show { display: block; }

@media (max-width: 1024px) {
  #hobtools-html-viewer .editor-container { grid-template-columns: 1fr; height: auto; min-height: 500px; }
  #hobtools-html-viewer .panel { min-height: 400px; }
  #hobtools-html-viewer .controls { grid-template-columns: 1fr; }
  #hobtools-html-viewer .buttons { flex-direction: column; }
  #hobtools-html-viewer .btn { width: 100%; }
}
@media (max-width: 768px) {
  #hobtools-html-viewer .container { padding: 10px; }
  #hobtools-html-viewer .header h1 { font-size: 2rem; }
  #hobtools-html-viewer .template-grid { grid-template-columns: 1fr; }
}
